diff options
author | ankonym <ankonym@gmail.com> | 2015-08-21 17:49:36 +0200 |
---|---|---|
committer | ankonym <ankonym@gmail.com> | 2015-09-28 15:12:45 +0200 |
commit | 0543217b433a8f4809f08018c1a11c20119fa85d (patch) | |
tree | 2479c25010afcd5b9b8929979d8b0efb39f4087f /test/unit | |
parent | 35494972411d4649ed8e81e24b6ec3f8734f5529 (diff) |
assign random invite code when creating new invite codes
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/invite_code_test.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/unit/invite_code_test.rb b/test/unit/invite_code_test.rb new file mode 100644 index 0000000..2684f8e --- /dev/null +++ b/test/unit/invite_code_test.rb @@ -0,0 +1,21 @@ +require 'test_helper' + +class InviteCodeTest < ActiveSupport::TestCase + + test "it is created with an invite code" do + code = InviteCode.new + assert_not_nil code.invite_code + end + + test "the invite code can be read from couch db correctly" do + code1 = InviteCode.new + code1.save + + code2 = InviteCode.find_by__id code1.id + + assert_equal code1.invite_code, code2.invite_code + + end + + +end
\ No newline at end of file |