add spec for article#in_open_order
This commit is contained in:
parent
50a8cce9fd
commit
6b0146eb95
1 changed files with 9 additions and 0 deletions
|
@ -43,4 +43,13 @@ describe Article do
|
||||||
article.save!
|
article.save!
|
||||||
expect(article.article_prices.all.map(&:price)).to eq([article.price, oldprice])
|
expect(article.article_prices.all.map(&:price)).to eq([article.price, oldprice])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'is not in an open order by default' do
|
||||||
|
expect(article.in_open_order).to be_nil
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'is knows its open order' do
|
||||||
|
order = create :order, supplier: supplier, article_ids: [article.id]
|
||||||
|
expect(article.in_open_order).to eq(order)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue