spec/lib/amoeba_spec.rb in amoeba-1.2.0 vs spec/lib/amoeba_spec.rb in amoeba-1.2.1
- old
+ new
@@ -31,10 +31,11 @@
start_posttag_count = rs["tag_count"]
rs = ActiveRecord::Base.connection.select_one('SELECT COUNT(*) AS note_count FROM notes_posts')
start_postnote_count = rs["note_count"]
new_post.save
+ new_post.errors.messages.length.should == 0
end_account_count = Account.all.count
end_history_count = History.all.count
end_cat_count = Category.all.count
end_supercat_count = Supercat.all.count
@@ -81,10 +82,16 @@
new_post.widgets.map(&:id).each do |id|
old_post.widgets.map(&:id).include?(id).should_not be true
end
# }}}
+ # Author {{{
+ old_author = Author.find(1)
+ new_author = old_author.dup
+ new_author.save
+ new_author.errors.messages.length.should == 0
+ # }}}
# Products {{{
# Base Class {{{
old_product = Product.find(1)
start_image_count = Image.where(:product_id => old_product.id).count
@@ -92,10 +99,11 @@
rs = ActiveRecord::Base.connection.select_one('SELECT COUNT(*) AS section_count FROM products_sections WHERE product_id = ?', old_product.id)
start_prodsection_count = rs["section_count"]
new_product = old_product.dup
new_product.save
+ new_product.errors.messages.length.should == 0
end_image_count = Image.where(:product_id => old_product.id).count
end_newimage_count = Image.where(:product_id => new_product.id).count
end_section_count = Section.all.length
rs = ActiveRecord::Base.connection.select_one('SELECT COUNT(*) AS section_count FROM products_sections WHERE product_id = ?', 1)
@@ -119,10 +127,11 @@
rs = ActiveRecord::Base.connection.select_one('SELECT COUNT(*) AS section_count FROM products_sections WHERE product_id = ?', old_product.id)
start_prodsection_count = rs["section_count"]
new_product = old_product.dup
new_product.save
+ new_product.errors.messages.length.should == 0
end_image_count = Image.where(:product_id => old_product.id).count
end_newimage_count = Image.where(:product_id => new_product.id).count
end_section_count = Section.all.length
rs = ActiveRecord::Base.connection.select_one('SELECT COUNT(*) AS section_count FROM products_sections WHERE product_id = ?', 1)
@@ -145,9 +154,10 @@
rs = ActiveRecord::Base.connection.select_one('SELECT COUNT(*) AS section_count FROM products_sections WHERE product_id = ?', old_product.id)
start_prodsection_count = rs["section_count"]
new_product = old_product.dup
new_product.save
+ new_product.errors.messages.length.should == 0
end_image_count = Image.where(:product_id => old_product.id).count
end_newimage_count = Image.where(:product_id => new_product.id).count
end_section_count = Section.all.length
rs = ActiveRecord::Base.connection.select_one('SELECT COUNT(*) AS section_count FROM products_sections WHERE product_id = ?', 1)