Commit c6e22675410ab4fc7bf5ccafa6dc08fafcbf161c
1 parent
39a4ebdb
Exists in
master
and in
29 other branches
ActionItem266: added catalog functional tests
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1645 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
1 changed file
with
12 additions
and
3 deletions
Show diff stats
test/functional/catalog_controller_test.rb
@@ -11,8 +11,17 @@ class CatalogControllerTest < Test::Unit::TestCase | @@ -11,8 +11,17 @@ class CatalogControllerTest < Test::Unit::TestCase | ||
11 | @response = ActionController::TestResponse.new | 11 | @response = ActionController::TestResponse.new |
12 | end | 12 | end |
13 | 13 | ||
14 | - # Replace this with your real tests. | ||
15 | - def test_truth | ||
16 | - assert true | 14 | + should 'list products of enterprise' do |
15 | + ent = Enterprise.create!(:identifier => 'test_enterprise1', :name => 'Test enteprise1') | ||
16 | + get :index, :profile => ent.identifier | ||
17 | + assert_tag :tag => 'h2', :content => /Catalog/ | ||
17 | end | 18 | end |
19 | + | ||
20 | + should 'show product of enterprise' do | ||
21 | + ent = Enterprise.create!(:identifier => 'test_enterprise1', :name => 'Test enteprise1') | ||
22 | + prod = ent.products.create!(:name => 'Product test') | ||
23 | + get :show, :id => prod.id, :profile => ent.identifier | ||
24 | + assert_tag :tag => 'h2', :content => /#{prod.name}/ | ||
25 | + end | ||
26 | + | ||
18 | end | 27 | end |