Commit 654ec0967b7af7f5f15475dfec6d11bf0ee5bb37
1 parent
897249db
Exists in
staging
and in
42 other branches
Removed tests related to ProductCategorization
Showing
1 changed file
with
0 additions
and
35 deletions
Show diff stats
test/unit/product_test.rb
| @@ -139,41 +139,6 @@ class ProductTest < ActiveSupport::TestCase | @@ -139,41 +139,6 @@ class ProductTest < ActiveSupport::TestCase | ||
| 139 | assert_equal({:controller => 'manage_products', :action => 'show', :id => 999}, product.url) | 139 | assert_equal({:controller => 'manage_products', :action => 'show', :id => 999}, product.url) |
| 140 | end | 140 | end |
| 141 | 141 | ||
| 142 | - should 'categorize also with product categorization' do | ||
| 143 | - cat = fast_create(ProductCategory, :name => 'test cat', :environment_id => Environment.default.id) | ||
| 144 | - ent = fast_create(Enterprise, :name => 'test ent', :identifier => 'test_ent') | ||
| 145 | - p = ent.products.new(:name => 'test product') | ||
| 146 | - p.product_category = cat | ||
| 147 | - p.save! | ||
| 148 | - | ||
| 149 | - assert ProductCategorization.find(:first, :conditions => {:product_id => p, :category_id => cat}) | ||
| 150 | - end | ||
| 151 | - | ||
| 152 | - should 'categorize parent cateogries with product categorization' do | ||
| 153 | - parent_cat = fast_create(ProductCategory, :name => 'test cat', :environment_id => Environment.default.id) | ||
| 154 | - child_cat = fast_create(ProductCategory, :name => 'test cat', :environment_id => Environment.default.id, :parent_id => parent_cat.id) | ||
| 155 | - ent = fast_create(Enterprise, :name => 'test ent', :identifier => 'test_ent') | ||
| 156 | - p = ent.products.new(:name => 'test product') | ||
| 157 | - p.product_category = child_cat | ||
| 158 | - p.save! | ||
| 159 | - | ||
| 160 | - assert ProductCategorization.find(:first, :conditions => {:product_id => p, :category_id => parent_cat}) | ||
| 161 | - assert ProductCategorization.find(:first, :conditions => {:product_id => p, :category_id => child_cat}) | ||
| 162 | - end | ||
| 163 | - | ||
| 164 | - should 'change product categorization when product category changes' do | ||
| 165 | - cat1 = fast_create(ProductCategory, :name => 'test cat 1', :environment_id => Environment.default.id) | ||
| 166 | - cat2 = fast_create(ProductCategory, :name => 'test cat 2', :environment_id => Environment.default.id) | ||
| 167 | - ent = fast_create(Enterprise, :name => 'test ent', :identifier => 'test_ent') | ||
| 168 | - p = ent.products.create!(:name => 'test product', :product_category => cat1) | ||
| 169 | - | ||
| 170 | - p.product_category = cat2 | ||
| 171 | - p.save! | ||
| 172 | - | ||
| 173 | - assert ProductCategorization.find(:first, :conditions => {:product_id => p, :category_id => cat2}), 'must include the new category' | ||
| 174 | - assert !ProductCategorization.find(:first, :conditions => {:product_id => p, :category_id => cat1}), 'must exclude the old category' | ||
| 175 | - end | ||
| 176 | - | ||
| 177 | should 'respond to public? as its enterprise public?' do | 142 | should 'respond to public? as its enterprise public?' do |
| 178 | e1 = fast_create(Enterprise, :name => 'test ent 1', :identifier => 'test_ent1') | 143 | e1 = fast_create(Enterprise, :name => 'test ent 1', :identifier => 'test_ent1') |
| 179 | p1 = fast_create(Product, :name => 'test product 1', :enterprise_id => e1.id, :product_category_id => @product_category.id) | 144 | p1 = fast_create(Product, :name => 'test product 1', :enterprise_id => e1.id, :product_category_id => @product_category.id) |