debian-mirror-gitlab/spec/views/shared/projects/_project.html.haml_spec.rb
2019-05-18 00:54:41 +05:30

24 lines
740 B
Ruby

require 'spec_helper'
describe 'shared/projects/_project.html.haml' do
let(:project) { create(:project) }
before do
allow(view).to receive(:current_application_settings).and_return(Gitlab::CurrentSettings.current_application_settings)
allow(view).to receive(:can?) { true }
end
it 'renders 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 'renders 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