FactoryGirl.define do factory :location, class: G5Updatable::Location do uid "http://example.com/clients/g5-c-1234-client/locations/g5-cl-1234-location" urn "g5-cl-1234-location" client_uid "http://example.com/clients/g5-c-1234-client" name 'test location' properties { {domain: "http://myloc.com"} } end factory :client, class: G5Updatable::Client do uid "http://example.com/clients/g5-c-1234-client" urn "g5-c-1234-client" name 'test client' properties { {city: "Test Client"} } end factory :incrementing_location, parent: :location do association :client, factory: :incrementing_client sequence(:urn) { |n| "g5-cl-#{n}-location" } uid { "http://example.com/clients/#{client.urn}/locations/#{urn}" } client_uid { client.uid } end factory :incrementing_client, parent: :client do sequence(:urn) { |n| "g5-c-#{n}-client" } uid { "http://example.com/clients/#{urn}" } end factory :g5mf_client, parent: :client do uid 'https://g5-hub.herokuapp.com/clients/g5-c-1soj8z7v-g5-mf' urn 'g5-c-1soj8z7v-g5-mf' end factory :g5mf_location, parent: :location do uid 'https://g5-hub.herokuapp.com/clients/g5-c-1soj8z7v-g5-selfstorage/locations/g5-cl-loc' urn 'g5-cl-loc' properties { {status: 'Live'} } client { G5Updatable::Client.find_by_urn('g5-c-1soj8z7v-g5-mf') || create(:g5mf_client) } name { 'g5 multi family' } trait :all_properties do latitude { 20.915166 } longitude { -156.379291 } properties { {street_address_1: '71 Baldwin Ave', city: 'paia', state: 'HI', state_name: 'Hawaii', postal_code: '96779', country: 'US', phone_number: '8884443332', email: 'email@example.com', home_page_url: 'homey.com', internal_branded_name: 'zss1', status: 'Live', corporate: 'false', neighborhood: 'Red Light', neighborhood_2: 'Green Light', domain: 'adomain'} } end end factory :hub_amenity, class: G5Updatable::HubAmenity do sequence(:name) { |n| "amenity-#{n}" } sequence(:external_id) { |n| n } icon 'icon' end end