diff options
author | Seb Bacon <seb.bacon@gmail.com> | 2012-01-24 11:54:05 +0000 |
---|---|---|
committer | Seb Bacon <seb.bacon@gmail.com> | 2012-01-24 11:54:05 +0000 |
commit | e59207a79b6536ec44c580d3e31943a2e95e09fc (patch) | |
tree | 30e6d9f0092f36088a28d909285b36b5f545e8fa /spec/controllers/user_controller_spec.rb | |
parent | 5ccba9966f685ab61efa97350177c745f36bf13b (diff) |
Return a 404 for missing user profile pictures. Fixes #363
Diffstat (limited to 'spec/controllers/user_controller_spec.rb')
-rw-r--r-- | spec/controllers/user_controller_spec.rb | 7 |
1 files changed, 7 insertions, 0 deletions
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 |