diff options
Diffstat (limited to 'spec/views/shared/projects/_project.html.haml_spec.rb')
-rw-r--r-- | spec/views/shared/projects/_project.html.haml_spec.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/views/shared/projects/_project.html.haml_spec.rb b/spec/views/shared/projects/_project.html.haml_spec.rb new file mode 100644 index 00000000000..43334c2c236 --- /dev/null +++ b/spec/views/shared/projects/_project.html.haml_spec.rb @@ -0,0 +1,19 @@ +require 'spec_helper' + +describe 'shared/projects/_project.html.haml' do + let(:project) { create(:empty_project) } + + 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 |