FactoryGirl.define do factory :g5_updatable_client, class: "G5Updatable::Client" do sequence(:urn) { |n| "client_urn_#{n}" } uid { "http://client.com/#{urn}" } end factory :g5_updatable_location, class: "G5Updatable::Location" do association :client, factory: :g5_updatable_client sequence(:urn) { |n| "location_urn_#{n}" } uid { "#{client.urn}/locations/#{urn}" } sequence(:phone_number) { |n| "123-321-#{n}" } corporate false status "Pending" street_address_1 "123 Test Way" street_address_2 "" city "Delta City" state "MI" state_name "Michigan" postal_code "54169" service_1 nil service_2 nil service_3 nil service_4 nil service_5 nil fax "" email "email@getg5.com" office_hours "" access_hours nil twitter_username "" facebook_username "" yelp_username "" pinterest_username "" foursquare_username "" tumblr_username "" instagram_username "" vimeo_username "" youtube_username "" domain "www.example.org" secure_domain false neighborhood nil boat_storage false business_storage false gate_access false security_monitoring false business_center false climate_controlled false heated_cooled false friendly_staff false covered_drivethru false covered_loading false rv_boat_storage false outside_parking false deliveries false dollies_carts false digital_surveillance false drive_up_access false electronic_gate false uhaul_trucks false budget_trucks false moving_trucks false free_truck false fenced_lighted false ground_level_units false high_ceilings false individual_alarmed_units false mail_boxes false major_credit_cards false military_discounts false student_discount false senior_discount false month_to_month false no_admin_fee false no_deposits false no_late_fees false online_bill_pay false packing_moving_supplies false boxes_locks false tenant_insurance false truck_rentals false wide_driveways false wine_storage false other_features nil rv_storage false seven_day_access false other_storage nil specific_demographic nil primary_offering nil secondary_other nil secondary_condo false secondary_townhomes false secondary_apartments false floor_plans nil nearby_schools nil highrise_structure false garden_structure false townhome_structure false modern_structure false nearby_employers nil dogs_allowed false cats_allowed false accessibility nil air_conditioned false cable_included false ceiling_fans false custom_cabinetry false dishwasher false energy_efficient false fireplace false granite_counters false hardwood_floors false private_balcony false private_patio false refrigerator false stainless_appliances false smoke_free false style_design nil style_cost nil walkin_closet false washer_dryer false has_view false other_amenities nil carport_parking false club_house false dog_park false corporate_suites false family_friendly false fitness_center false furnished_apartments false garages false gated_entrance false laundry_facilities false online_rental_payments false onsite_management false close_park false pet_friendly false playground false recycling_center false swimming_pool false hot_tub false storage_available false tennis_court false wifi_available false other_community_amenities nil primary_offering_other nil ga_tracking_id nil ga_profile_id nil landmark_1_type nil landmark_1_name nil landmark_2_type nil landmark_2_name nil property_feature_1 nil property_feature_2 nil property_feature_3 nil apartment_amenity_1 nil apartment_amenity_2 nil community_amenity_1 nil community_amenity_2 nil timezone nil latitude 42.7265775 longitude -84.6620322 go_squared_site_token nil thumbnail_url "/images/thumb/missing.png" thumbnail_url_300px "/images/thumb/missing.png" website_page_prefix "https://prefix/" initialize_with do attrs = {} attributes.each do |key, value| if G5Updatable::Location.instance_methods.include?(key) || G5Updatable::Location.column_names.include?(key.to_s) attrs[key] = value else attrs[:properties] ||= {} attrs[:properties][key] = value end end G5Updatable::Location.new(attrs) end end end