Sha256: a44cb614196690937d163789297351bca77eb1c619ed2e8ef063da350c508b50

Contents?: true

Size: 715 Bytes

Versions: 7

Compression:

Stored size: 715 Bytes

Contents

# frozen_string_literal: true

module FillAddressFields
  def fill_addresses_fields_with(address)
    fields = %w[
      address1
      city
      zipcode
      phone
    ]
    fields += if SolidusSupport.combined_first_and_last_name_in_address?
      %w[name]
    else
      %w[firstname lastname]
    end

    fields.each do |field|
      fill_in "order_bill_address_attributes_#{field}", with: address.send(field).to_s
    end
    select 'United States', from: "order_bill_address_attributes_country_id"
    select address.state.name.to_s, from: "order_bill_address_attributes_state_id"

    check 'order_use_billing'
  end
end

RSpec.configure do |config|
  config.include FillAddressFields, type: :feature
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
solidus_auth_devise-2.5.9 spec/support/features/fill_addresses_fields.rb
solidus_auth_devise-2.5.8 spec/support/features/fill_addresses_fields.rb
solidus_auth_devise-2.5.7 spec/support/features/fill_addresses_fields.rb
solidus_auth_devise-2.5.6 spec/support/features/fill_addresses_fields.rb
solidus_auth_devise-2.5.5 spec/support/features/fill_addresses_fields.rb
solidus_auth_devise-2.5.4 spec/support/features/fill_addresses_fields.rb
solidus_auth_devise-2.5.3 spec/support/features/fill_addresses_fields.rb