Sha256: 637865d2e93865114d5da787efe892eda3ea9d8ec4942b5bea20508107b885ce

Contents?: true

Size: 542 Bytes

Versions: 3

Compression:

Stored size: 542 Bytes

Contents

require 'spec_helper'

describe Invoice do
  it 'sets number on create with prefix' do
    invoice = Invoice.create
    expect(invoice.number).to eq('invoice/1')
  end

  it 'gets array of numbers with prefix' do
    expect(Invoice.get_numbers(3)).to eq(%w(invoice/1 invoice/2 invoice/3))
  end

  it 'assigns number after initialization if has with_number' do
    expect(Invoice.new(with_number: true).number).to eq('invoice/1')
  end

  it 'does not assign number after initialization' do
    expect(Invoice.new.number).to be_nil
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
document_number-0.10.0 spec/models/invoices_spec.rb
document_number-0.9.6 spec/models/invoices_spec.rb
document_number-0.9.5 spec/models/invoices_spec.rb