gitlab-org--gitlab-foss/spec/controllers/groups/avatars_controller_spec.rb

19 lines
478 B
Ruby
Raw Normal View History

require 'spec_helper'
describe Groups::AvatarsController do
let(:user) { create(:user) }
2016-03-20 18:09:33 -04:00
let(:group) { create(:group, avatar: fixture_file_upload(Rails.root + "spec/fixtures/dk.png", "image/png")) }
before do
2016-03-20 18:09:33 -04:00
group.add_owner(user)
sign_in(user)
end
it 'removes avatar from DB calling destroy' do
delete :destroy, group_id: group.path
@group = assigns(:group)
expect(@group.avatar.present?).to be_falsey
expect(@group).to be_valid
end
end