Skip to content

Remove IntegrationTest::Behavior from SystemExampleGroup #2242

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
Show file tree
Hide file tree
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
33 changes: 33 additions & 0 deletions features/system_specs/system_specs.feature
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,36 @@ Feature: System spec
When I run `rspec spec/system/widget_system_spec.rb`
Then the exit status should be 0
And the output should contain "1 example, 0 failures"

@system_test
Scenario: the ActiveJob queue_adapter can be changed
Given a file named "spec/system/some_job_system_spec.rb" with:
"""ruby
require "rails_helper"

class SomeJob < ActiveJob::Base
cattr_accessor :job_ran

def perform
@@job_ran = true
end
end

RSpec.describe "spec/system/some_job_system_spec.rb", :type => :system do
describe "#perform_later" do
before do
ActiveJob::Base.queue_adapter = :inline
end

it "perform later SomeJob" do
expect(ActiveJob::Base.queue_adapter).to be_an_instance_of(ActiveJob::QueueAdapters::InlineAdapter)

SomeJob.perform_later

expect(SomeJob.job_ran).to eq(true)
end
end
end
"""
When I run `rspec spec/system/some_job_system_spec.rb`
Then the example should pass
1 change: 0 additions & 1 deletion lib/rspec/rails/example/system_example_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ def app
original_after_teardown =
::ActionDispatch::SystemTesting::TestHelpers::SetupAndTeardown.instance_method(:after_teardown)

other.include ActionDispatch::IntegrationTest::Behavior
other.include ::ActionDispatch::SystemTesting::TestHelpers::SetupAndTeardown
other.include ::ActionDispatch::SystemTesting::TestHelpers::ScreenshotHelper
other.include BlowAwayTeardownHooks
Expand Down