error_report_spec.rb
731 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
require 'spec_helper'
describe ErrorReport do
context "with notice without line of backtrace" do
let(:xml){
Rails.root.join('spec','fixtures','hoptoad_test_notice_with_one_line_of_backtrace.xml').read
}
let(:error_report) {
ErrorReport.new(xml)
}
let(:app) {
Fabricate(
:app,
:api_key => 'APIKEY'
)
}
describe "#backtrace" do
it 'should have valid backtrace' do
error_report.backtrace.should be_valid
end
end
context "#generate_notice!" do
it "save a notice" do
expect {
error_report.generate_notice!
}.to change {
app.reload.problems.count
}.by(1)
end
end
end
end