adapted filter specs to newly introduced changes

git-svn-id: https://dev.finn.de/svn/cockpit/branches/reporting_merge@1304 7926756e-e54e-46e6-9721-ed318f58905e
pull/6827/head
p.tessenow 15 years ago
parent 8960d6b22b
commit efa2d8415a
  1. 22
      spec/models/cost_query/filter_spec.rb

@ -156,7 +156,7 @@ describe CostQuery do
CostQuery::Filter::TrackerId
].each do |filter|
it "should only allow default operators for #{filter}" do
filter.new.available_operators.uniq.sort.should == filter.default_operators.uniq.sort
filter.new.available_operators.uniq.sort.should == CostQuery::Operator.default_operators.uniq.sort
end
end
@ -167,28 +167,22 @@ describe CostQuery do
CostQuery::Filter::FixedVersionId
].each do |filter|
it "should only allow default+null operators for #{filter}" do
filter.new.available_operators.uniq.sort.should == (filter.default_operators + filter.null_operators).sort
filter.new.available_operators.uniq.sort.should == (CostQuery::Operator.default_operators + CostQuery::Operator.null_operators).sort
end
end
#filter for time
#filter for time/date
[
CostQuery::Filter::CreatedOn,
CostQuery::Filter::UpdatedOn,
CostQuery::Filter::SpentOn
].each do |filter|
it "should only allow time operators for #{filter}" do
filter.new.available_operators.uniq.sort.should == (filter.default_operators + filter.time_operators).sort
end
end
#filter for date
[
CostQuery::Filter::SpentOn,
CostQuery::Filter::StartDate,
CostQuery::Filter::DueDate
].each do |filter|
it "should only allow date operators for #{filter}" do
filter.new.available_operators.uniq.sort.should == (filter.default_operators + filter.date_operators).sort
it "should only allow time operators for #{filter}" do
filter.new.available_operators.uniq.sort.should == (CostQuery::Operator.default_operators +
CostQuery::Operator.time_operators +
CostQuery::Operator.date_operators).sort
end
end
end

Loading…
Cancel
Save