diff options
author | Robert Speicher <rspeicher@gmail.com> | 2015-12-28 03:49:48 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2015-12-28 03:49:48 +0300 |
commit | a7756a4b51b0127caa19d1fb20953cb27c4c62a8 (patch) | |
tree | 36525463296c78ff796cae312c46aecc960db838 /spec/helpers/page_layout_helper_spec.rb | |
parent | bd21e3d7319dce4600881f7f8677b28f3f55cc5e (diff) |
Add specs for page_image using a Group's avatar
Diffstat (limited to 'spec/helpers/page_layout_helper_spec.rb')
-rw-r--r-- | spec/helpers/page_layout_helper_spec.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/helpers/page_layout_helper_spec.rb b/spec/helpers/page_layout_helper_spec.rb index fd7107779f6..60c4eb21814 100644 --- a/spec/helpers/page_layout_helper_spec.rb +++ b/spec/helpers/page_layout_helper_spec.rb @@ -96,6 +96,22 @@ describe PageLayoutHelper do helper.page_image 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 describe 'page_card_attributes' do |