summaryrefslogtreecommitdiff
path: root/features
diff options
context:
space:
mode:
authorSteven Thonus <steven@ln2.nl>2014-01-27 22:34:05 +0100
committerSteven Thonus <steven@ln2.nl>2014-01-28 08:38:00 +0100
commit251df827a5308d483a95242970569075ab655703 (patch)
tree00872b5ebaf24ca6c4e964172f59a8380c55d096 /features
parent5221dbfee74e48f379bc06b2848a64243a76270c (diff)
downloadgitlab-ce-251df827a5308d483a95242970569075ab655703.tar.gz
added group avatars
Diffstat (limited to 'features')
-rw-r--r--features/group/group.feature14
-rw-r--r--features/steps/group/group.rb34
2 files changed, 48 insertions, 0 deletions
diff --git a/features/group/group.feature b/features/group/group.feature
index 9fec19a4dc1..ca3e67d2c1d 100644
--- a/features/group/group.feature
+++ b/features/group/group.feature
@@ -31,3 +31,17 @@ Feature: Groups
And I change group name
Then I should see new group name
+ Scenario: I edit my group avatar
+ When I visit group settings page
+ And I change my group avatar
+ And I visit group settings page
+ Then I should see new group avatar
+ And I should see the "Remove avatar" button
+
+ Scenario: I remove my group avatar
+ When I visit group settings page
+ And I have an group avatar
+ And I visit group settings page
+ And I remove my group avatar
+ Then I should not see my group avatar
+ And I should not see the "Remove avatar" button
diff --git a/features/steps/group/group.rb b/features/steps/group/group.rb
index 15d7c46c694..0b0f401c3ba 100644
--- a/features/steps/group/group.rb
+++ b/features/steps/group/group.rb
@@ -98,6 +98,40 @@ class Groups < Spinach::FeatureSteps
end
end
+ step 'I change my group avatar' do
+ attach_file(:group_avatar, File.join(Rails.root, 'public', 'gitlab_logo.png'))
+ click_button "Save group"
+ @group.reload
+ end
+
+ step 'I should see new group avatar' do
+ @group.avatar.should be_instance_of AttachmentUploader
+ @group.avatar.url.should == "/uploads/group/avatar/#{ @group.id }/gitlab_logo.png"
+ end
+
+ step 'I should see the "Remove avatar" button' do
+ page.should have_link("Remove avatar")
+ end
+
+ step 'I have an group avatar' do
+ attach_file(:group_avatar, File.join(Rails.root, 'public', 'gitlab_logo.png'))
+ click_button "Save group"
+ @group.reload
+ end
+
+ step 'I remove my group avatar' do
+ click_link "Remove avatar"
+ @group.reload
+ end
+
+ step 'I should not see my group avatar' do
+ @group.avatar?.should be_false
+ end
+
+ step 'I should not see the "Remove avatar" button' do
+ page.should_not have_link("Remove avatar")
+ end
+
protected
def current_group