From 2fc77cbe1e1c9aa4724768456392f495d212dcbc Mon Sep 17 00:00:00 2001 From: Robert Lail Date: Sat, 29 Sep 2012 14:56:43 -0500 Subject: [PATCH] add a spec asserting that resolving a problem doesn't reset its notice count --- spec/models/problem_spec.rb | 9 +++++++++ 1 file changed, 9 insertions(+), 0 deletions(-) diff --git a/spec/models/problem_spec.rb b/spec/models/problem_spec.rb index 7ac9839..65ee766 100644 --- a/spec/models/problem_spec.rb +++ b/spec/models/problem_spec.rb @@ -109,6 +109,15 @@ describe Problem do problem.resolved_at.to_s.should == expected_resolved_at.to_s end + it "should not reset notice count" do + problem = Fabricate(:problem, :notices_count => 1) + original_notices_count = problem.notices_count + original_notices_count.should > 0 + + problem.resolve! + problem.notices_count.should == original_notices_count + end + it "should throw an err if it's not successful" do problem = Fabricate(:problem) problem.should_not be_resolved -- libgit2 0.21.2