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:
authorSteven Thonus <github@popl.nl>2013-10-06 22:13:56 +0400
committerSteven Thonus <github@popl.nl>2013-10-09 11:05:09 +0400
commit65cad57a35002a9fd168863ae8a4d7ca045fb938 (patch)
tree61227cc71fea23b8f75852cd92452e4f2fd47179 /features
parent358426d66164d720d793ea37bacb4fc331c30171 (diff)
avatar upload on profile page
Diffstat (limited to 'features')
-rw-r--r--features/profile/profile.feature5
-rw-r--r--features/steps/profile/profile.rb11
2 files changed, 16 insertions, 0 deletions
diff --git a/features/profile/profile.feature b/features/profile/profile.feature
index c74b0993fb3..6d210fb4df7 100644
--- a/features/profile/profile.feature
+++ b/features/profile/profile.feature
@@ -22,6 +22,11 @@ Feature: Profile
Then I change my password
And I should be redirected to sign in page
+ Scenario: I edit my avatar
+ Given I visit profile page
+ Then I change my avatar
+ And I should see new avatar
+
Scenario: My password is expired
Given my password is expired
And I am not an ldap user
diff --git a/features/steps/profile/profile.rb b/features/steps/profile/profile.rb
index 5b2a6321265..585aa9f119d 100644
--- a/features/steps/profile/profile.rb
+++ b/features/steps/profile/profile.rb
@@ -22,6 +22,17 @@ class Profile < Spinach::FeatureSteps
@user.twitter.should == 'testtwitter'
end
+ step 'I change my avatar' do
+ attach_file(:user_avatar, File.join(Rails.root, 'public', 'gitlab_logo.png'))
+ click_button "Save changes"
+ @user.reload
+ end
+
+ step 'I should see new avatar' do
+ @user.avatar.should be_instance_of AttachmentUploader
+ @user.avatar.url.should == "/uploads/user/avatar/#{ @user.id }/gitlab_logo.png"
+ end
+
step 'I try change my password w/o old one' do
within '.update-password' do
fill_in "user_password", with: "222333"