Sha256: 008f4ff39f92b75884dc9702ba5da778bf1791274e7dc05233fed550342669fa

Contents?: true

Size: 471 Bytes

Versions: 9

Compression:

Stored size: 471 Bytes

Contents

shared_examples_for 'a ESA::Amount subtype' do |elements|
  let(:amount) { FactoryGirl.build(elements[:kind]) }
  subject { amount }
  
  it { should be_valid }
  
  it "should require an amount" do
    amount.amount = nil
    amount.should_not be_valid
  end

  it "should require a transaction" do
    amount.transaction = nil
    amount.should_not be_valid
  end
  
  it "should require an account" do
    amount.account = nil
    amount.should_not be_valid
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
event_sourced_accounting-0.2.6 spec/support/amount_shared_examples.rb
event_sourced_accounting-0.2.4 spec/support/amount_shared_examples.rb
event_sourced_accounting-0.2.3 spec/support/amount_shared_examples.rb
event_sourced_accounting-0.2.2 spec/support/amount_shared_examples.rb
event_sourced_accounting-0.1.6 spec/support/amount_shared_examples.rb
event_sourced_accounting-0.1.4 spec/support/amount_shared_examples.rb
event_sourced_accounting-0.1.3 spec/support/amount_shared_examples.rb
event_sourced_accounting-0.1.1 spec/support/amount_shared_examples.rb
event_sourced_accounting-0.1.0 spec/support/amount_shared_examples.rb