aboutsummaryrefslogtreecommitdiffstats
path: root/spec/controllers/request_controller_spec.rb
diff options
context:
space:
mode:
authorRobin Houston <robin.houston@gmail.com>2012-09-13 14:50:59 +0100
committerRobin Houston <robin.houston@gmail.com>2012-09-13 14:50:59 +0100
commit1e2b6a8acf65f48edb1e03f4f024db9644765897 (patch)
treed8b87e874e383fcac83e29cf05673606c946fc4e /spec/controllers/request_controller_spec.rb
parentbd94b0390fcfba53bee7d546227e94e860f37c17 (diff)
parent6d3d9d9846fa905e606f0a2aa6f1ec32122f4850 (diff)
Merge branch 'wdtk' of git.mysociety.org:/data/git/public/alaveteli into wdtk
Diffstat (limited to 'spec/controllers/request_controller_spec.rb')
-rw-r--r--spec/controllers/request_controller_spec.rb14
1 files changed, 12 insertions, 2 deletions
diff --git a/spec/controllers/request_controller_spec.rb b/spec/controllers/request_controller_spec.rb
index b8425613c..95737a250 100644
--- a/spec/controllers/request_controller_spec.rb
+++ b/spec/controllers/request_controller_spec.rb
@@ -1275,7 +1275,8 @@ describe RequestController, "when classifying an information request" do
expected_params = {:user_id => users(:silly_name_user).id,
:old_described_state => 'waiting_response',
:described_state => 'rejected'}
- @dog_request.should_receive(:log_event).with("status_update", expected_params)
+ event = mock_model(InfoRequestEvent)
+ @dog_request.should_receive(:log_event).with("status_update", expected_params).and_return(event)
post_status('rejected')
end
@@ -1314,10 +1315,19 @@ describe RequestController, "when classifying an information request" do
end
it 'should log a status update event' do
+ event = mock_model(InfoRequestEvent)
expected_params = {:user_id => @admin_user.id,
:old_described_state => 'waiting_response',
:described_state => 'rejected'}
- @dog_request.should_receive(:log_event).with("status_update", expected_params)
+ @dog_request.should_receive(:log_event).with("status_update", expected_params).and_return(event)
+ post_status('rejected')
+ end
+
+ it 'should record a classification' do
+ event = mock_model(InfoRequestEvent)
+ @dog_request.stub!(:log_event).with("status_update", anything()).and_return(event)
+ RequestClassification.should_receive(:create!).with(:user_id => @admin_user.id,
+ :info_request_event_id => event.id)
post_status('rejected')
end