diff options
Diffstat (limited to 'test/unit/time_entry_query_test.rb')
-rw-r--r-- | test/unit/time_entry_query_test.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/unit/time_entry_query_test.rb b/test/unit/time_entry_query_test.rb index 599aae52c..317f037d0 100644 --- a/test/unit/time_entry_query_test.rb +++ b/test/unit/time_entry_query_test.rb @@ -27,6 +27,28 @@ class TimeEntryQueryTest < ActiveSupport::TestCase :groups_users, :enabled_modules + def test_filter_values_without_project_should_be_arrays + q = TimeEntryQuery.new + assert_nil q.project + + q.available_filters.each do |name, filter| + values = filter.values + assert (values.nil? || values.is_a?(Array)), + "#values for #{name} filter returned a #{values.class.name}" + end + end + + def test_filter_values_with_project_should_be_arrays + q = TimeEntryQuery.new(:project => Project.find(1)) + assert_not_nil q.project + + q.available_filters.each do |name, filter| + values = filter.values + assert (values.nil? || values.is_a?(Array)), + "#values for #{name} filter returned a #{values.class.name}" + end + end + def test_cross_project_activity_filter_should_propose_non_active_activities activity = TimeEntryActivity.create!(:name => 'Disabled', :active => false) assert !activity.active? |