Feature: Project root configuration Background: Given I set environment variable "BUGSNAG_API_KEY" to "a35a2a72bd230ac0aa0f52715bbdc6aa" And I set environment variable "APP_PATH" to "/usr/src" And I configure the bugsnag endpoint Scenario Outline: Project_root should default to Rails.root Given I set environment variable "RUBY_VERSION" to "" And I start the service "rails" And I wait for the app to respond on port "6128" When I navigate to the route "/project_root/default" on port "6128" Then I should receive a request And the request is a valid for the error reporting API And the request used the "Ruby Bugsnag Notifier" notifier And the request contained the api key "a35a2a72bd230ac0aa0f52715bbdc6aa" And the payload field "events" is an array with 1 element And the exception "errorClass" equals "RuntimeError" And the exception "message" starts with "handled string" And the event "metaData.request.url" ends with "/project_root/default" And the "file" of the top non-bugsnag stackframe equals "app/controllers/project_root_controller.rb" Examples: | ruby_version | rails_version | | 2.0 | 3 | | 2.1 | 3 | | 2.2 | 3 | | 2.2 | 4 | | 2.2 | 5 | | 2.3 | 3 | | 2.3 | 4 | | 2.3 | 5 | | 2.4 | 3 | | 2.4 | 5 | | 2.5 | 3 | | 2.5 | 5 | | 2.5 | 6 | | 2.6 | 5 | | 2.6 | 6 | Scenario Outline: Project_root can be set in an initializer Given I set environment variable "RUBY_VERSION" to "" And I set environment variable "BUGSNAG_PROJECT_ROOT" to "/foo/bar" And I start the service "rails" And I wait for the app to respond on port "6128" When I navigate to the route "/project_root/initializer" on port "6128" Then I should receive a request And the request is a valid for the error reporting API And the request used the "Ruby Bugsnag Notifier" notifier And the request contained the api key "a35a2a72bd230ac0aa0f52715bbdc6aa" And the payload field "events" is an array with 1 element And the exception "errorClass" equals "RuntimeError" And the exception "message" starts with "handled string" And the event "metaData.request.url" ends with "/project_root/initializer" And the "file" of the top non-bugsnag stackframe equals "/usr/src/app/controllers/project_root_controller.rb" Examples: | ruby_version | rails_version | | 2.0 | 3 | | 2.1 | 3 | | 2.2 | 3 | | 2.2 | 4 | | 2.2 | 5 | | 2.3 | 3 | | 2.3 | 4 | | 2.3 | 5 | | 2.4 | 3 | | 2.4 | 5 | | 2.5 | 3 | | 2.5 | 5 | | 2.5 | 6 | | 2.6 | 5 | | 2.6 | 6 | Scenario Outline: Project_root can be set after an initializer Given I set environment variable "RUBY_VERSION" to "" And I start the service "rails" And I wait for the app to respond on port "6128" When I navigate to the route "/project_root/after" on port "6128" Then I should receive a request And the request is a valid for the error reporting API And the request used the "Ruby Bugsnag Notifier" notifier And the request contained the api key "a35a2a72bd230ac0aa0f52715bbdc6aa" And the payload field "events" is an array with 1 element And the exception "errorClass" equals "RuntimeError" And the exception "message" starts with "handled string" And the event "metaData.request.url" ends with "/project_root/after" And the "file" of the top non-bugsnag stackframe equals "/usr/src/app/controllers/project_root_controller.rb" Examples: | ruby_version | rails_version | | 2.0 | 3 | | 2.1 | 3 | | 2.2 | 3 | | 2.2 | 4 | | 2.2 | 5 | | 2.3 | 3 | | 2.3 | 4 | | 2.3 | 5 | | 2.4 | 3 | | 2.4 | 5 | | 2.5 | 3 | | 2.5 | 5 | | 2.5 | 6 | | 2.6 | 5 | | 2.6 | 6 |