Skip to content
Open
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
7 changes: 7 additions & 0 deletions spec/jobs/active_job_extensions_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ class ApplicationTestJobTenantError < StandardError; end
expect { described_class.perform_later(expected_tenant: nil) }.to have_enqueued_job.on_queue("default")
expect { perform_enqueued_jobs }.to raise_error(ActsAsTenant::Errors::NoTenantSet)
end

it "serializes tenant to a JSON-compatible format" do
ActsAsTenant.current_tenant = account
job = described_class.perform_later(expected_tenant: account)
serialized_data = job.serialize
expect(serialized_data["current_tenant"]).to be_a_kind_of String
end
end

context "when tenant is not required" do
Expand Down