summaryrefslogtreecommitdiff
path: root/test/integration
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2014-05-28 10:45:14 +0200
committerAzul <azul@leap.se>2014-05-28 10:55:42 +0200
commit154d32bbc7cfe21d83141ff2c9a3d805165231b8 (patch)
treeedbb82449a9a50c0b5141e435939150bef7dee57 /test/integration
parent1d0d61389011a8d0d169bc139590d90a6fbbac60 (diff)
use Identity for testing login availability
We create an identity alongside each user. Make sure the identity is valid when creating the user. This also ensures that the login picked is available because otherwise the identities address would not be available anymore.
Diffstat (limited to 'test/integration')
-rw-r--r--test/integration/browser/account_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/integration/browser/account_test.rb b/test/integration/browser/account_test.rb
index 491a9e1..82bb043 100644
--- a/test/integration/browser/account_test.rb
+++ b/test/integration/browser/account_test.rb
@@ -22,6 +22,12 @@ class AccountTest < BrowserIntegrationTest
assert page.has_content?("Welcome #{username}")
end
+ test "signup with reserved username" do
+ username = 'certmaster'
+ submit_signup username
+ assert page.has_content?("is reserved.")
+ end
+
test "successful login" do
username, password = submit_signup
click_on 'Logout'
@@ -44,6 +50,7 @@ class AccountTest < BrowserIntegrationTest
click_on I18n.t('account_settings')
click_on I18n.t('destroy_my_account')
assert page.has_content?(I18n.t('account_destroyed'))
+ assert_equal 1, Identity.by_address.key("#{username}@test.me").count
attempt_login(username, password)
assert_invalid_login(page)
end