2015-05-06 17:33:39 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe Projects::AvatarsController do
|
2017-01-25 16:44:33 -05:00
|
|
|
let(:project) { create(:empty_project, avatar: fixture_file_upload(Rails.root + "spec/fixtures/dk.png", "image/png")) }
|
2015-05-06 17:33:39 -04:00
|
|
|
let(:user) { create(:user) }
|
|
|
|
|
|
|
|
before do
|
|
|
|
sign_in(user)
|
2016-03-21 04:09:59 -04:00
|
|
|
project.team << [user, :master]
|
2015-05-06 17:33:39 -04:00
|
|
|
controller.instance_variable_set(:@project, project)
|
|
|
|
end
|
|
|
|
|
2016-07-25 14:16:19 -04:00
|
|
|
it 'removes avatar from DB by calling destroy' do
|
2015-05-06 17:33:39 -04:00
|
|
|
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
|