Commit 00cb61dd77d0d907c409bc2d1c72676d9749bc4b

Authored by Stephen Crosby
1 parent c2cbfd8a
Exists in master and in 1 other branch production

add minimal xml notice spec

spec/fixtures/minimal_test_notice.xml 0 → 100644
... ... @@ -0,0 +1,17 @@
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<notice version="2.4">
  3 + <api-key>APIKEY</api-key>
  4 + <notifier>
  5 + <name>MINIMAL</name>
  6 + </notifier>
  7 + <error>
  8 + <class>OneClass</class>
  9 + <message>Some message</message>
  10 + <backtrace>
  11 + <line number="425" file="afile.rb" method="amethod"/>
  12 + </backtrace>
  13 + </error>
  14 + <server-environment>
  15 + <environment-name>development</environment-name>
  16 + </server-environment>
  17 +</notice>
... ...
spec/models/error_report_spec.rb
... ... @@ -65,6 +65,20 @@ describe ErrorReport do
65 65 }.by(1)
66 66 end
67 67  
  68 + context "with a minimal notice" do
  69 + let(:xml){
  70 + Rails.root.join('spec','fixtures','minimal_test_notice.xml').read
  71 + }
  72 +
  73 + it 'save a notice' do
  74 + expect {
  75 + error_report.generate_notice!
  76 + }.to change {
  77 + app.reload.problems.count
  78 + }.by(1)
  79 + end
  80 + end
  81 +
68 82 context "with notice generate by Airbrake gem" do
69 83 let(:xml) { Airbrake::Notice.new(
70 84 :exception => Exception.new,
... ...