Commit 3052c8d70c933e76d8d2e1fc4cc08d541733027b
1 parent
d4e46b3d
Exists in
master
and in
1 other branch
Track the last notice time for an error
Showing
2 changed files
with
17 additions
and
0 deletions
Show diff stats
app/models/error.rb
spec/models/error_spec.rb
... | ... | @@ -40,4 +40,17 @@ describe Error do |
40 | 40 | end |
41 | 41 | end |
42 | 42 | |
43 | + context '#last_notice_at' do | |
44 | + it "returns the created_at timestamp of the latest notice" do | |
45 | + error = Factory(:error) | |
46 | + error.last_notice_at.should be_nil | |
47 | + | |
48 | + notice1 = Factory(:notice, :error => error) | |
49 | + error.last_notice_at.should == notice1.created_at | |
50 | + | |
51 | + notice2 = Factory(:notice, :error => error) | |
52 | + error.last_notice_at.should == notice2.created_at | |
53 | + end | |
54 | + end | |
55 | + | |
43 | 56 | end |
44 | 57 | \ No newline at end of file | ... | ... |