aboutsummaryrefslogtreecommitdiffstats
path: root/spec/controllers/request_controller_spec.rb
diff options
context:
space:
mode:
authorMatthew Landauer <matthew@openaustralia.org>2013-03-22 14:22:26 +1100
committerMatthew Landauer <matthew@openaustralia.org>2013-03-22 14:22:26 +1100
commit06c1d5844c7da1f03acb930afe29f6c7221c62ba (patch)
treeca2f048aa657b99b0d19d5632df68f24d007efc1 /spec/controllers/request_controller_spec.rb
parent01a8eed6e9aec5b2539ed9afe1d198972d0c96ec (diff)
Posted reason and message gets sent out in the email
Diffstat (limited to 'spec/controllers/request_controller_spec.rb')
-rw-r--r--spec/controllers/request_controller_spec.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/controllers/request_controller_spec.rb b/spec/controllers/request_controller_spec.rb
index 02a013906..d73fb89c7 100644
--- a/spec/controllers/request_controller_spec.rb
+++ b/spec/controllers/request_controller_spec.rb
@@ -2329,6 +2329,13 @@ describe RequestController, "when reporting a request (logged in)" do
assigns[:info_request].described_state.should == "attention_requested"
end
+ it "should pass on the reason and message" do
+ info_request = mock_model(InfoRequest, :url_title => "foo", :attention_requested= => nil, :save! => nil)
+ InfoRequest.should_receive(:find_by_url_title!).with("foo").and_return(info_request)
+ info_request.should_receive(:set_described_state).with("attention_requested", @user, "Reason: Not valid request\n\nIt's just not")
+ post :report_request, :url_title => "foo", :reason => "Not valid request", :message => "It's just not"
+ end
+
it "should not allow a request to be reported twice" do
title = info_requests(:badger_request).url_title