summaryrefslogtreecommitdiff
path: root/test/integration/browser
diff options
context:
space:
mode:
authorAzul <azul@riseup.net>2017-04-03 10:43:42 +0200
committerAzul <azul@riseup.net>2017-04-03 10:43:42 +0200
commite9bdd2aa5a0662a9fc6d5ce730e26cfd560210ba (patch)
tree70405839cd6bbf3331c94412b4178b6399dfafa3 /test/integration/browser
parent552483c9e3f73952839e934374e2aa8b07681f4d (diff)
feature: delete user clearing username
Diffstat (limited to 'test/integration/browser')
-rw-r--r--test/integration/browser/account_livecycle_test.rb20
1 files changed, 16 insertions, 4 deletions
diff --git a/test/integration/browser/account_livecycle_test.rb b/test/integration/browser/account_livecycle_test.rb
index 835dfdc..3d23363 100644
--- a/test/integration/browser/account_livecycle_test.rb
+++ b/test/integration/browser/account_livecycle_test.rb
@@ -8,7 +8,7 @@ class AccountLivecycleTest < BrowserIntegrationTest
test "signup successfully when invited" do
username, password = submit_signup
- assert page.has_content?("Welcome #{username}")
+ assert_successful_login username
click_on 'Log Out'
assert page.has_content?("Log In")
assert_equal '/', current_path
@@ -28,14 +28,14 @@ class AccountLivecycleTest < BrowserIntegrationTest
fill_in 'Password confirmation', with: password
click_on 'Sign Up'
- assert page.has_content?("Welcome #{username}")
+ assert_successful_login username
end
end
test "signup with username ending in dot json" do
username = Faker::Internet.user_name + '.json'
submit_signup username
- assert page.has_content?("Welcome #{username}")
+ assert_successful_login username
end
test "signup with reserved username" do
@@ -48,7 +48,7 @@ class AccountLivecycleTest < BrowserIntegrationTest
username, password = submit_signup
click_on 'Log Out'
attempt_login(username, password)
- assert page.has_content?("Welcome #{username}")
+ assert_successful_login username
within('.sidenav li.active') do
assert page.has_content?("Overview")
end
@@ -80,6 +80,15 @@ class AccountLivecycleTest < BrowserIntegrationTest
assert page.has_content?('has already been taken')
end
+ test "handle available after non blocking account destruction" do
+ username, password = submit_signup
+ click_on I18n.t('account_settings')
+ uncheck I18n.t('keep_username_blocked')
+ click_on I18n.t('destroy_my_account')
+ submit_signup(username)
+ assert_successful_login username
+ end
+
test "change pgp key" do
with_config user_actions: ['change_pgp_key'] do
pgp_key = FactoryGirl.build :pgp_key
@@ -111,4 +120,7 @@ class AccountLivecycleTest < BrowserIntegrationTest
assert page.has_no_selector? '.btn-primary.disabled'
end
+ def assert_successful_login(username)
+ assert page.has_content?("Welcome #{username}")
+ end
end