Sha256: 9fa360664028cd32922941f8f8797ac70cabad4ecc8875364dec2f7cf4560e76
Contents?: true
Size: 731 Bytes
Versions: 12
Compression:
Stored size: 731 Bytes
Contents
describe ItemWithOptionalOrg do let!(:item_without_org) { without_org { described_class.create! } } let!(:org) { Organization.create! } let!(:item_with_org) { org.as_current { described_class.create! } } let!(:other_org) { Organization.create! } let!(:item_with_other_org) { other_org.as_current { described_class.create! } } it "returns the correct items when no org is set" do without_org do expect(described_class.all).to eq([item_without_org]) end end it "returns the correct items when an org is set" do org.as_current do expect(described_class.all).to eq([item_with_org]) end end def without_org(&block) GlobalContextRegistry.with_isolated_registry(&block) end end
Version data entries
12 entries across 12 versions & 1 rubygems