From d24ab0ea5d55867064d0ab01458daa6225595fd4 Mon Sep 17 00:00:00 2001 From: rkh Date: Wed, 13 Oct 2010 14:57:30 +0000 Subject: [PATCH] Make specs pass on postgres. git-svn-id: https://dev.finn.de/svn/cockpit/branches/reporting_merge@1906 7926756e-e54e-46e6-9721-ed318f58905e --- spec/models/cost_query/result_spec.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spec/models/cost_query/result_spec.rb b/spec/models/cost_query/result_spec.rb index 93aa8a4b1e..952afe2b70 100644 --- a/spec/models/cost_query/result_spec.rb +++ b/spec/models/cost_query/result_spec.rb @@ -1,6 +1,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper') describe CostQuery do + before { User.current = users(:admin) } minimal_query fixtures :users @@ -108,7 +109,7 @@ describe CostQuery do it "should compute real_costs for DirectResults" do 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 first = type.all.first result.real_costs.should == (first.overridden_costs || first.costs)