debian-mirror-gitlab/spec/views/shared/projects/_project.html.haml_spec.rb

27 lines
771 B
Ruby
Raw Normal View History

2019-12-21 20:55:43 +05:30
# frozen_string_literal: true
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
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