File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -48,3 +48,37 @@ 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
+ @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
+
You can’t perform that action at this time.
0 commit comments