Commit fde59d5eb9f9d0a80255335d3758d08b6ab894f8
1 parent
cc269c09
Exists in
master
and in
29 other branches
orders-plugin: create profile for order on test
Showing
1 changed file
with
3 additions
and
3 deletions
Show diff stats
plugins/orders/test/unit/orders_plugin/order_test.rb
... | ... | @@ -3,7 +3,7 @@ require "test_helper" |
3 | 3 | class OrdersPlugin::OrderTest < ActiveSupport::TestCase |
4 | 4 | |
5 | 5 | def setup |
6 | - @order = build(OrdersPlugin::Order) | |
6 | + @order = build(OrdersPlugin::Order, :profile => fast_create(Profile)) | |
7 | 7 | end |
8 | 8 | |
9 | 9 | should 'report supplier products when distributing aggregate products' do |
... | ... | @@ -49,12 +49,12 @@ class OrdersPlugin::OrderTest < ActiveSupport::TestCase |
49 | 49 | should 'define and validate list of statuses' do |
50 | 50 | @order.status = 'blah' |
51 | 51 | @order.valid? |
52 | - assert @order.errors.invalid?('status') | |
52 | + assert @order.invalid?('status') | |
53 | 53 | |
54 | 54 | ['draft', 'planned', 'ordered', 'cancelled'].each do |i| |
55 | 55 | @order.status = i |
56 | 56 | @order.valid? |
57 | - assert !@order.errors.invalid?('status') | |
57 | + assert !@order.invalid?('status') | |
58 | 58 | end |
59 | 59 | end |
60 | 60 | ... | ... |