summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAzul <azul@riseup.net>2016-05-23 12:53:23 +0200
committerAzul <azul@riseup.net>2016-05-23 13:01:52 +0200
commit30da8e6ffa1eefafb9762645efb85e0beed236c6 (patch)
tree74b53a8762710a76c4ca5d270b6ef9545dfca221 /test
parentad208ae3625e67c2551744df7906ebdda94d215e (diff)
fix config check in submit_signup
with_config is not mean to test the current config. It will set the config. So instead we need to look into APP_CONFIG.
Diffstat (limited to 'test')
-rw-r--r--test/support/browser_integration_test.rb33
1 files changed, 9 insertions, 24 deletions
diff --git a/test/support/browser_integration_test.rb b/test/support/browser_integration_test.rb
index 70161f9..1f5e3d2 100644
--- a/test/support/browser_integration_test.rb
+++ b/test/support/browser_integration_test.rb
@@ -47,32 +47,17 @@ class BrowserIntegrationTest < ActionDispatch::IntegrationTest
end
def submit_signup(username = nil, password = nil)
-
- with_config invite_required: true do
-
- username ||= "test_#{SecureRandom.urlsafe_base64}".downcase
- password ||= SecureRandom.base64
- visit '/signup'
- fill_in 'Username', with: username
- fill_in 'Password', with: password
+ username ||= "test_#{SecureRandom.urlsafe_base64}".downcase
+ password ||= SecureRandom.base64
+ visit '/signup'
+ fill_in 'Username', with: username
+ fill_in 'Password', with: password
+ if APP_CONFIG[:invite_required]
fill_in 'Invite code', with: @testcode.invite_code
- fill_in 'Password confirmation', with: password
- click_on 'Sign Up'
- return username, password
- end
-
- with_config invite_required: false do
-
- username ||= "test_#{SecureRandom.urlsafe_base64}".downcase
- password ||= SecureRandom.base64
- visit '/signup'
- fill_in 'Username', with: username
- fill_in 'Password', with: password
- fill_in 'Password confirmation', with: password
- click_on 'Sign Up'
- return username, password
end
-
+ fill_in 'Password confirmation', with: password
+ click_on 'Sign Up'
+ return username, password
end
# currently this only works for tests with poltergeist.