diff options
author | Hannes Rosenögger <123haynes@gmail.com> | 2015-05-12 14:46:58 +0000 |
---|---|---|
committer | Hannes Rosenögger <123haynes@gmail.com> | 2015-05-12 14:46:58 +0000 |
commit | 1dd0caf4d95c6d09fe54041fd7aff9f8661bfbef (patch) | |
tree | 9af0408d3129cc4bf59abff98bdd1af069afa892 /spec/controllers/profiles | |
parent | 8b9e3af8bf7a6089a11ef3f5eb91dfef4940a3f4 (diff) | |
parent | bf4b4384590c271d1dfadf874d185c2f6130ad0e (diff) | |
download | gitlab-ce-1dd0caf4d95c6d09fe54041fd7aff9f8661bfbef.tar.gz |
Merge branch 'fix-avatar-removal' into 'master'
Fix bug where avatar filenames were not actually deleted from the database during removal
This would result in a 404 error in certain views.
The `save` call was being rolled back due to an error in the validation step.
Relax the validation step so that this works.
Closes #1570
See merge request !620
Diffstat (limited to 'spec/controllers/profiles')
-rw-r--r-- | spec/controllers/profiles/avatars_controller_spec.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/controllers/profiles/avatars_controller_spec.rb b/spec/controllers/profiles/avatars_controller_spec.rb new file mode 100644 index 00000000000..ad5855df0a4 --- /dev/null +++ b/spec/controllers/profiles/avatars_controller_spec.rb @@ -0,0 +1,17 @@ +require 'spec_helper' + +describe Profiles::AvatarsController do + let(:user) { create(:user, avatar: fixture_file_upload(Rails.root + "spec/fixtures/dk.png")) } + + before do + sign_in(user) + controller.instance_variable_set(:@user, user) + end + + it 'destroy should remove avatar from DB' do + delete :destroy + @user = assigns(:user) + expect(@user.avatar.present?).to be_falsey + expect(@user).to be_valid + end +end |