Sha256: 313d2cb53d1d7d938f7e70308dc9a349757f810ee421c9268c7bc1cf21d4b3bc

Contents?: true

Size: 393 Bytes

Versions: 1

Compression:

Stored size: 393 Bytes

Contents

require 'spec_helper'

describe Spree::Taxon, type: :model do
  let!(:taxon) { create(:taxon, name: 'Brand') }

  context '#brand_key' do
    it 'returns the 3 first chars of taxon name' do
      expect(taxon.brand_key).to eql('BRA')
    end

    it 'returns the first char of taxon name splitted' do
      taxon.name = 'Test Taxon'
      expect(taxon.brand_key).to eql('TT')
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
solidus_ship_compliant-1.0.0 spec/models/spree/taxon_spec.rb