Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 64 lines (59 sloc) 2.337 kb
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 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
Feature: Inform the user of the airbrake notice that was just created

Background:
Given I have built and installed the "airbrake" gem

Scenario: Rescue an exception in a controller
When I generate a new Rails application
And I configure the Airbrake shim
And I configure my application to require the "airbrake" gem
And I run the airbrake generator with "-k myapikey"
And I define a response for "TestController#index":
"""
raise RuntimeError, "some message"
"""
And the response page for a "500" error is
"""
<!-- AIRBRAKE ERROR -->
"""
And I route "/test/index" to "test#index"
And I perform a request to "http://example.com:123/test/index?param=value"
Then I should see "Airbrake Error 3799307"

Scenario: Rescue an exception in a controller with a custom error string
When I generate a new Rails application
And I configure the Airbrake shim
And I configure my application to require the "airbrake" gem
And I configure the notifier to use the following configuration lines:
"""
config.user_information = 'Error #{{ error_id }}'
"""
And I run the airbrake generator with "-k myapikey"
And I define a response for "TestController#index":
"""
raise RuntimeError, "some message"
"""
And the response page for a "500" error is
"""
<!-- AIRBRAKE ERROR -->
"""
And I route "/test/index" to "test#index"
And I perform a request to "http://example.com:123/test/index?param=value"
Then I should see "Error #3799307"

Scenario: Don't inform them user
When I generate a new Rails application
And I configure the Airbrake shim
And I configure my application to require the "airbrake" gem
And I configure the notifier to use the following configuration lines:
"""
config.user_information = false
"""
And I run the airbrake generator with "-k myapikey"
And I define a response for "TestController#index":
"""
raise RuntimeError, "some message"
"""
And the response page for a "500" error is
"""
<!-- AIRBRAKE ERROR -->
"""
And I route "/test/index" to "test#index"
And I perform a request to "http://example.com:123/test/index?param=value"
Then I should not see "Airbrake Error 3799307"
Something went wrong with that request. Please try again.