diff options
author | azul <azul@leap.se> | 2015-09-30 10:51:21 +0200 |
---|---|---|
committer | azul <azul@leap.se> | 2015-09-30 10:51:21 +0200 |
commit | d45f6c61f6a13be06f1977b857e0cb31e79c5317 (patch) | |
tree | d3089b334c2663ea2fd76cf62dea853bdd57b047 /test/integration/browser/account_test.rb | |
parent | a894966e425f27c31e7da196658c6ddee3fc3714 (diff) | |
parent | d4f10a8d47572bcab4c44878b952146732d64d2e (diff) |
Merge pull request #194 from Alster-Hamburgers/feature/invite_code
Request for feedback on invite code feature
Diffstat (limited to 'test/integration/browser/account_test.rb')
-rw-r--r-- | test/integration/browser/account_test.rb | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/test/integration/browser/account_test.rb b/test/integration/browser/account_test.rb index aea5406..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 @@ -47,6 +63,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')) @@ -81,21 +98,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 @@ -117,6 +119,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 |