2019-12-21 20:55:43 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-07-28 23:09:34 +05:30
|
|
|
RSpec.describe 'shared/projects/_project.html.haml' do
|
2020-04-22 19:07:51 +05:30
|
|
|
let_it_be(:project) { create(:project) }
|
2017-09-10 17:25:29 +05:30
|
|
|
|
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
|
|
|
|
|
2019-07-07 11:18:12 +05:30
|
|
|
it 'renders creator avatar if project has a creator' do
|
2017-09-10 17:25:29 +05:30
|
|
|
render 'shared/projects/project', use_creator_avatar: true, project: project
|
|
|
|
|
|
|
|
expect(rendered).to have_selector('img.avatar')
|
|
|
|
end
|
|
|
|
|
2019-07-07 11:18:12 +05:30
|
|
|
it 'renders a generic avatar if project does not have a creator' do
|
2017-09-10 17:25:29 +05:30
|
|
|
project.creator = nil
|
|
|
|
|
|
|
|
render 'shared/projects/project', use_creator_avatar: true, project: project
|
|
|
|
|
|
|
|
expect(rendered).to have_selector('.project-avatar')
|
|
|
|
end
|
|
|
|
end
|