Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Rebased] Disable display of detailed exceptions #387

Merged

Commits on Apr 22, 2018

  1. Disable display of detailed exceptions

    `@allow-rescue` permits rescuing exceptions by setting
    `action_dispatch.show_exceptions` to true in the env hash. However,
    this will render the detailed error page and not the public error page
    you'd encounter in production.
    
    Given that the feature enables testing of error pages, and seems to be
    intended to mirror production behaviour as per the comment on
    https://github.com/cucumber/cucumber-rails/blob/master/lib/generators/cucumber/install/templates/support/_rails_each_run.rb.erb#L6-L14,
    this PR sets `action_dispatch.show_detailed_exceptions` to false, thus
    enabling the public error page to be rendered.
    pedrosmmoreira authored and xtrasimplicity committed Apr 22, 2018
    Copy the full SHA
    dcc3b24 View commit details
    Browse the repository at this point in the history
  2. Do not rely on current public error message

    There are slight changes in the error message displayed in the public
    error pages across Rails versions. Checking for "We're sorry, but
    something went wrong." seems to be the safest option.
    pedrosmmoreira authored and xtrasimplicity committed Apr 22, 2018
    Copy the full SHA
    a00ede1 View commit details
    Browse the repository at this point in the history
  3. Make check conditional to Rails version

    This PR depends on action_dispatch.show_detailed_exceptions being set,
    which was only introduced in Rails 3.2.1.
    
    Here we introduce a conditional check based on the required Rails
    version in order to ensure backwards compatibility.
    Pedro Moreira authored and xtrasimplicity committed Apr 22, 2018
    Copy the full SHA
    3e6faab View commit details
    Browse the repository at this point in the history
  4. Removed check for Rails version >= 3.2.1

    As we don't support Rails 3 in Cucumber-rails >= 1.5
    xtrasimplicity committed Apr 22, 2018
    Copy the full SHA
    6ade6d0 View commit details
    Browse the repository at this point in the history