Specs for Custom Fields group by

git-svn-id: https://dev.finn.de/svn/cockpit/branches/reporting_merge@1930 7926756e-e54e-46e6-9721-ed318f58905e
pull/6827/head
rkh 14 years ago
parent ecf765cc92
commit d45e21248f
  1. 28
      spec/models/cost_query/group_by_spec.rb

@ -16,6 +16,8 @@ describe CostQuery do
fixtures :roles
fixtures :issue_categories
fixtures :versions
fixtures :custom_fields
fixtures :custom_values
describe CostQuery::GroupBy do
it "should compute group_by on projects" do
@ -200,5 +202,31 @@ describe CostQuery do
sql_sizes.sort.should == ruby_sizes.sort
sub_sql_sizes.sort.should == sub_ruby_sizes.sort
end
describe CostQuery::GroupBy::CustomField do
before do
CostQuery::GroupBy.all.merge CostQuery::GroupBy::CustomField.all
end
it "should create classes for custom fields" do
# Would raise a name error
CostQuery::GroupBy::CustomFieldSearchableField
end
it "includes custom fields classes in CustomField.all" do
CostQuery::GroupBy::CustomField.all.
should include(CostQuery::GroupBy::CustomFieldSearchableField)
end
it "includes custom fields classes in GroupBy.all" do
CostQuery::GroupBy::CustomField.all.
should include(CostQuery::GroupBy::CustomFieldSearchableField)
end
it "is usable as filter" do
@query.group_by :custom_field_searchable_field
@query.result.first.count.should == 1 # see fixtures
end
end
end
end
Loading…
Cancel
Save