Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrew Blessing <drew.blessing@buckle.com>2013-12-02 22:03:07 +0400
committerDrew Blessing <drew.blessing@buckle.com>2013-12-03 02:20:34 +0400
commitb08608b261f8c9c552d8957b6231c7725b9529ac (patch)
tree566e2ba56ae1ed23305ea5e897f859e8e782a29b /features
parente411f3bab2c20ba22b838bb025fa33e980470d20 (diff)
Issue 5716 - Allow removal of avatar
Add class and style Add spinach tests Add entry to CHANGELOG Add entry to CHANGELOG
Diffstat (limited to 'features')
-rw-r--r--features/profile/profile.feature8
-rw-r--r--features/steps/profile/profile.rb23
2 files changed, 31 insertions, 0 deletions
diff --git a/features/profile/profile.feature b/features/profile/profile.feature
index 6198fd2b306..6b0421a20b3 100644
--- a/features/profile/profile.feature
+++ b/features/profile/profile.feature
@@ -26,6 +26,14 @@ Feature: Profile
Given I visit profile page
Then I change my avatar
And I should see new avatar
+ And I should see the "Remove avatar" button
+
+ Scenario: I remove my avatar
+ Given I visit profile page
+ And I have an avatar
+ When I remove my avatar
+ Then I should see my gravatar
+ And I should not see the "Remove avatar" button
Scenario: My password is expired
Given my password is expired
diff --git a/features/steps/profile/profile.rb b/features/steps/profile/profile.rb
index 9d091e93aa2..3e4a105ec55 100644
--- a/features/steps/profile/profile.rb
+++ b/features/steps/profile/profile.rb
@@ -31,6 +31,29 @@ class Profile < Spinach::FeatureSteps
@user.avatar.url.should == "/uploads/user/avatar/#{ @user.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 avatar' do
+ attach_file(:user_avatar, File.join(Rails.root, 'public', 'gitlab_logo.png'))
+ click_button "Save changes"
+ @user.reload
+ end
+
+ step 'I remove my avatar' do
+ click_link "Remove avatar"
+ @user.reload
+ end
+
+ step 'I should see my gravatar' do
+ @user.avatar?.should be_false
+ end
+
+ step 'I should not see the "Remove avatar" button' do
+ page.should_not have_link("Remove avatar")
+ end
+
step 'I try change my password w/o old one' do
within '.update-password' do
fill_in "user_password", with: "22233344"