File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -48,3 +48,36 @@ Feature: System spec
48
48
When I run `rspec spec/system/widget_system_spec.rb`
49
49
Then the exit status should be 0
50
50
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
+
You can’t perform that action at this time.
0 commit comments