diff options
Diffstat (limited to 'spec/controllers/request_controller_spec.rb')
-rw-r--r-- | spec/controllers/request_controller_spec.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/controllers/request_controller_spec.rb b/spec/controllers/request_controller_spec.rb index 2d3ccfa63..dc28f6dab 100644 --- a/spec/controllers/request_controller_spec.rb +++ b/spec/controllers/request_controller_spec.rb @@ -1073,6 +1073,16 @@ describe RequestController, "when creating a new request" do response.redirect_url.should =~ /request\/why_is_your_quango_called_gerald\/new$/ end + it "sets the request_sent flash to true if successful" do + session[:user_id] = @user.id + post :new, :info_request => { :public_body_id => @body.id, + :title => "Why is your quango called Geraldine?", :tag_string => "" }, + :outgoing_message => { :body => "This is a silly letter. It is too short to be interesting." }, + :submitted_new_request => 1, :preview => 0 + + expect(flash[:request_sent]).to be_true + end + it "should give an error if the same request is submitted twice" do session[:user_id] = @user.id |