Make specs pass on postgres.

git-svn-id: https://dev.finn.de/svn/cockpit/branches/reporting_merge@1906 7926756e-e54e-46e6-9721-ed318f58905e
pull/6827/head
rkh 14 years ago
parent 15f7171b45
commit d24ab0ea5d
  1. 3
      spec/models/cost_query/result_spec.rb

@ -1,6 +1,7 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper') require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
describe CostQuery do describe CostQuery do
before { User.current = users(:admin) }
minimal_query minimal_query
fixtures :users fixtures :users
@ -108,7 +109,7 @@ describe CostQuery do
it "should compute real_costs for DirectResults" do it "should compute real_costs for DirectResults" do
id_sorted = @query.result.values.sort_by { |r| r[:id] } id_sorted = @query.result.values.sort_by { |r| r[:id] }
[TimeEntry, CostEntry].each do |type| [CostEntry].each do |type|
result = id_sorted.select { |r| r[:type]==type.to_s }.first result = id_sorted.select { |r| r[:type]==type.to_s }.first
first = type.all.first first = type.all.first
result.real_costs.should == (first.overridden_costs || first.costs) result.real_costs.should == (first.overridden_costs || first.costs)

Loading…
Cancel
Save