summaryrefslogtreecommitdiff
path: root/test/integration/browser
diff options
context:
space:
mode:
authorankonym <ankonym@gmail.com>2015-09-21 18:34:04 +0200
committerankonym <ankonym@gmail.com>2015-09-28 15:12:46 +0200
commit9adbde13619de8b2c300056b062d12f0961cb710 (patch)
treef9161d0a39b497cca05887a0e4fc48acde5aa650 /test/integration/browser
parentca591b482870c93674aaf454e90f56796da7d87d (diff)
Make invite code configurable
Through the config param 'invite_required', providers can decide whether users need to provide an invite code upon signup. The default setting is false.
Diffstat (limited to 'test/integration/browser')
-rw-r--r--test/integration/browser/account_test.rb18
1 files changed, 17 insertions, 1 deletions
diff --git a/test/integration/browser/account_test.rb b/test/integration/browser/account_test.rb
index 6ab9eb2..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