[#4477] Show each fixed budget item in the deliverable details
This commit is contained in:
@@ -62,7 +62,16 @@
|
||||
<td class="overhead_budget_total"><%= h(format_value_field_for_contracts(deliverable.overhead_budget_total(period))) %></td>
|
||||
<td> TODO: Release 2 / TODO hrs </td>
|
||||
</tr>
|
||||
<%# TODO: Release 2, Fixed %>
|
||||
|
||||
<% deliverable.fixed_budgets.each do |fixed_budget| %>
|
||||
<tr id="fixed_budget_<%= fixed_budget.id %>">
|
||||
<td class="l fixed_title"><%= h(fixed_budget.title) %></td>
|
||||
<td class="fixed_budget_spent">0</td>
|
||||
<td class="fixed_budget_total"><%= h(format_value_field_for_contracts(fixed_budget.budget)) %></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
||||
<%# TODO: Release 2, Markup %>
|
||||
<tr>
|
||||
<td class="l">Profit</td>
|
||||
|
||||
@@ -227,6 +227,33 @@ class ContractsShowTest < ActionController::IntegrationTest
|
||||
|
||||
should "QUESTION: show the total fixed budget spent for a Deliverable"
|
||||
|
||||
should "show each fixed budget item in the details for the Deliverable" do
|
||||
@manager = User.generate!
|
||||
|
||||
@deliverable1 = FixedDeliverable.generate!(:contract => @contract, :manager => @manager)
|
||||
|
||||
@budget1 = FixedBudget.generate!(:deliverable => @deliverable1, :title => 'Item 1', :budget => '$1,000', :markup => '$100')
|
||||
@budget2 = FixedBudget.generate!(:deliverable => @deliverable1, :title => 'Item 2', :budget => '$2,000', :markup => '200%')
|
||||
|
||||
visit_contract_page(@contract)
|
||||
assert_select "table#deliverables" do
|
||||
assert_select "#deliverable_details_#{@deliverable1.id}" do
|
||||
assert_select "tr#fixed_budget_#{@budget1.id}" do
|
||||
assert_select 'td.fixed_title', :text => /#{@budget1.title}/
|
||||
assert_select 'td.fixed_budget_spent', :text => '0'
|
||||
assert_select 'td.fixed_budget_total', :text => '1,000'
|
||||
end
|
||||
|
||||
assert_select "tr#fixed_budget_#{@budget2.id}" do
|
||||
assert_select 'td.fixed_title', :text => /#{@budget2.title}/
|
||||
assert_select 'td.fixed_budget_spent', :text => '0'
|
||||
assert_select 'td.fixed_budget_total', :text => '2,000'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
should "show the current period for a Retainer" do
|
||||
today_mock = Date.new(2010,2,15)
|
||||
Date.stubs(:today).returns(today_mock)
|
||||
|
||||
Reference in New Issue
Block a user