From c6e22675410ab4fc7bf5ccafa6dc08fafcbf161c Mon Sep 17 00:00:00 2001 From: JoenioCosta Date: Tue, 8 Apr 2008 19:39:29 +0000 Subject: [PATCH] ActionItem266: added catalog functional tests --- test/functional/catalog_controller_test.rb | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/test/functional/catalog_controller_test.rb b/test/functional/catalog_controller_test.rb index 27e0c4c..e9a8ed8 100644 --- a/test/functional/catalog_controller_test.rb +++ b/test/functional/catalog_controller_test.rb @@ -11,8 +11,17 @@ class CatalogControllerTest < Test::Unit::TestCase @response = ActionController::TestResponse.new end - # Replace this with your real tests. - def test_truth - assert true + should 'list products of enterprise' do + ent = Enterprise.create!(:identifier => 'test_enterprise1', :name => 'Test enteprise1') + get :index, :profile => ent.identifier + assert_tag :tag => 'h2', :content => /Catalog/ end + + should 'show product of enterprise' do + ent = Enterprise.create!(:identifier => 'test_enterprise1', :name => 'Test enteprise1') + prod = ent.products.create!(:name => 'Product test') + get :show, :id => prod.id, :profile => ent.identifier + assert_tag :tag => 'h2', :content => /#{prod.name}/ + end + end -- libgit2 0.21.2