diff options
author | Azul <azul@leap.se> | 2013-09-23 19:55:22 +0200 |
---|---|---|
committer | Azul <azul@leap.se> | 2013-09-24 10:48:32 +0200 |
commit | 193bf6446b384dce1699e8fb82be6f16cb8cb5f6 (patch) | |
tree | fb4ed9b5a383a04c491ea0d1a54a413117028f24 /users/test/integration | |
parent | 98db0cc42019dfcd90d58e0126fe691590fde2e2 (diff) |
use token auth when accessing the api from webapp
One failing integration test still needs to be fixed
Diffstat (limited to 'users/test/integration')
-rw-r--r-- | users/test/integration/browser/account_test.rb | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/users/test/integration/browser/account_test.rb b/users/test/integration/browser/account_test.rb index 8c2c997..3434557 100644 --- a/users/test/integration/browser/account_test.rb +++ b/users/test/integration/browser/account_test.rb @@ -24,8 +24,41 @@ class AccountTest < BrowserIntegrationTest fill_in 'Password', with: password click_on 'Log In' assert page.has_content?("Welcome #{username}") + User.find_by_login(username).account.destroy end + test "change password" do + username, password = submit_signup + 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 'Logout' + click_on 'Log In' + fill_in 'Username', with: username + fill_in 'Password', with: "other password" + click_on 'Log In' + assert page.has_content?("Welcome #{username}") + User.find_by_login(username).account.destroy + end + + test "change pgp key" do + pgp_key = "My PGP Key Stub" + username, password = submit_signup + click_on "Account Settings" + within('#update_pgp_key') do + fill_in 'Public key', with: pgp_key + click_on 'Save' + end + debugger + assert user = User.find_by_login(username) + assert_equal pgp_key, user.public_key + user.account.destroy + end + + # trying to seed an invalid A for srp login test "detects attempt to circumvent SRP" do user = FactoryGirl.create :user |