Updated Rails to 2.1.0
[gitorious:georgyos-clone.git] / vendor / plugins / rspec_on_rails / spec_resources / controllers / redirect_spec_controller.rb
1 class RedirectSpecController < ApplicationController
2
3   def action_with_no_redirect
4     render :text => "this is just here to keep this from causing a MissingTemplate error"
5   end
6   
7   def action_with_redirect_to_somewhere
8     redirect_to :action => 'somewhere'
9   end
10   
11   def action_with_redirect_to_other_somewhere
12     redirect_to :controller => 'render_spec', :action => 'text_action'
13   end
14   
15   def action_with_redirect_to_somewhere_and_return
16     redirect_to :action => 'somewhere' and return
17     render :text => "this is after the return"
18   end
19   
20   def somewhere
21     render :text => "this is just here to keep this from causing a MissingTemplate error"
22   end
23   
24   def action_with_redirect_to_rspec_site
25     redirect_to "http://rspec.rubyforge.org"
26   end
27   
28   def action_with_redirect_back
29     redirect_to :back
30   end
31   
32   def action_with_redirect_in_respond_to
33     respond_to do |wants|
34       wants.html { redirect_to :action => 'somewhere' }
35     end
36   end
37
38   def action_with_redirect_which_creates_query_string
39     redirect_to :action => "somewhere", :id => 1111, :param1 => "value1", :param2 => "value2"
40   end
41
42   # note: sometimes this is the URL which rails will generate from the hash in
43   # action_with_redirect_which_creates_query_string
44   def action_with_redirect_with_query_string_order1
45     redirect_to "http://test.host/redirect_spec/somewhere/1111?param1=value1&param2=value2"
46   end
47
48   # note: sometimes this is the URL which rails will generate from the hash in
49   # action_with_redirect_which_creates_query_string
50   def action_with_redirect_with_query_string_order2
51     redirect_to "http://test.host/redirect_spec/somewhere/1111?param2=value2&param1=value1"
52   end
53
54   def action_with_redirect_to_unroutable_url_inside_app
55     redirect_to :controller => "nonexistant", :action => "none"
56   end
57
58 end
59