aboutsummaryrefslogtreecommitdiffstats
path: root/spec/controllers/request_controller_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/controllers/request_controller_spec.rb')
-rw-r--r--spec/controllers/request_controller_spec.rb9
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