Commit 2fc77cbe1e1c9aa4724768456392f495d212dcbc
1 parent
13c8b21f
Exists in
master
and in
1 other branch
add a spec asserting that resolving a problem doesn't reset its notice count
Showing
1 changed file
with
9 additions
and
0 deletions
Show diff stats
spec/models/problem_spec.rb
@@ -109,6 +109,15 @@ describe Problem do | @@ -109,6 +109,15 @@ describe Problem do | ||
109 | problem.resolved_at.to_s.should == expected_resolved_at.to_s | 109 | problem.resolved_at.to_s.should == expected_resolved_at.to_s |
110 | end | 110 | end |
111 | 111 | ||
112 | + it "should not reset notice count" do | ||
113 | + problem = Fabricate(:problem, :notices_count => 1) | ||
114 | + original_notices_count = problem.notices_count | ||
115 | + original_notices_count.should > 0 | ||
116 | + | ||
117 | + problem.resolve! | ||
118 | + problem.notices_count.should == original_notices_count | ||
119 | + end | ||
120 | + | ||
112 | it "should throw an err if it's not successful" do | 121 | it "should throw an err if it's not successful" do |
113 | problem = Fabricate(:problem) | 122 | problem = Fabricate(:problem) |
114 | problem.should_not be_resolved | 123 | problem.should_not be_resolved |