Sha256: cd16b0c8cd946356f0c9efda67c76a30bc34803166129f997a82d6edd1c3f176

Contents?: true

Size: 527 Bytes

Versions: 26

Compression:

Stored size: 527 Bytes

Contents

require 'spec_helper'

describe Spree::State, type: :model do
  it "can find a state by name or abbr" do
    state = create(:state, name: "California", abbr: "CA")
    expect(Spree::State.find_all_by_name_or_abbr("California")).to include(state)
    expect(Spree::State.find_all_by_name_or_abbr("CA")).to include(state)
  end

  it "can find all states group by country id" do
    state = create(:state)
    expect(Spree::State.states_group_by_country_id).to eq({ state.country_id.to_s => [[state.id, state.name]] })
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
solidus_core-2.2.2 spec/models/spree/state_spec.rb
solidus_core-2.1.1 spec/models/spree/state_spec.rb
solidus_core-2.0.3 spec/models/spree/state_spec.rb
solidus_core-1.4.2 spec/models/spree/state_spec.rb
solidus_core-1.3.2 spec/models/spree/state_spec.rb
solidus_core-2.0.2 spec/models/spree/state_spec.rb
solidus_core-1.4.1 spec/models/spree/state_spec.rb
solidus_core-2.2.1 spec/models/spree/state_spec.rb
solidus_core-2.2.0 spec/models/spree/state_spec.rb
solidus_core-2.2.0.rc1 spec/models/spree/state_spec.rb
solidus_core-2.2.0.beta1 spec/models/spree/state_spec.rb
solidus_core-2.1.0 spec/models/spree/state_spec.rb
solidus_core-2.1.0.rc1 spec/models/spree/state_spec.rb
solidus_core-2.0.1 spec/models/spree/state_spec.rb
solidus_core-2.1.0.beta1 spec/models/spree/state_spec.rb
solidus_core-2.0.0 spec/models/spree/state_spec.rb
solidus_core-1.4.0 spec/models/spree/state_spec.rb
solidus_core-2.0.0.rc1 spec/models/spree/state_spec.rb
solidus_core-1.4.0.rc1 spec/models/spree/state_spec.rb
solidus_core-2.0.0.beta1 spec/models/spree/state_spec.rb