debian-mirror-gitlab/spec/controllers/projects/avatars_controller_spec.rb

19 lines
567 B
Ruby
Raw Normal View History

2015-09-11 14:41:01 +05:30
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-06-02 11:05:42 +05:30
project.team << [user, :master]
2015-09-11 14:41:01 +05:30
controller.instance_variable_set(:@project, project)
end
2016-09-13 17:45:13 +05:30
it 'removes avatar from DB by calling destroy' do
2015-09-11 14:41:01 +05:30
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