summaryrefslogtreecommitdiff
path: root/test/unit/invite_code_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit/invite_code_test.rb')
-rw-r--r--test/unit/invite_code_test.rb57
1 files changed, 0 insertions, 57 deletions
diff --git a/test/unit/invite_code_test.rb b/test/unit/invite_code_test.rb
index adaf397..fd93f2f 100644
--- a/test/unit/invite_code_test.rb
+++ b/test/unit/invite_code_test.rb
@@ -20,63 +20,6 @@ class InviteCodeTest < ActiveSupport::TestCase
assert_equal code1.invite_count, 0
end
- test "Invite count >= invite max uses is not accepted for new account signup" do
- validator = InviteCodeValidator.new nil
-
- user_code = InviteCode.new
- user_code.invite_count = 1
- user_code.invite_max_uses = 1
- user_code.save
-
- user = FactoryGirl.build :user
- user.invite_code = user_code.invite_code
-
- validator.validate(user)
-
- assert_equal ["This code has already been used"], user.errors[:invite_code]
-
- end
-
- test "Invite count < invite max uses is accepted for new account signup" do
- validator = InviteCodeValidator.new nil
-
- user_code = InviteCode.create
- user_code.invite_count = 0
- user_code.invite_max_uses = 1
- user_code.save
-
- user = FactoryGirl.build :user
- user.invite_code = user_code.invite_code
-
- validator.validate(user)
-
- assert_equal [], user.errors[:invite_code]
- end
-
- test "Invite count 0 is accepted for new account signup" do
- validator = InviteCodeValidator.new nil
-
- user_code = InviteCode.create
-
- user = FactoryGirl.build :user
- user.invite_code = user_code.invite_code
-
- validator.validate(user)
-
- assert_equal [], user.errors[:invite_code]
- end
-
- test "There is an error message if the invite code does not exist" do
- validator = InviteCodeValidator.new nil
-
- user = FactoryGirl.build :user
- user.invite_code = "wrongcode"
-
- validator.validate(user)
-
- assert_equal ["This is not a valid code"], user.errors[:invite_code]
-
- end
end