Skip to content

Commit b3db85e

Browse files
committed
Add a reproduction case for #2242
1 parent 64b2712 commit b3db85e

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

features/system_specs/system_specs.feature

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

0 commit comments

Comments
 (0)