Commit 0814a5ef8b3264203b9dfc5b0d24a977988b649a
1 parent
31fdbc17
Exists in
master
and in
29 other branches
ActionItem28: added some links to manage products and fixed some tests
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@945 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
6 changed files
with
9 additions
and
6 deletions
Show diff stats
app/controllers/my_profile/profile_editor_controller.rb
app/models/product.rb
app/views/manage_products/show.rhtml
... | ... | @@ -2,7 +2,7 @@ |
2 | 2 | |
3 | 3 | <p> <%= _('Price: ') %> <%= @product.price %> </p> |
4 | 4 | <p> <%= _('Description: ') %> <%= @product.description %> </p> |
5 | - | |
5 | +<p> <%= _('Category: ') %> <%= @product.product_category ? @product.product_category.name : _('Uncategorized product') %> </p> | |
6 | 6 | |
7 | 7 | <%= link_to _('edit'), :action => 'edit', :id => @product %> |
8 | 8 | <%= link_to _('destroy'), :action => 'destroy', :id => @product %> | ... | ... |
app/views/profile_editor/index.rhtml
... | ... | @@ -12,6 +12,8 @@ |
12 | 12 | <%= file_manager_button(_('Manage Content'), 'icons-app/cms.png', :controller => 'cms') %> |
13 | 13 | |
14 | 14 | <%= file_manager_button(_('Change Password'), 'icons-app/change-password.png', :controller => 'account', :action => 'change_password') %> |
15 | + | |
16 | + <%= file_manager_button(_('Manage Products'), 'icons-app/products.png', :controller => 'manage_products') if @profile.kind_of?(Enterprise) %> | |
15 | 17 | |
16 | 18 | <% end %> |
17 | 19 | ... | ... |
test/functional/role_controller_test.rb
test/unit/product_test.rb
... | ... | @@ -4,22 +4,22 @@ class ProductTest < Test::Unit::TestCase |
4 | 4 | |
5 | 5 | should 'create product' do |
6 | 6 | assert_difference Product, :count do |
7 | - p = Product.new(:name => 'test product') | |
7 | + p = Product.new(:name => 'test product1') | |
8 | 8 | assert p.save |
9 | 9 | end |
10 | 10 | end |
11 | 11 | |
12 | 12 | should 'destroy product' do |
13 | - p = Product.create(:name => 'test product') | |
13 | + p = Product.create(:name => 'test product2') | |
14 | 14 | assert_difference Product, :count, -1 do |
15 | 15 | p.destroy |
16 | 16 | end |
17 | 17 | end |
18 | 18 | |
19 | 19 | should 'name be unique' do |
20 | - Product.create(:name => 'test product') | |
20 | + Product.create(:name => 'test product3') | |
21 | 21 | assert_no_difference Product, :count do |
22 | - p = Product.new(:name => 'test product') | |
22 | + p = Product.new(:name => 'test product3') | |
23 | 23 | assert !p.save |
24 | 24 | end |
25 | 25 | end | ... | ... |