Commit 8f464d5c285b239b7111cb6da0cb5b29aa48dfad

Authored by JoenioCosta
1 parent 8838cfb0

ActionItem328: s/consumed products/raw materials/g


git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1889 3f533792-8f58-4932-b0fe-aaf55b0a4547
app/views/manage_products/index.rhtml
... ... @@ -20,11 +20,11 @@
20 20  
21 21 <p> <%= link_to _('New product or service'), :action => 'new' %> </p>
22 22  
23   -<h3> <%=_('Listing consumed products') %> </h3>
  23 +<h3> <%=_('Listing raw materials') %> </h3>
24 24  
25 25 <table>
26 26 <tr>
27   - <th><%= _('Consumed product') %></th>
  27 + <th><%= _('Raw material') %></th>
28 28 <th><%= _('Actions') %></th>
29 29 </tr>
30 30 <% @consumptions.each do |consumption| %>
... ... @@ -36,12 +36,12 @@
36 36 </td>
37 37 <td>
38 38 <%= button :edit, _('Edit'), :action => 'edit_consumption', :id => consumption %>
39   - <%= button :delete, _('Remove'), { :action => 'destroy_consumption', :id => consumption }, :confirm => _('Are you sure, you want to remove this product from your list') %>
  39 + <%= button :delete, _('Remove'), { :action => 'destroy_consumption', :id => consumption }, :confirm => _('Are you sure, you want to remove this raw material from your list') %>
40 40 </td>
41 41 </tr>
42 42 <% end %>
43 43 </table>
44 44  
45   -<p> <%= link_to _('Add cunsumed product'), :action => 'new_consumption' %> </p>
  45 +<p> <%= link_to _('Add raw material'), :action => 'new_consumption' %> </p>
46 46  
47 47 <%= link_to_myprofile(_('Back'), {}, @profile.identifier) %>
... ...
app/views/manage_products/new_consumption.rhtml
1   -<h2><%= _('Add consumed product') %></h2>
  1 +<h2><%= _('Add raw material') %></h2>
2 2  
3 3 <%= render :partial => 'form_consumption', :locals => {:action => 'new_consumption'} %>
... ...
test/functional/manage_products_controller_test.rb
... ... @@ -200,7 +200,7 @@ class ManageProductsControllerTest &lt; Test::Unit::TestCase
200 200  
201 201 should 'display new consumption form' do
202 202 get :new_consumption, :profile => @enterprise.identifier
203   - assert_tag :tag => 'h2', :content => 'Add consumed product'
  203 + assert_tag :tag => 'h2', :content => 'Add raw material'
204 204 end
205 205  
206 206 should 'create consumption product' do
... ... @@ -246,4 +246,11 @@ class ManageProductsControllerTest &lt; Test::Unit::TestCase
246 246 assert_equal 'new extra info', @enterprise.consumptions.find(product.reload.id).aditional_specifications
247 247 end
248 248  
  249 + should 'not show product_category field on edit consumption form' do
  250 + product_category = ProductCategory.create!(:name => 'Food', :environment => Environment.default)
  251 + product = @enterprise.consumptions.create!(:product_category_id => product_category.id, :aditional_specifications => 'extra info')
  252 + get :edit_consumption, :profile => @enterprise.identifier, :id => product
  253 + assert_no_tag :tag => 'select', :attributes => { :name => 'consumption[product_category_id]' }
  254 + end
  255 +
249 256 end
... ...