From 27818a77751306c6bea9b4af3daa56a5f3b7a017 Mon Sep 17 00:00:00 2001 From: Junior Silva Date: Tue, 25 Mar 2014 18:39:16 -0300 Subject: [PATCH] invite-member: implemented initial test --- test/unit/invite_member_test.rb | 11 +++++++++++ 1 file changed, 11 insertions(+), 0 deletions(-) diff --git a/test/unit/invite_member_test.rb b/test/unit/invite_member_test.rb index 3ea4cff..e0165c0 100644 --- a/test/unit/invite_member_test.rb +++ b/test/unit/invite_member_test.rb @@ -115,5 +115,16 @@ class InviteMemberTest < ActiveSupport::TestCase assert_match(/#{task.requestor.name} invited you to join #{community.name}/, email.subject) end + should 'destroy InviteMember task when the community is destroyed' do + p1 = create_user('testuser1').person + p2 = create_user('testuser2').person + community = fast_create(Community) + + task = InviteMember.create!(:person => p1, :friend => p2, :friend_email => 'test@test.com', :community_id => community.id) + community.destroy + + assert_nil task.reload + end + end -- libgit2 0.21.2