Commit a7756a4b authored by Robert Speicher's avatar Robert Speicher

Add specs for page_image using a Group's avatar

parent bd21e3d7
...@@ -96,6 +96,22 @@ describe PageLayoutHelper do ...@@ -96,6 +96,22 @@ describe PageLayoutHelper do
helper.page_image helper.page_image
end end
end end
context 'with @group' do
it 'uses Group avatar if available' do
group = double(avatar_url: 'http://example.com/uploads/avatar.png')
helper.instance_variable_set(:@group, group)
expect(helper.page_image).to eq group.avatar_url
end
it 'falls back to the default' do
group = double(avatar_url: nil)
helper.instance_variable_set(:@group, group)
expect(helper.page_image).to end_with 'assets/gitlab_logo.png'
end
end
end end
describe 'page_card_attributes' do describe 'page_card_attributes' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment