diff options
author | francis <francis> | 2007-11-01 14:45:56 +0000 |
---|---|---|
committer | francis <francis> | 2007-11-01 14:45:56 +0000 |
commit | 9e08e323fcdcf763d76ede20807893f6bbfb7fbf (patch) | |
tree | 75862722c1aea384bebc0095e22ebb4cf387c6cd /spec/controllers/request_controller_spec.rb | |
parent | acbd0f3e2f47e5fd1d235dd8e12351b85a499eca (diff) |
Save post request properly into database with a model, as a record of where to
redirect back to after login.
Token generation for these saved logins.
Diffstat (limited to 'spec/controllers/request_controller_spec.rb')
-rw-r--r-- | spec/controllers/request_controller_spec.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/spec/controllers/request_controller_spec.rb b/spec/controllers/request_controller_spec.rb index 41ff2b6b6..7ba066ad2 100644 --- a/spec/controllers/request_controller_spec.rb +++ b/spec/controllers/request_controller_spec.rb @@ -74,7 +74,13 @@ describe RequestController, "when creating a new request" do post :create, :info_request => { :public_body_id => public_bodies(:geraldine_public_body).id, :title => "Why is your quango called Geraldine?"}, :outgoing_message => { :body => "This is a silly letter. It is too short to be interesting." } - response.should redirect_to(:controller => 'user', :action => 'signin') + # XXX yeuch - no other easy way of getting the token so we can check + # the redirect URL, as it is by definition opaque to the controller + # apart from in the place that it redirects to. + post_redirects = PostRedirect.find_by_sql("select * from post_redirects order by id desc limit 1") + post_redirects.size.should == 1 + post_redirect = post_redirects[0] + response.should redirect_to(:controller => 'user', :action => 'signin', :token => post_redirect.token) end it "should create the request and outgoing message and redirec to request page when input is good and somebody is logged in" do |