|
56 | 56 | end |
57 | 57 | end |
58 | 58 |
|
59 | | - context "using the :raven/:sentry strategy" do |
60 | | - let(:reporter) { described_class.new(:sentry) } |
| 59 | + context "using the :raven strategy" do |
| 60 | + let(:reporter) { described_class.new(:raven) } |
61 | 61 |
|
62 | 62 | it "Raises an error if the Raven constant is not defined" do |
63 | 63 | expect { reporter.report(error) }.to raise_error(ApiErrorHandler::MissingDependencyError) |
64 | 64 | end |
65 | 65 |
|
66 | | - it "Reports to Honeybadger with an error id" do |
| 66 | + it "Reports to Sentry with an error id" do |
67 | 67 | stub_const("Raven", double) |
68 | 68 | expect(Raven).to receive(:capture_exception).with(error, extra: { error_id: "456" }) |
69 | 69 |
|
70 | 70 | reporter.report(error, error_id: "456") |
71 | 71 | end |
72 | 72 |
|
73 | | - it "Reports to Honeybadger without an error id" do |
| 73 | + it "Reports to Sentry without an error id" do |
74 | 74 | stub_const("Raven", double) |
75 | 75 | expect(Raven).to receive(:capture_exception).with(error, extra: {}) |
76 | 76 |
|
77 | 77 | reporter.report(error) |
78 | 78 | end |
79 | 79 | end |
| 80 | + |
| 81 | + context "using the :sentry strategy" do |
| 82 | + let(:reporter) { described_class.new(:sentry) } |
| 83 | + |
| 84 | + it "Raises an error if the Sentry constant is not defined" do |
| 85 | + expect { reporter.report(error) }.to raise_error(ApiErrorHandler::MissingDependencyError) |
| 86 | + end |
| 87 | + |
| 88 | + it "Reports to Sentry with an error id" do |
| 89 | + stub_const("Sentry", double) |
| 90 | + expect(Sentry).to receive(:capture_exception).with(error, extra: { error_id: "456" }) |
| 91 | + |
| 92 | + reporter.report(error, error_id: "456") |
| 93 | + end |
| 94 | + |
| 95 | + it "Reports to Sentry without an error id" do |
| 96 | + stub_const("Sentry", double) |
| 97 | + expect(Sentry).to receive(:capture_exception).with(error, extra: {}) |
| 98 | + |
| 99 | + reporter.report(error) |
| 100 | + end |
| 101 | + end |
80 | 102 | end |
0 commit comments