Class: RedirectSpecController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- RedirectSpecController
- Defined in:
- lib/vendor/plugins/rspec-rails/spec/resources/controllers/redirect_spec_controller.rb
Instance Method Summary collapse
- #action_to_redirect_to_action_with_method_restriction ⇒ Object
- #action_with_method_restriction ⇒ Object
- #action_with_no_redirect ⇒ Object
- #action_with_redirect_back ⇒ Object
- #action_with_redirect_in_respond_to ⇒ Object
- #action_with_redirect_to_other_somewhere ⇒ Object
- #action_with_redirect_to_rspec_site ⇒ Object
- #action_with_redirect_to_somewhere ⇒ Object
- #action_with_redirect_to_somewhere_and_return ⇒ Object
- #action_with_redirect_to_somewhere_with_status ⇒ Object
- #action_with_redirect_to_unroutable_url_inside_app ⇒ Object
- #action_with_redirect_which_creates_query_string ⇒ Object
-
#action_with_redirect_with_query_string_order1 ⇒ Object
note: sometimes this is the URL which rails will generate from the hash in action_with_redirect_which_creates_query_string.
-
#action_with_redirect_with_query_string_order2 ⇒ Object
note: sometimes this is the URL which rails will generate from the hash in action_with_redirect_which_creates_query_string.
- #somewhere ⇒ Object
Instance Method Details
#action_to_redirect_to_action_with_method_restriction ⇒ Object
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_restriction ⇒ Object
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_redirect ⇒ Object
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_back ⇒ Object
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_to ⇒ Object
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_somewhere ⇒ Object
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_site ⇒ Object
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_somewhere ⇒ Object
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_return ⇒ Object
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_status ⇒ Object
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_app ⇒ Object
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_string ⇒ Object
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_order1 ⇒ Object
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¶m2=value2" end |
#action_with_redirect_with_query_string_order2 ⇒ Object
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¶m1=value1" end |
#somewhere ⇒ Object
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 |