bf4b438459
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
18 lines
565 B
Ruby
18 lines
565 B
Ruby
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)
|
|
project.team << [user, :developer]
|
|
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
|