Commit 2dbb16f5af00adc10a5ede1fbe7de60e93676653
1 parent
3e3bcd97
Exists in
master
and in
29 other branches
rails3: fix add_friend test
PS: still failing mailer stubs.
Showing
1 changed file
with
5 additions
and
5 deletions
Show diff stats
test/unit/add_friend_test.rb
@@ -95,11 +95,11 @@ class AddFriendTest < ActiveSupport::TestCase | @@ -95,11 +95,11 @@ class AddFriendTest < ActiveSupport::TestCase | ||
95 | 95 | ||
96 | task.group_for_person = big_word | 96 | task.group_for_person = big_word |
97 | task.valid? | 97 | task.valid? |
98 | - assert task.errors[:group_for_person] | 98 | + assert task.errors[:group_for_person].present? |
99 | 99 | ||
100 | task.group_for_person = 'short name' | 100 | task.group_for_person = 'short name' |
101 | task.valid? | 101 | task.valid? |
102 | - assert !task.errors[:group_for_person] | 102 | + assert !task.errors[:group_for_person].present? |
103 | end | 103 | end |
104 | 104 | ||
105 | should 'limit "group for friend" number of characters' do | 105 | should 'limit "group for friend" number of characters' do |
@@ -109,11 +109,11 @@ class AddFriendTest < ActiveSupport::TestCase | @@ -109,11 +109,11 @@ class AddFriendTest < ActiveSupport::TestCase | ||
109 | 109 | ||
110 | task.group_for_friend = big_word | 110 | task.group_for_friend = big_word |
111 | task.valid? | 111 | task.valid? |
112 | - assert task.errors[:group_for_friend] | 112 | + assert task.errors[:group_for_friend].present? |
113 | 113 | ||
114 | task.group_for_friend = 'short name' | 114 | task.group_for_friend = 'short name' |
115 | task.valid? | 115 | task.valid? |
116 | - assert !task.errors[:group_for_friend] | 116 | + assert !task.errors[:group_for_friend].present? |
117 | end | 117 | end |
118 | 118 | ||
119 | should 'have target notification message if is organization and not moderated' do | 119 | should 'have target notification message if is organization and not moderated' do |
@@ -131,7 +131,7 @@ class AddFriendTest < ActiveSupport::TestCase | @@ -131,7 +131,7 @@ class AddFriendTest < ActiveSupport::TestCase | ||
131 | should 'deliver target notification message' do | 131 | should 'deliver target notification message' do |
132 | task = AddFriend.new(:person => person1, :friend => person2) | 132 | task = AddFriend.new(:person => person1, :friend => person2) |
133 | 133 | ||
134 | - email = TaskMailer.deliver_target_notification(task, task.target_notification_message) | 134 | + email = TaskMailer.target_notification(task, task.target_notification_message).deliver |
135 | assert_match(/#{task.requestor.name} wants to be your friend/, email.subject) | 135 | assert_match(/#{task.requestor.name} wants to be your friend/, email.subject) |
136 | end | 136 | end |
137 | 137 |