2017-07-28 11:23:40 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe 'shared/projects/_project.html.haml' do
|
2017-08-02 15:55:11 -04:00
|
|
|
let(:project) { create(:project) }
|
2017-07-28 11:23:40 -04:00
|
|
|
|
2017-08-31 05:47:03 -04:00
|
|
|
before do
|
|
|
|
allow(view).to receive(:current_application_settings).and_return(Gitlab::CurrentSettings.current_application_settings)
|
2017-12-11 09:21:06 -05:00
|
|
|
allow(view).to receive(:can?) { true }
|
2017-08-31 05:47:03 -04:00
|
|
|
end
|
|
|
|
|
2019-04-05 04:43:27 -04:00
|
|
|
it 'renders creator avatar if project has a creator' do
|
2017-07-28 11:23:40 -04:00
|
|
|
render 'shared/projects/project', use_creator_avatar: true, project: project
|
|
|
|
|
|
|
|
expect(rendered).to have_selector('img.avatar')
|
|
|
|
end
|
|
|
|
|
2019-04-05 04:43:27 -04:00
|
|
|
it 'renders a generic avatar if project does not have a creator' do
|
2017-07-28 11:23:40 -04:00
|
|
|
project.creator = nil
|
|
|
|
|
|
|
|
render 'shared/projects/project', use_creator_avatar: true, project: project
|
|
|
|
|
|
|
|
expect(rendered).to have_selector('.project-avatar')
|
|
|
|
end
|
|
|
|
end
|