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

19 lines
562 B
Ruby
Raw Normal View History

require 'spec_helper'
describe Projects::AvatarsController do
let(:project) { create(:project, avatar: fixture_file_upload(Rails.root + "spec/fixtures/dk.png", "image/png")) }
let(:user) { create(:user) }
before do
sign_in(user)
2016-03-21 04:09:59 -04:00
project.team << [user, :master]
controller.instance_variable_set(:@project, project)
end
it 'destroy should remove avatar from DB' do
delete :destroy, namespace_id: project.namespace.id, project_id: project.id
expect(project.avatar.present?).to be_falsey
expect(project).to be_valid
end
end