summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2016-02-29 17:35:14 +0000
committerPhil Hughes <me@iamphill.com>2016-03-01 13:17:02 +0000
commit5b1931996f61bebff379e4fa597099bdd1e08ca5 (patch)
tree0ed4878a4ec24b4d502a0fa1e199b09f140c68f1
parentcaa3dc4e4145368fedf9fe159da4a9080a28d1fe (diff)
downloadgitlab-ce-5b1931996f61bebff379e4fa597099bdd1e08ca5.tar.gz
Updated tests
-rw-r--r--app/views/doorkeeper/applications/_form.html.haml2
-rw-r--r--app/views/profiles/accounts/show.html.haml2
-rw-r--r--app/views/profiles/passwords/edit.html.haml2
-rw-r--r--features/profile/profile.feature3
-rw-r--r--features/steps/profile/profile.rb20
5 files changed, 12 insertions, 17 deletions
diff --git a/app/views/doorkeeper/applications/_form.html.haml b/app/views/doorkeeper/applications/_form.html.haml
index 0df8362d4ad..906b0676150 100644
--- a/app/views/doorkeeper/applications/_form.html.haml
+++ b/app/views/doorkeeper/applications/_form.html.haml
@@ -22,4 +22,4 @@
for local tests
.prepend-top-default
- = f.submit 'Add application', class: "btn btn-create"
+ = f.submit 'Save application', class: "btn btn-create"
diff --git a/app/views/profiles/accounts/show.html.haml b/app/views/profiles/accounts/show.html.haml
index be3ae942e7f..a412757250d 100644
--- a/app/views/profiles/accounts/show.html.haml
+++ b/app/views/profiles/accounts/show.html.haml
@@ -12,7 +12,7 @@
%p
Your private token is used to access application resources without authentication.
.col-lg-9
- = form_for @user, url: reset_private_token_profile_path, method: :put do |f|
+ = form_for @user, url: reset_private_token_profile_path, method: :put, html: {class: "update-token"} do |f|
%p.cgray
- if current_user.private_token
= label_tag "token", "Private token", class: "label-light"
diff --git a/app/views/profiles/passwords/edit.html.haml b/app/views/profiles/passwords/edit.html.haml
index 76d3f433e4b..89aad5202fe 100644
--- a/app/views/profiles/passwords/edit.html.haml
+++ b/app/views/profiles/passwords/edit.html.haml
@@ -12,7 +12,7 @@
Change your password
- unless @user.password_automatically_set?
or recover your current one
- = form_for @user, url: profile_password_path, method: :put do |f|
+ = form_for @user, url: profile_password_path, method: :put, html: {class: "update-password"} do |f|
-if @user.errors.any?
.alert.alert-danger
%ul
diff --git a/features/profile/profile.feature b/features/profile/profile.feature
index 168d9d30b50..447dd92a458 100644
--- a/features/profile/profile.feature
+++ b/features/profile/profile.feature
@@ -76,8 +76,7 @@ Feature: Profile
Scenario: I can manage application
Given I visit profile applications page
- Then I click on new application button
- And I should see application form
+ Then I should see application form
Then I fill application form out and submit
And I see application
Then I click edit
diff --git a/features/steps/profile/profile.rb b/features/steps/profile/profile.rb
index 7895f643d0c..b7d0a17b98e 100644
--- a/features/steps/profile/profile.rb
+++ b/features/steps/profile/profile.rb
@@ -13,7 +13,7 @@ class Spinach::Features::Profile < Spinach::FeatureSteps
fill_in 'user_website_url', with: 'testurl'
fill_in 'user_location', with: 'Ukraine'
fill_in 'user_bio', with: 'I <3 GitLab'
- click_button 'Save changes'
+ click_button 'Update profile settings'
@user.reload
end
@@ -64,7 +64,7 @@ class Spinach::Features::Profile < Spinach::FeatureSteps
page.within '.update-password' do
fill_in "user_password", with: "22233344"
fill_in "user_password_confirmation", with: "22233344"
- click_button "Save"
+ click_button "Save password"
end
end
@@ -73,7 +73,7 @@ class Spinach::Features::Profile < Spinach::FeatureSteps
fill_in "user_current_password", with: "12345678"
fill_in "user_password", with: "22233344"
fill_in "user_password_confirmation", with: "22233344"
- click_button "Save"
+ click_button "Save password"
end
end
@@ -82,7 +82,7 @@ class Spinach::Features::Profile < Spinach::FeatureSteps
fill_in "user_current_password", with: "12345678"
fill_in "user_password", with: "password"
fill_in "user_password_confirmation", with: "confirmation"
- click_button "Save"
+ click_button "Save password"
end
end
@@ -180,18 +180,14 @@ class Spinach::Features::Profile < Spinach::FeatureSteps
end
end
- step 'I click on new application button' do
- click_on 'New Application'
- end
-
step 'I should see application form' do
- expect(page).to have_content "New Application"
+ expect(page).to have_content "Add new application"
end
step 'I fill application form out and submit' do
fill_in :doorkeeper_application_name, with: 'test'
fill_in :doorkeeper_application_redirect_uri, with: 'https://test.com'
- click_on "Submit"
+ click_on "Save application"
end
step 'I see application' do
@@ -211,7 +207,7 @@ class Spinach::Features::Profile < Spinach::FeatureSteps
step 'I change name of application and submit' do
expect(page).to have_content "Edit application"
fill_in :doorkeeper_application_name, with: 'test_changed'
- click_on "Submit"
+ click_on "Save application"
end
step 'I see that application was changed' do
@@ -237,7 +233,7 @@ class Spinach::Features::Profile < Spinach::FeatureSteps
page.find('#user_avatar_crop_y', visible: false).set('0')
page.find('#user_avatar_crop_size', visible: false).set('256')
- click_button "Save changes"
+ click_button "Update profile settings"
@user.reload
end