Sha256: 1a19a44a6a2b127635258652ad9c43363595b2246d65888bec57df376a94e394

Contents?: true

Size: 904 Bytes

Versions: 2

Compression:

Stored size: 904 Bytes

Contents

require 'spec_helper'

describe G5Updatable::HubAmenity do
  it { is_expected.to validate_presence_of :external_id }

  describe 'scopes' do
    let!(:location) { create(:g5mf_location) }
    let!(:amenity) { create(:hub_amenity) }
    let!(:amenity2) { create(:hub_amenity) }
    let!(:amenity3) { create(:hub_amenity) }

    before do
      location.hub_amenities << amenity
      location.hub_amenities << amenity2
    end

    describe '#by_client_urn' do
      specify { expect(described_class.by_client_urn(location.client_urn)).to match_array([amenity, amenity2]) }
    end

    describe '#by_client_urns' do
      specify { expect(described_class.by_client_urns([location.client_urn])).to match_array([amenity, amenity2]) }
    end

    describe '#by_client_uid' do
      specify { expect(described_class.by_client_uid(location.client_uid)).to match_array([amenity, amenity2]) }
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
g5_updatable-1.0.2.pre.1 spec/models/g5_updatable/hub_amenity_spec.rb
g5_updatable-0.20.3.pre.1 spec/models/g5_updatable/hub_amenity_spec.rb