aboutsummaryrefslogtreecommitdiffstats
path: root/spec/controllers/request_controller_spec.rb
diff options
context:
space:
mode:
authorMatthew Landauer <matthew@openaustralia.org>2013-02-28 16:04:30 +1100
committerMatthew Landauer <matthew@openaustralia.org>2013-03-02 14:49:14 +1100
commit43230ddb09284bce0ef8635f805acc2a1190809a (patch)
tree08e01ff1d03bf4672fa9ac2b60d4353983f9be53 /spec/controllers/request_controller_spec.rb
parentd9fd0afaca38c0818ebd1221bd4843014ad6992c (diff)
New request controller action for requires_admin state with message
Diffstat (limited to 'spec/controllers/request_controller_spec.rb')
-rw-r--r--spec/controllers/request_controller_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/controllers/request_controller_spec.rb b/spec/controllers/request_controller_spec.rb
index fdde54eeb..6fcf43cab 100644
--- a/spec/controllers/request_controller_spec.rb
+++ b/spec/controllers/request_controller_spec.rb
@@ -1509,6 +1509,22 @@ describe RequestController, "when classifying an information request" do
mail.from_addrs.first.to_s.should == @request_owner.name_and_email
end
+ it "should send an email with a message when classified as requires_admin" do
+ post :describe_state_requires_admin, :message => "Something weird happened", :id => @dog_request.id
+
+ @dog_request.reload
+ @dog_request.awaiting_description.should == false
+ @dog_request.described_state.should == 'requires_admin'
+ @dog_request.get_last_response_event.calculated_state.should == 'requires_admin'
+
+ deliveries = ActionMailer::Base.deliveries
+ deliveries.size.should == 1
+ mail = deliveries[0]
+ mail.body.should =~ /as needing admin/
+ mail.body.should =~ /Something weird happened/
+ mail.from_addrs.first.to_s.should == @request_owner.name_and_email
+ end
+
it 'should say it is showing advice as to what to do next' do
post_status('rejected')
flash[:notice].should match(/Here is what to do now/)