Commit 27818a77751306c6bea9b4af3daa56a5f3b7a017
1 parent
f2e97688
Exists in
master
and in
29 other branches
invite-member: implemented initial test
Showing
1 changed file
with
11 additions
and
0 deletions
Show diff stats
test/unit/invite_member_test.rb
| @@ -115,5 +115,16 @@ class InviteMemberTest < ActiveSupport::TestCase | @@ -115,5 +115,16 @@ class InviteMemberTest < ActiveSupport::TestCase | ||
| 115 | assert_match(/#{task.requestor.name} invited you to join #{community.name}/, email.subject) | 115 | assert_match(/#{task.requestor.name} invited you to join #{community.name}/, email.subject) |
| 116 | end | 116 | end |
| 117 | 117 | ||
| 118 | + should 'destroy InviteMember task when the community is destroyed' do | ||
| 119 | + p1 = create_user('testuser1').person | ||
| 120 | + p2 = create_user('testuser2').person | ||
| 121 | + community = fast_create(Community) | ||
| 122 | + | ||
| 123 | + task = InviteMember.create!(:person => p1, :friend => p2, :friend_email => 'test@test.com', :community_id => community.id) | ||
| 124 | + community.destroy | ||
| 125 | + | ||
| 126 | + assert_nil task.reload | ||
| 127 | + end | ||
| 128 | + | ||
| 118 | end | 129 | end |
| 119 | 130 |