summaryrefslogtreecommitdiff
path: root/test/support
diff options
context:
space:
mode:
authorankonym <ankonym@gmail.com>2015-08-13 17:24:31 +0200
committerankonym <ankonym@gmail.com>2015-09-28 15:12:45 +0200
commit8b5665b857edc460ef6105c3ba0f106dd99a25d5 (patch)
tree11ce426d18b60965c5128feb13f958f3b2dd0253 /test/support
parent8b9b2a0c3c8457024d99d0794416c59cb245a513 (diff)
Fix test based on actual invite code validation
Diffstat (limited to 'test/support')
-rw-r--r--test/support/browser_integration_test.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/support/browser_integration_test.rb b/test/support/browser_integration_test.rb
index 48c7623..b4bc273 100644
--- a/test/support/browser_integration_test.rb
+++ b/test/support/browser_integration_test.rb
@@ -37,6 +37,7 @@ class BrowserIntegrationTest < ActionDispatch::IntegrationTest
setup do
Capybara.current_driver = Capybara.javascript_driver
page.driver.add_headers 'ACCEPT-LANGUAGE' => 'en-EN'
+ @invite_code = InviteCode.create(invite_code: "testcode")
end
teardown do
@@ -50,7 +51,7 @@ class BrowserIntegrationTest < ActionDispatch::IntegrationTest
visit '/users/new'
fill_in 'Username', with: username
fill_in 'Password', with: password
- fill_in 'Invite code', with: 'testcode'
+ fill_in 'Invite code', with: "testcode"
fill_in 'Password confirmation', with: password
click_on 'Sign Up'
return username, password
@@ -59,6 +60,7 @@ class BrowserIntegrationTest < ActionDispatch::IntegrationTest
# currently this only works for tests with poltergeist.
# ApiIntegrationTest has a working implementation for RackTest
def login(user = nil)
+ InviteCodeValidator.any_instance.stubs(:not_existent?).returns(false)
@user ||= user ||= FactoryGirl.create(:user)
token = Token.create user_id: user.id
page.driver.add_header "Authorization", %Q(Token token="#{token}")