Commit 6307f0eb5d3371e85ccbf732f565de170ddc222b
1 parent
a0a6ee28
Exists in
master
and in
3 other branches
Test updates for new shoulda should_change syntax
Showing
2 changed files
with
8 additions
and
8 deletions
Show diff stats
test/acts_as_followable_test.rb
... | ... | @@ -69,8 +69,8 @@ class ActsAsFollowableTest < Test::Unit::TestCase |
69 | 69 | @jon.destroy |
70 | 70 | end |
71 | 71 | |
72 | - should_change "Follow.count", :by => -1 | |
73 | - should_change "@sam.all_following.size", :by => -1 | |
72 | + should_change("follow count", :by => -1) { Follow.count } | |
73 | + should_change("@sam.all_following.size", :by => -1) { @sam.all_following.size } | |
74 | 74 | end |
75 | 75 | end |
76 | 76 | ... | ... |
test/acts_as_follower_test.rb
... | ... | @@ -43,8 +43,8 @@ class ActsAsFollowerTest < Test::Unit::TestCase |
43 | 43 | @jon.follow(@sam) |
44 | 44 | end |
45 | 45 | |
46 | - should_change "Follow.count", :by => 1 | |
47 | - should_change "@jon.follow_count", :by => 1 | |
46 | + should_change("Follow count", :by => 1) { Follow.count } | |
47 | + should_change("@jon.follow_count", :by => 1) { @jon.follow_count } | |
48 | 48 | |
49 | 49 | should "set the follower" do |
50 | 50 | assert_equal @jon, Follow.last.follower |
... | ... | @@ -60,8 +60,8 @@ class ActsAsFollowerTest < Test::Unit::TestCase |
60 | 60 | @sam.stop_following(@jon) |
61 | 61 | end |
62 | 62 | |
63 | - should_change "Follow.count", :by => -1 | |
64 | - should_change "@sam.follow_count", :by => -1 | |
63 | + should_change("Follow count", :by => -1) { Follow.count } | |
64 | + should_change("@sam.follow_count", :by => -1) { @sam.follow_count } | |
65 | 65 | end |
66 | 66 | |
67 | 67 | context "follows" do |
... | ... | @@ -119,8 +119,8 @@ class ActsAsFollowerTest < Test::Unit::TestCase |
119 | 119 | @jon.destroy |
120 | 120 | end |
121 | 121 | |
122 | - should_change "Follow.count", :by => -1 | |
123 | - should_change "@sam.follow_count", :by => -1 | |
122 | + should_change("Follow.count", :by => -1) { Follow.count } | |
123 | + should_change("@sam.follow_count", :by => -1) { @sam.follow_count } | |
124 | 124 | end |
125 | 125 | end |
126 | 126 | ... | ... |