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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions features/allow_rescue.feature
Expand Up @@ -23,20 +23,24 @@ Feature: Allow Cucumber to rescue exceptions
Feature: posts
@allow-rescue
Scenario: See posts
When I look at the posts
When I look at the posts
Then I should see the public error page
"""
And I write to "features/step_definitions/posts_steps.rb" with:
"""
When /^I look at the posts$/ do
visit '/posts'
end
Then /^I should see the public error page$/ do
expect(page).to have_content "We're sorry, but something went wrong."
end
"""
And I run `bundle exec rake db:migrate`
And I run `bundle exec cucumber`
Then the feature run should pass with:
"""
1 scenario (1 passed)
1 step (1 passed)
2 steps (2 passed)
"""

Scenario: Don't allow rescue
Expand Down
1 change: 1 addition & 0 deletions lib/cucumber/rails/action_controller.rb
Expand Up @@ -7,6 +7,7 @@ class ActionDispatch::ShowExceptions

def call(env)
env['action_dispatch.show_exceptions'] = !!ActionController::Base.allow_rescue
env['action_dispatch.show_detailed_exceptions'] = !ActionController::Base.allow_rescue
__cucumber_orig_call__(env)
end
end