diff options
author | Semyon Pupkov <mail@semyonpupkov.com> | 2018-03-17 11:29:05 +0300 |
---|---|---|
committer | Semyon Pupkov <mail@semyonpupkov.com> | 2018-03-29 10:12:47 +0300 |
commit | d6af33b4b2c90a7b4d3b9255df2c633af74e057f (patch) | |
tree | b22934369b21eeeda87abeb0dd95c62d9cd60a80 /spec/features/groups/group_settings_spec.rb | |
parent | 2c792c7572502807508add213be70db1b81685d4 (diff) |
Replace group spinach tests with RSpec analog
https://gitlab.com/gitlab-org/gitlab-ce/issues/23036
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) |