Skip to content

Ensure that system test screenshots work for specs that have :aggregate_failures enabled #1907

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

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion lib/rspec/rails/example/system_example_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@ def after_teardown

# for the SystemTesting Screenshot situation
def passed?
RSpec.current_example.exception.nil?
return false if RSpec.current_example.exception
return true unless defined?(::RSpec::Expectations::FailureAggregator)

failure_notifier = ::RSpec::Support.failure_notifier
return true unless failure_notifier.is_a?(::RSpec::Expectations::FailureAggregator)

failure_notifier.failures.empty? && failure_notifier.other_errors.empty?
end

# @private
Expand Down