From 2f7d085c5747a1a68afc0d854fa087ffbb46f8e7 Mon Sep 17 00:00:00 2001 From: ankonym Date: Wed, 2 Sep 2015 17:01:16 +0200 Subject: Fix the remaining failures/errors in our tests Handing freshly generated invite codes to Factory Girl to make the tests pass --- test/integration/api/srp_test.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'test/integration/api/srp_test.rb') diff --git a/test/integration/api/srp_test.rb b/test/integration/api/srp_test.rb index ea06cde..463abcd 100644 --- a/test/integration/api/srp_test.rb +++ b/test/integration/api/srp_test.rb @@ -1,5 +1,10 @@ class SrpTest < RackTest + setup do + @testcode = InviteCode.new + @testcode.save! + end + teardown do if @user cleanup_user @@ -32,7 +37,7 @@ class SrpTest < RackTest attr_reader :server_auth - def register_user(login = "integration_test", password = 'srp, verify me!', invite_code = "testcode") + def register_user(login = "integration_test", password = 'srp, verify me!', invite_code = @testcode.invite_code) cleanup_user(login) post 'http://api.lvh.me:3000/1/users.json', user_params(login: login, password: password, invite_code: invite_code) -- cgit v1.2.3