2017-09-10 17:25:29 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe 'shared/projects/_project.html.haml' do
|
|
|
|
let(:project) { create(:project) }
|
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
before do
|
|
|
|
allow(view).to receive(:current_application_settings).and_return(Gitlab::CurrentSettings.current_application_settings)
|
2018-03-27 19:54:05 +05:30
|
|
|
allow(view).to receive(:can?) { true }
|
2018-03-17 18:26:18 +05:30
|
|
|
end
|
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
it 'should render creator avatar if project has a creator' do
|
|
|
|
render 'shared/projects/project', use_creator_avatar: true, project: project
|
|
|
|
|
|
|
|
expect(rendered).to have_selector('img.avatar')
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'should render a generic avatar if project does not have a creator' do
|
|
|
|
project.creator = nil
|
|
|
|
|
|
|
|
render 'shared/projects/project', use_creator_avatar: true, project: project
|
|
|
|
|
|
|
|
expect(rendered).to have_selector('.project-avatar')
|
|
|
|
end
|
|
|
|
end
|