Skip to content

Commit

Permalink
Test ActiveJobExtensions serialization to JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
Ziad Sawalha committed Jan 8, 2024
1 parent 8e8f9de commit cbfe9b9
Showing 1 changed file with 7 additions and 0 deletions.
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

0 comments on commit cbfe9b9

Please sign in to comment.