diff --git a/test/functional/catalog_controller_test.rb b/test/functional/catalog_controller_test.rb index 770d669..fe65d67 100644 --- a/test/functional/catalog_controller_test.rb +++ b/test/functional/catalog_controller_test.rb @@ -235,4 +235,18 @@ class CatalogControllerTest < ActionController::TestCase assert_equal [pc2, pc1, pc4, pc3], assigns(:categories) end + should 'use price_detail name instead of production_cost name straight' do + p1 = fast_create(Product, :product_category_id => @product_category.id, :enterprise_id => @enterprise.id) + p2 = fast_create(Product, :product_category_id => @product_category.id, :enterprise_id => @enterprise.id) + Product.any_instance.stubs(:price_described?).returns(true) + production_cost = fast_create(ProductionCost) + pd1 = PriceDetail.create!(:product => p1, :production_cost => production_cost) + pd2 = PriceDetail.create!(:product => p2) + + get :index, :profile => @enterprise.identifier + + assert_tag :tag => 'div', :attributes => {:class => 'search-product-input-name'}, :content => production_cost.name + assert_tag :tag => 'div', :attributes => {:class => 'search-product-input-name'}, :content => 'Other costs' + end + end -- libgit2 0.21.2