aboutsummaryrefslogtreecommitdiffstats
path: root/spec/controllers/request_controller_spec.rb
diff options
context:
space:
mode:
authorGareth Rees <gareth@mysociety.org>2015-01-13 13:57:43 +0000
committerGareth Rees <gareth@mysociety.org>2015-01-13 13:57:43 +0000
commit74f325825c3a5b94794253009a10f002dac3fa39 (patch)
tree591f9220857febd5660b70f5b49fbc67ef4fdcb5 /spec/controllers/request_controller_spec.rb
parent157a8ee3fabcc1502fe5fdda0f783eeec65af8c6 (diff)
parentebf549a966a9c559bfa76b66f4ab86a75c2c1c92 (diff)
Merge branch '1682-just-made-a-request' into rails-3-develop
Diffstat (limited to 'spec/controllers/request_controller_spec.rb')
-rw-r--r--spec/controllers/request_controller_spec.rb15
1 files changed, 12 insertions, 3 deletions
diff --git a/spec/controllers/request_controller_spec.rb b/spec/controllers/request_controller_spec.rb
index 2d3ccfa63..aeb27f918 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
@@ -2554,10 +2564,9 @@ describe RequestController, "#new_batch" do
assigns[:existing_batch].should_not be_nil
end
- it 'should display a success notice' do
+ it 'sets the batch_sent flash to true' do
make_request
- notice_text = "<p>Your Freedom of Information requests will be <strong>sent</strong> shortly!"
- flash[:notice].should match notice_text
+ expect(flash[:batch_sent]).to be_true
end
end