diff options
author | francis <francis> | 2008-01-04 10:56:22 +0000 |
---|---|---|
committer | francis <francis> | 2008-01-04 10:56:22 +0000 |
commit | d291a7fef26c910957a0d58cdff4a8e8073b3ff7 (patch) | |
tree | 3e5997ca0cc3d60d6dc971b99be62963fa5b38ed /spec/controllers/request_controller_spec.rb | |
parent | 75b1cb7e1678ad0949020f549acd464ce4d38155 (diff) |
Prevent (probably accidental) double posting of the same request.
Diffstat (limited to 'spec/controllers/request_controller_spec.rb')
-rw-r--r-- | spec/controllers/request_controller_spec.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/spec/controllers/request_controller_spec.rb b/spec/controllers/request_controller_spec.rb index 412ad0d5b..7dde21ba5 100644 --- a/spec/controllers/request_controller_spec.rb +++ b/spec/controllers/request_controller_spec.rb @@ -87,7 +87,7 @@ end describe RequestController, "when creating a new request" do integrate_views - fixtures :info_requests, :public_bodies, :users + fixtures :info_requests, :outgoing_messages, :public_bodies, :users it "should render with 'new' template" do get :new @@ -136,6 +136,13 @@ describe RequestController, "when creating a new request" do om.body.should == "This is a silly letter. It is too short to be interesting." response.should redirect_to(:controller => 'request', :action => 'show', :id => ir.id) end + + it "should give an error if the same request is submitted twice" do + post :create, :info_request => { :public_body_id => info_requests(:fancy_dog_request).public_body_id, + :title => info_requests(:fancy_dog_request).title}, + :outgoing_message => { :body => info_requests(:fancy_dog_request).outgoing_messages[0].body} + response.should render_template('new') + end end |