aboutsummaryrefslogtreecommitdiffstats
path: root/spec/integration/request_controller_spec.rb
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2013-09-17 17:39:51 +0100
committerLouise Crow <louise.crow@gmail.com>2013-09-17 17:39:51 +0100
commit6fbcb461025dc315d688038d9f0a8e138d00ba33 (patch)
tree628ad3d7bf9cb2310bc2bed2e94b8670532a0dd4 /spec/integration/request_controller_spec.rb
parentabde5e4a1139c41c6db23ce041fba090674f65ac (diff)
parentf41ec6d1cb167058a808b7820da5345c6da962fd (diff)
Merge branch 'feature/hide-individual-responses' into rails-3-develop
Conflicts: Gemfile app/views/admin_request/edit_outgoing.html.erb config/packages doc/CHANGES.md doc/INSTALL.md spec/models/info_request_spec.rb spec/models/public_body_spec.rb
Diffstat (limited to 'spec/integration/request_controller_spec.rb')
-rw-r--r--spec/integration/request_controller_spec.rb17
1 files changed, 7 insertions, 10 deletions
diff --git a/spec/integration/request_controller_spec.rb b/spec/integration/request_controller_spec.rb
index 9e585448b..f5de692b8 100644
--- a/spec/integration/request_controller_spec.rb
+++ b/spec/integration/request_controller_spec.rb
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
+require File.expand_path(File.dirname(__FILE__) + '/alaveteli_dsl')
describe RequestController, "when classifying an information request" do
@@ -16,26 +17,22 @@ describe RequestController, "when classifying an information request" do
describe 'when logged in as the requestor' do
before :each do
- @request_owner = @dog_request.user
- visit signin_path
- fill_in "Your e-mail:", :with => @request_owner.email
- fill_in "Password:", :with => "jonespassword"
- click_button "Sign in"
+ @bob = login(:bob_smith_user)
end
it "should send an email including the message" do
- visit describe_state_message_path(:url_title => @dog_request.url_title,
+ @bob.visit describe_state_message_path(:url_title => @dog_request.url_title,
:described_state => "requires_admin")
- fill_in "Please tell us more:", :with => "Okay. I don't quite understand."
- click_button "Submit status and send message"
+ @bob.fill_in "Please tell us more:", :with => "Okay. I don't quite understand."
+ @bob.click_button "Submit status and send message"
- response.should contain "Thank you! We'll look into what happened and try and fix it up."
+ @bob.response.should contain "Thank you! We'll look into what happened and try and fix it up."
deliveries = ActionMailer::Base.deliveries
deliveries.size.should == 1
mail = deliveries[0]
mail.body.should =~ /as needing admin/
- mail.body.should =~ /Okay. I don't quite understand./
+ mail.body.should =~ /Okay. I don't quite understand./
end
end
end