summaryrefslogtreecommitdiff
path: root/test/support/api_integration_test.rb
diff options
context:
space:
mode:
authorankonym <ankonym@gmail.com>2015-09-02 17:01:16 +0200
committerankonym <ankonym@gmail.com>2015-09-28 15:12:45 +0200
commit2f7d085c5747a1a68afc0d854fa087ffbb46f8e7 (patch)
tree770ca0a89192623372eb1cf24ae885a786fc4bfe /test/support/api_integration_test.rb
parentb3762da8d8a06e164524a20d26293a8d5a9770d8 (diff)
Fix the remaining failures/errors in our tests
Handing freshly generated invite codes to Factory Girl to make the tests pass
Diffstat (limited to 'test/support/api_integration_test.rb')
-rw-r--r--test/support/api_integration_test.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/support/api_integration_test.rb b/test/support/api_integration_test.rb
index bd10f11..4077920 100644
--- a/test/support/api_integration_test.rb
+++ b/test/support/api_integration_test.rb
@@ -3,8 +3,13 @@ class ApiIntegrationTest < ActionDispatch::IntegrationTest
DUMMY_TOKEN = Token.new
RACK_ENV = {'HTTP_AUTHORIZATION' => %Q(Token token="#{DUMMY_TOKEN.to_s}")}
+ setup do
+ @testcode = InviteCode.new
+ @testcode.save!
+ end
+
def login(user = nil)
- @user ||= user ||= FactoryGirl.create(:user)
+ @user ||= user ||= FactoryGirl.create(:user, :invite_code => @testcode.invite_code)
# DUMMY_TOKEN will be frozen. So let's use a dup
@token ||= DUMMY_TOKEN.dup
# make sure @token is up to date if it already exists