From e59207a79b6536ec44c580d3e31943a2e95e09fc Mon Sep 17 00:00:00 2001 From: Seb Bacon Date: Tue, 24 Jan 2012 11:54:05 +0000 Subject: Return a 404 for missing user profile pictures. Fixes #363 --- spec/controllers/user_controller_spec.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'spec/controllers/user_controller_spec.rb') diff --git a/spec/controllers/user_controller_spec.rb b/spec/controllers/user_controller_spec.rb index 0cf574aa9..2b5fb17e3 100644 --- a/spec/controllers/user_controller_spec.rb +++ b/spec/controllers/user_controller_spec.rb @@ -526,6 +526,13 @@ describe UserController, "when using profile photos" do post :set_profile_photo, { :id => @user.id, :file => @uploadedfile, :submitted_draft_profile_photo => 1, :automatically_crop => 1 } end + it "should return a 404 not a 500 when a profile photo has not been set" do + @user.profile_photo.should be_nil + lambda { + get :get_profile_photo, {:url_name => @user.url_name } + }.should raise_error(ActiveRecord::RecordNotFound) + end + it "should let you change profile photo if you're logged in as the user" do @user.profile_photo.should be_nil session[:user_id] = @user.id -- cgit v1.2.3 From 1b4b35f187e8fbe0fbb4a074853c7e3c5593ac4d Mon Sep 17 00:00:00 2001 From: Robin Houston Date: Tue, 24 Jan 2012 18:28:02 +0000 Subject: More better test isolation Towards #361. Fixes: spec/models/xapian_spec.rb spec/controllers/user_controller_spec.rb --- spec/controllers/user_controller_spec.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'spec/controllers/user_controller_spec.rb') diff --git a/spec/controllers/user_controller_spec.rb b/spec/controllers/user_controller_spec.rb index d8e92fbd0..1e25c1b44 100644 --- a/spec/controllers/user_controller_spec.rb +++ b/spec/controllers/user_controller_spec.rb @@ -11,6 +11,7 @@ describe UserController, "when showing a user" do fixtures :users, :public_bodies, :public_body_translations, :public_body_versions, :info_requests, :raw_emails, :incoming_messages, :outgoing_messages, :comments, :info_request_events, :track_things before(:each) do load_raw_emails_data(raw_emails) + rebuild_xapian_index end it "should be successful" do -- cgit v1.2.3