aboutsummaryrefslogtreecommitdiffstats
path: root/spec/controllers/request_controller_spec.rb
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2012-08-20 17:05:37 +0100
committerLouise Crow <louise.crow@gmail.com>2012-08-20 17:07:35 +0100
commit804ce54e241f99e4e146c8c6ffded5fbb1adc790 (patch)
treed53db61991c12c36b9083b221c7a2b2705cd4d7f /spec/controllers/request_controller_spec.rb
parent07c52c0f56a2513aa2fd0abe5d712e87af4583cf (diff)
Use find_by_url_title! to raise ActiveRecordNotFound in upload response when no record is found using url_title.
Closes #553.
Diffstat (limited to 'spec/controllers/request_controller_spec.rb')
-rw-r--r--spec/controllers/request_controller_spec.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/spec/controllers/request_controller_spec.rb b/spec/controllers/request_controller_spec.rb
index 8cadbd238..13dbe4b74 100644
--- a/spec/controllers/request_controller_spec.rb
+++ b/spec/controllers/request_controller_spec.rb
@@ -1736,6 +1736,10 @@ describe RequestController, "authority uploads a response from the web interface
flash[:error].should match(/Please type a message/)
end
+ it 'should 404 for non existent requests' do
+ lambda{ post :upload_response, :url_title => 'i_dont_exist'}.should raise_error(ActiveRecord::RecordNotFound)
+ end
+
# How do I test a file upload in rails?
# http://stackoverflow.com/questions/1178587/how-do-i-test-a-file-upload-in-rails
it "should let the authority upload a file" do