From 35494972411d4649ed8e81e24b6ec3f8734f5529 Mon Sep 17 00:00:00 2001 From: ankonym Date: Wed, 19 Aug 2015 13:58:02 +0200 Subject: Remove change password browser test Remove the change password test because the change password functionality is currently unused - however, it breaks with the new invite code field in the signup form. --- test/integration/browser/account_test.rb | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'test/integration/browser') diff --git a/test/integration/browser/account_test.rb b/test/integration/browser/account_test.rb index aea5406..34eb72e 100644 --- a/test/integration/browser/account_test.rb +++ b/test/integration/browser/account_test.rb @@ -81,21 +81,6 @@ class AccountTest < BrowserIntegrationTest end end - test "change password" do - with_config user_actions: ['change_password'] do - login - click_on "Account Settings" - within('#update_login_and_password') do - fill_in 'Password', with: "other password" - fill_in 'Password confirmation', with: "other password" - click_on 'Save' - end - click_on 'Log Out' - attempt_login(@user.login, "other password") - assert page.has_content?("Welcome #{@user.login}") - end - end - test "change pgp key" do with_config user_actions: ['change_pgp_key'] do pgp_key = FactoryGirl.build :pgp_key -- cgit v1.2.3 From c48e921c101d49bf68fa1af489b8012517b1a105 Mon Sep 17 00:00:00 2001 From: ankonym Date: Tue, 1 Sep 2015 10:48:25 +0200 Subject: Fix several test failures by stubbing invite code validation --- test/integration/browser/account_test.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'test/integration/browser') diff --git a/test/integration/browser/account_test.rb b/test/integration/browser/account_test.rb index 34eb72e..6ab9eb2 100644 --- a/test/integration/browser/account_test.rb +++ b/test/integration/browser/account_test.rb @@ -47,6 +47,7 @@ class AccountTest < BrowserIntegrationTest test "account destruction" do username, password = submit_signup + click_on I18n.t('account_settings') click_on I18n.t('destroy_my_account') assert page.has_content?(I18n.t('account_destroyed')) @@ -102,6 +103,8 @@ class AccountTest < BrowserIntegrationTest # trying to seed an invalid A for srp login test "detects attempt to circumvent SRP" do + InviteCodeValidator.any_instance.stubs(:validate) + user = FactoryGirl.create :user visit '/login' fill_in 'Username', with: user.login -- cgit v1.2.3 From 9adbde13619de8b2c300056b062d12f0961cb710 Mon Sep 17 00:00:00 2001 From: ankonym Date: Mon, 21 Sep 2015 18:34:04 +0200 Subject: Make invite code configurable Through the config param 'invite_required', providers can decide whether users need to provide an invite code upon signup. The default setting is false. --- test/integration/browser/account_test.rb | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'test/integration/browser') diff --git a/test/integration/browser/account_test.rb b/test/integration/browser/account_test.rb index 6ab9eb2..cbe7ba9 100644 --- a/test/integration/browser/account_test.rb +++ b/test/integration/browser/account_test.rb @@ -6,7 +6,7 @@ class AccountTest < BrowserIntegrationTest Identity.destroy_all_disabled end - test "signup successfully" do + test "signup successfully when invited" do username, password = submit_signup assert page.has_content?("Welcome #{username}") click_on 'Log Out' @@ -16,6 +16,22 @@ class AccountTest < BrowserIntegrationTest user.account.destroy end + test "signup successfully without invitation" do + with_config invite_required: false do + + username ||= "test_#{SecureRandom.urlsafe_base64}".downcase + password ||= SecureRandom.base64 + + visit '/users/new' + fill_in 'Username', with: username + fill_in 'Password', with: password + fill_in 'Password confirmation', with: password + click_on 'Sign Up' + + assert page.has_content?("Welcome #{username}") + end + end + test "signup with username ending in dot json" do username = Faker::Internet.user_name + '.json' submit_signup username -- cgit v1.2.3