diff options
author | Sean McGivern <sean@gitlab.com> | 2018-03-30 12:58:20 +0100 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2018-03-30 12:58:20 +0100 |
commit | 6412c4c54a7a824e108899a34b1ecec5cbdcec4b (patch) | |
tree | afe9fa7485520c60d91315d8f73c6f1d64108c8c /spec/features/groups/group_settings_spec.rb | |
parent | ddb23d3b2ba7c646cff6a5d21957194fc3474418 (diff) | |
parent | fa1eabe8e82f7635f2aa51733c727728577c7644 (diff) | |
download | gitlab-ce-6412c4c54a7a824e108899a34b1ecec5cbdcec4b.tar.gz |
Merge branch 'master' into stuartnelson3/gitlab-ce-stn/issue-due-email
Diffstat (limited to 'spec/features/groups/group_settings_spec.rb')
-rw-r--r-- | spec/features/groups/group_settings_spec.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/features/groups/group_settings_spec.rb b/spec/features/groups/group_settings_spec.rb index b83bad3befb..1ce30015e81 100644 --- a/spec/features/groups/group_settings_spec.rb +++ b/spec/features/groups/group_settings_spec.rb @@ -76,6 +76,27 @@ feature 'Edit group settings' do end end end + + describe 'edit group avatar' do + before do + visit edit_group_path(group) + + attach_file(:group_avatar, Rails.root.join('spec', 'fixtures', 'banana_sample.gif')) + + expect { click_button 'Save group' }.to change { group.reload.avatar? }.to(true) + end + + it 'uploads new group avatar' do + expect(group.avatar).to be_instance_of AvatarUploader + expect(group.avatar.url).to eq "/uploads/-/system/group/avatar/#{group.id}/banana_sample.gif" + expect(page).to have_link('Remove avatar') + end + + it 'removes group avatar' do + expect { click_link 'Remove avatar' }.to change { group.reload.avatar? }.to(false) + expect(page).not_to have_link('Remove avatar') + end + end end def update_path(new_group_path) |