diff options
author | Gareth Rees <gareth@mysociety.org> | 2015-01-07 13:40:40 +0000 |
---|---|---|
committer | Gareth Rees <gareth@mysociety.org> | 2015-01-13 13:48:06 +0000 |
commit | 99fb6b483cca96bd55a64bc1137e1070e01b32ba (patch) | |
tree | 2f21f674c40d1ae83d0c9f780a66471ae3e772bc /spec/controllers/request_controller_spec.rb | |
parent | bd1c11a86f2647753ac52a037385a829edd6a56c (diff) |
Use a partial to render request sent message
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 |