Sha256: a977f99678efb8c230187d62a8d0bbf95c45dd1f39df5c9a9c859138424dd863

Contents?: true

Size: 951 Bytes

Versions: 30

Compression:

Stored size: 951 Bytes

Contents

module AddressSpecHelper
  def complete_address_form(kind_of_address, attrs = {})

    %w(first_name last_name address1 address2 city zipcode).each do | attr |
      fill_in "order_#{kind_of_address}_address_attributes_#{attr}", with: attrs[attr.to_sym]
    end

    select  'United States',  from: "order_#{kind_of_address}_address_attributes_country_code"
    select  'Alabama',        from: "order_#{kind_of_address}_address_attributes_state_code"
  end


  def fill_good_address
    address = build(:shipping_address)
    fill_in 'First name',     with: address[:first_name]
    fill_in 'Last name',      with: address[:last_name]
    fill_in 'Address1',       with: address[:address1]
    fill_in 'Address2',       with: 'Highway'
    fill_in 'City',           with: address[:city]
    select  'United States',  from: 'Country'
    select  'Alabama',        from: 'State/Province'
    fill_in 'Zipcode',        with:  address[:zipcode]
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
nimbleshop_core-0.0.23 test/support/address_test_helper.rb
nimbleshop_core-0.0.21 test/support/address_test_helper.rb
nimbleshop_core-0.0.20 test/support/address_test_helper.rb
nimbleshop_core-0.0.19 test/support/address_test_helper.rb
nimbleshop_core-0.0.17 test/support/address_test_helper.rb
nimbleshop_core-0.0.16 test/support/address_test_helper.rb
nimbleshop_core-0.0.15 test/support/address_test_helper.rb
nimbleshop_core-0.0.14 test/support/address_test_helper.rb
nimbleshop_core-0.0.14.rc2 test/support/address_test_helper.rb
nimbleshop_core-0.0.14.rc1 test/support/address_test_helper.rb
nimbleshop_core-0.0.13 test/support/address_test_helper.rb
nimbleshop_core-0.0.12 test/support/address_test_helper.rb
nimbleshop_core-0.0.11 test/support/address_test_helper.rb
nimbleshop_core-0.0.10 test/support/address_test_helper.rb
nimbleshop_core-0.0.9 test/support/address_test_helper.rb
nimbleshop_core-0.0.8 test/support/address_test_helper.rb
nimbleshop_core-0.0.7 test/support/address_test_helper.rb
nimbleshop_core-0.0.5 test/support/address_test_helper.rb
nimbleshop_core-0.0.4.beta1 test/support/address_test_helper.rb
nimbleshop_core-0.0.4 test/support/address_test_helper.rb