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
|
|
|
|
|
|
|
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
|