summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2013-11-06 10:20:33 +0100
committerAzul <azul@leap.se>2013-11-06 10:20:33 +0100
commit44d273fd03645af5e546133adf4e9906800d3d5f (patch)
treea78c5b4f45069cc6b1bd1478b59fe2bf3f0ab34e
parent40f24e2887672957acf7ecedce58e692cc9505ca (diff)
integration test for blocking handles after account destroyed
has not been run yet.
-rw-r--r--users/test/integration/browser/account_test.rb12
-rw-r--r--users/test/support/integration_test_helper.rb6
2 files changed, 15 insertions, 3 deletions
diff --git a/users/test/integration/browser/account_test.rb b/users/test/integration/browser/account_test.rb
index 6e9aab5..b349489 100644
--- a/users/test/integration/browser/account_test.rb
+++ b/users/test/integration/browser/account_test.rb
@@ -6,6 +6,10 @@ class AccountTest < BrowserIntegrationTest
Capybara.current_driver = Capybara.javascript_driver
end
+ teardown do
+ Identity.destroy_all_disabled
+ end
+
test "normal account workflow" do
username, password = submit_signup
assert page.has_content?("Welcome #{username}")
@@ -39,6 +43,14 @@ class AccountTest < BrowserIntegrationTest
assert_invalid_login(page)
end
+ test "handle blocked after account destruction" do
+ username, password = submit_signup
+ click_on I18n.t('account_settings')
+ click_on I18n.t('destroy_my_account')
+ submit_signup(username)
+ assert page.has_content?('has already been taken')
+ end
+
test "change password" do
username, password = submit_signup
click_on "Account Settings"
diff --git a/users/test/support/integration_test_helper.rb b/users/test/support/integration_test_helper.rb
index cfe72cf..51e47c6 100644
--- a/users/test/support/integration_test_helper.rb
+++ b/users/test/support/integration_test_helper.rb
@@ -1,7 +1,7 @@
module IntegrationTestHelper
- def submit_signup
- username = "test_#{SecureRandom.urlsafe_base64}".downcase
- password = SecureRandom.base64
+ def submit_signup(username = nil, password = nil)
+ username ||= "test_#{SecureRandom.urlsafe_base64}".downcase
+ password ||= SecureRandom.base64
visit '/users/new'
fill_in 'Username', with: username
fill_in 'Password', with: password