aboutsummaryrefslogtreecommitdiffstats
path: root/spec/integration/request_controller_spec.rb
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2013-09-24 11:29:31 +0100
committerLouise Crow <louise.crow@gmail.com>2013-09-24 11:29:31 +0100
commitd8deb8418b4cd26c68eb1301959e156c19b111e2 (patch)
tree99c346db95d17be9c5105ce47d5f3ac8e943e952 /spec/integration/request_controller_spec.rb
parent8459314b691f5b02277035219cd58f510d100a77 (diff)
parent75542416a1cc36b353ade557b1bc4f729b02423a (diff)
Merge branch 'release/0.14'0.14
Conflicts: locale/bg/app.po locale/fr/app.po locale/fr_CA/app.po locale/he_IL/app.po locale/hr/app.po locale/it/app.po locale/nb_NO/app.po locale/pl/app.po locale/sv/app.po locale/vi/app.po
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