Skip to content

Commit fac9b5d

Browse files
committed
Add a reproduction case for rspec#2242
1 parent 924cfda commit fac9b5d

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

features/system_specs/system_specs.feature

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,37 @@ Feature: System spec
4848
When I run `rspec spec/system/widget_system_spec.rb`
4949
Then the exit status should be 0
5050
And the output should contain "1 example, 0 failures"
51+
52+
@system_test
53+
Scenario: the ActiveJob queue_adapter can be changed
54+
Given a file named "spec/system/some_job_system_spec.rb" with:
55+
"""ruby
56+
require "rails_helper"
57+
58+
class SomeJob < ActiveJob::Base
59+
cattr_accessor :job_ran
60+
61+
def perform
62+
@@job_ran = true
63+
end
64+
end
65+
66+
RSpec.describe "spec/system/some_job_system_spec.rb", :type => :system do
67+
describe "#perform_later" do
68+
before do
69+
ActiveJob::Base.queue_adapter = :inline
70+
end
71+
72+
it "perform later SomeJob" do
73+
expect(ActiveJob::Base.queue_adapter).to be_an_instance_of(ActiveJob::QueueAdapters::InlineAdapter)
74+
75+
SomeJob.perform_later
76+
77+
expect(SomeJob.job_ran).to eq(true)
78+
end
79+
end
80+
end
81+
"""
82+
When I run `rspec spec/system/some_job_system_spec.rb`
83+
Then the example should pass
84+

0 commit comments

Comments
 (0)