Commit f7a3545b7d3cca4ac807ada1532c1cc1c86d8f03
1 parent
d3b485b8
Exists in
master
and in
29 other branches
Fix for EnterpriseTest - reindex products when save
Showing
1 changed file
with
4 additions
and
3 deletions
Show diff stats
test/unit/enterprise_test.rb
... | ... | @@ -423,9 +423,10 @@ class EnterpriseTest < ActiveSupport::TestCase |
423 | 423 | end |
424 | 424 | |
425 | 425 | should 'reindex when products are changed' do |
426 | - a = Enterprise.new | |
427 | - a.expects(:solr_save) | |
428 | - a.product_updated | |
426 | + enterprise = fast_create(Enterprise) | |
427 | + product = fast_create(Product, :enterprise_id => enterprise.id, :product_category_id => @product_category.id) | |
428 | + Product.expects(:solr_batch_add_association).with(product, :enterprise) | |
429 | + product.update_attribute :name, "novo nome" | |
429 | 430 | end |
430 | 431 | |
431 | 432 | should "the followed_by? be true only to members" do | ... | ... |