Sha256: f6133e40ea128e41a9e70d2746426ca56a25d4b7b1a4cb40aed1999aa329b77b

Contents?: true

Size: 587 Bytes

Versions: 5

Compression:

Stored size: 587 Bytes

Contents

require 'spec_helper'

describe Inventory do
  it 'sets number on create' do
    inventory = Inventory.create
    expect(inventory.number).not_to be_nil
  end

  it 'creates with own number' do
    inventory = Inventory.create number: '500'
    expect(inventory.number).to eq('500')
  end

  it 'does not change number on update' do
    inventory = Inventory.create number: '5'
    inventory.touch
    expect(inventory.number).to eq('5')
  end

  it 'creates sequence of numbers' do
    expect(Inventory.create.number).to eq('1')
    expect(Inventory.create.number).to eq('2')
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
document_number-0.9.4 spec/models/inventory_spec.rb
document_number-0.9.3 spec/models/inventory_spec.rb
document_number-0.9.2 spec/models/inventory_spec.rb
document_number-0.9.1 spec/models/inventory_spec.rb
document_number-0.9.0 spec/models/inventory_spec.rb