Skip to content
Snippets Groups Projects
Commit a7756a4b authored by Robert Speicher's avatar Robert Speicher
Browse files

Add specs for page_image using a Group's avatar

parent bd21e3d7
No related branches found
No related tags found
1 merge request!2211Add Open Graph data for group, project and commit.
Pipeline #
Loading
@@ -96,6 +96,22 @@ describe PageLayoutHelper do
Loading
@@ -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
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment