module RSpec::Rails::SystemExampleGroup
@api public Container class for system tests
Constants
- CHARS_TO_TRANSLATE
-
Special characters to translate into underscores for
method_name
- DEFAULT_DRIVER
-
Default driver to assign if none specified.
Attributes
Public Class Methods
Source
# File lib/rspec/rails/example/system_example_group.rb, line 141 def initialize(*args, &blk) super(*args, &blk) @driver = nil self.class.before do # A user may have already set the driver, so only default if driver # is not set driven_by(DEFAULT_DRIVER) unless @driver end end
Calls superclass method
Public Instance Methods
Source
# File lib/rspec/rails/example/system_example_group.rb, line 94 def app ::Rails.application end
Delegates to ‘Rails.application`.
Source
# File lib/rspec/rails/example/system_example_group.rb, line 152 def driven_by(driver, **driver_options, &blk) @driver = ::ActionDispatch::SystemTestCase.driven_by(driver, **driver_options, &blk).tap(&:use) end
Source
# File lib/rspec/rails/example/system_example_group.rb, line 88 def metadata @metadata ||= SuppressRailsScreenshotMetadata.new end
@private
Source
# File lib/rspec/rails/example/system_example_group.rb, line 40 def method_name @method_name ||= [ self.class.name.underscore, RSpec.current_example.description.underscore ].join("_").tr(CHARS_TO_TRANSLATE.join, "_").byteslice(0...200).scrub("") + "_#{rand(1000)}" end
@private
Source
# File lib/rspec/rails/example/system_example_group.rb, line 29 def passed? 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
for the SystemTesting Screenshot situation