aboutsummaryrefslogtreecommitdiffstats
path: root/spec/controllers/request_controller_spec.rb
diff options
context:
space:
mode:
authorfrancis <francis>2007-11-08 16:18:24 +0000
committerfrancis <francis>2007-11-08 16:18:24 +0000
commite025beb0095634faf2b16be87465fb9c00b806eb (patch)
tree7a56cf88ba9140002e7d1e520e6f4cfef05f3d12 /spec/controllers/request_controller_spec.rb
parent24a792b27884e411a94366e9e0606ebfa7d86153 (diff)
Add lots more tests.
Fix an ACTUAL BUG a test found :)
Diffstat (limited to 'spec/controllers/request_controller_spec.rb')
-rw-r--r--spec/controllers/request_controller_spec.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/spec/controllers/request_controller_spec.rb b/spec/controllers/request_controller_spec.rb
index 22965871c..9c0997569 100644
--- a/spec/controllers/request_controller_spec.rb
+++ b/spec/controllers/request_controller_spec.rb
@@ -94,9 +94,11 @@ describe RequestController, "when creating a new request" do
end
it "should redirect to sign in page when input is good and nobody is logged in" do
- post :create, :info_request => { :public_body_id => public_bodies(:geraldine_public_body).id,
+ params = { :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." }
+ :outgoing_message => { :body => "This is a silly letter. It is too short to be interesting." }
+ }
+ post :create, params
# 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.
@@ -104,6 +106,7 @@ describe RequestController, "when creating a new request" do
post_redirects.size.should == 1
post_redirect = post_redirects[0]
response.should redirect_to(:controller => 'user', :action => 'signin', :token => post_redirect.token)
+ # post_redirect.post_params.should == params # XXX get this working. there's a : vs '' problem amongst others
end
it "should create the request and outgoing message and redirect to request page when input is good and somebody is logged in" do