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.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 1a2992611..02237b29d 100644
--- a/spec/controllers/request_controller_spec.rb
+++ b/spec/controllers/request_controller_spec.rb
@@ -1087,6 +1087,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
@@ -2568,10 +2578,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