Class: RedirectSpecController

Inherits:
ApplicationController show all
Defined in:
lib/vendor/plugins/rspec-rails/spec/resources/controllers/redirect_spec_controller.rb

Instance Method Summary collapse

Instance Method Details

#action_to_redirect_to_action_with_method_restrictionObject



62
63
64
# File 'lib/vendor/plugins/rspec-rails/spec/resources/controllers/redirect_spec_controller.rb', line 62

def action_to_redirect_to_action_with_method_restriction
  redirect_to :action => 'action_with_method_restriction'
end

#action_with_method_restrictionObject



58
59
60
# File 'lib/vendor/plugins/rspec-rails/spec/resources/controllers/redirect_spec_controller.rb', line 58

def action_with_method_restriction
  render :text => ''
end

#action_with_no_redirectObject



3
4
5
# File 'lib/vendor/plugins/rspec-rails/spec/resources/controllers/redirect_spec_controller.rb', line 3

def action_with_no_redirect
  render :text => "this is just here to keep this from causing a MissingTemplate error"
end

#action_with_redirect_backObject



28
29
30
# File 'lib/vendor/plugins/rspec-rails/spec/resources/controllers/redirect_spec_controller.rb', line 28

def action_with_redirect_back
  redirect_to :back
end

#action_with_redirect_in_respond_toObject



32
33
34
35
36
# File 'lib/vendor/plugins/rspec-rails/spec/resources/controllers/redirect_spec_controller.rb', line 32

def action_with_redirect_in_respond_to
  respond_to do |wants|
    wants.html { redirect_to :action => 'somewhere' }
  end
end

#action_with_redirect_to_other_somewhereObject



11
12
13
# File 'lib/vendor/plugins/rspec-rails/spec/resources/controllers/redirect_spec_controller.rb', line 11

def action_with_redirect_to_other_somewhere
  redirect_to :controller => 'render_spec', :action => 'text_action'
end

#action_with_redirect_to_rspec_siteObject



24
25
26
# File 'lib/vendor/plugins/rspec-rails/spec/resources/controllers/redirect_spec_controller.rb', line 24

def action_with_redirect_to_rspec_site
  redirect_to "http://rspec.rubyforge.org"
end

#action_with_redirect_to_somewhereObject



7
8
9
# File 'lib/vendor/plugins/rspec-rails/spec/resources/controllers/redirect_spec_controller.rb', line 7

def action_with_redirect_to_somewhere
  redirect_to :action => 'somewhere'
end

#action_with_redirect_to_somewhere_and_returnObject



15
16
17
18
# File 'lib/vendor/plugins/rspec-rails/spec/resources/controllers/redirect_spec_controller.rb', line 15

def action_with_redirect_to_somewhere_and_return
  redirect_to :action => 'somewhere' and return
  render :text => "this is after the return"
end

#action_with_redirect_to_somewhere_with_statusObject



66
67
68
# File 'lib/vendor/plugins/rspec-rails/spec/resources/controllers/redirect_spec_controller.rb', line 66

def action_with_redirect_to_somewhere_with_status
  redirect_to :action => 'somewhere', :status => 301
end

#action_with_redirect_to_unroutable_url_inside_appObject



54
55
56
# File 'lib/vendor/plugins/rspec-rails/spec/resources/controllers/redirect_spec_controller.rb', line 54

def action_with_redirect_to_unroutable_url_inside_app
  redirect_to :controller => "nonexistant", :action => "none"
end

#action_with_redirect_which_creates_query_stringObject



38
39
40
# File 'lib/vendor/plugins/rspec-rails/spec/resources/controllers/redirect_spec_controller.rb', line 38

def action_with_redirect_which_creates_query_string
  redirect_to :action => "somewhere", :id => 1111, :param1 => "value1", :param2 => "value2"
end

#action_with_redirect_with_query_string_order1Object

note: sometimes this is the URL which rails will generate from the hash in action_with_redirect_which_creates_query_string



44
45
46
# File 'lib/vendor/plugins/rspec-rails/spec/resources/controllers/redirect_spec_controller.rb', line 44

def action_with_redirect_with_query_string_order1
  redirect_to "http://test.host/redirect_spec/somewhere/1111?param1=value1&param2=value2"
end

#action_with_redirect_with_query_string_order2Object

note: sometimes this is the URL which rails will generate from the hash in action_with_redirect_which_creates_query_string



50
51
52
# File 'lib/vendor/plugins/rspec-rails/spec/resources/controllers/redirect_spec_controller.rb', line 50

def action_with_redirect_with_query_string_order2
  redirect_to "http://test.host/redirect_spec/somewhere/1111?param2=value2&param1=value1"
end

#somewhereObject



20
21
22
# File 'lib/vendor/plugins/rspec-rails/spec/resources/controllers/redirect_spec_controller.rb', line 20

def somewhere
  render :text => "this is just here to keep this from causing a MissingTemplate error"
end