Commit ada102788b63a466ac9bfed732eb4815b72d7901
1 parent
f2713b75
Exists in
ratings_minor_fixes
and in
3 other branches
products: fix random failing test
Showing
1 changed file
with
3 additions
and
3 deletions
Show diff stats
plugins/products/test/unit/profile_test.rb
@@ -22,9 +22,8 @@ class ProfileTest < ActiveSupport::TestCase | @@ -22,9 +22,8 @@ class ProfileTest < ActiveSupport::TestCase | ||
22 | end | 22 | end |
23 | 23 | ||
24 | should 'collect the highlighted products with image' do | 24 | should 'collect the highlighted products with image' do |
25 | - env = Environment.default | ||
26 | e1 = fast_create(Enterprise) | 25 | e1 = fast_create(Enterprise) |
27 | - p1 = create(Product, name: 'test_prod1', product_category_id: @product_category.id, enterprise: e1) | 26 | + create(Product, name: 'test_prod1', product_category_id: @product_category.id, enterprise: e1) |
28 | products = [] | 27 | products = [] |
29 | 3.times {|n| | 28 | 3.times {|n| |
30 | products.push(create(Product, name: "product #{n}", profile_id: e1.id, | 29 | products.push(create(Product, name: "product #{n}", profile_id: e1.id, |
@@ -36,7 +35,8 @@ class ProfileTest < ActiveSupport::TestCase | @@ -36,7 +35,8 @@ class ProfileTest < ActiveSupport::TestCase | ||
36 | create(Product, name: "product 5", profile_id: e1.id, product_category_id: @product_category.id, image_builder: { | 35 | create(Product, name: "product 5", profile_id: e1.id, product_category_id: @product_category.id, image_builder: { |
37 | uploaded_data: fixture_file_upload('/files/rails.png', 'image/png') | 36 | uploaded_data: fixture_file_upload('/files/rails.png', 'image/png') |
38 | }) | 37 | }) |
39 | - assert_equal products, e1.highlighted_products_with_image | 38 | + |
39 | + assert_equivalent products, e1.highlighted_products_with_image | ||
40 | end | 40 | end |
41 | 41 | ||
42 | should 'have many inputs through products' do | 42 | should 'have many inputs through products' do |