Commit 166605c3af95a01a41c36f417414dcd5282b9bcd

Authored by Santosh Wadghule
Committed by Andrew Kane
1 parent ce78b932

Refactoring (#143)

Showing 1 changed file with 7 additions and 1 deletions   Show diff stats
test/test_helper.rb
... ... @@ -93,6 +93,8 @@ module TestDatabase
93 93 end
94 94  
95 95 def test_table_name
  96 + # This test is to ensure there's not an error when using the table
  97 + # name as part of the column name.
96 98 assert_empty User.group_by_day("users.created_at").count
97 99 end
98 100  
... ... @@ -192,7 +194,7 @@ module TestDatabase
192 194 assert_raises(NoMethodError) { User.group_by_day(:created_at).no_such_method }
193 195 end
194 196  
195   - def test_respond_to_where
  197 + def test_respond_to_order
196 198 assert User.group_by_day(:created_at).respond_to?(:order)
197 199 end
198 200  
... ... @@ -344,6 +346,8 @@ module TestDatabase
344 346 assert_raises(ArgumentError) { User.group_by_day.first }
345 347 end
346 348  
  349 + private
  350 +
347 351 def call_method(method, field, options)
348 352 User.group_by_period(method, field, options).count
349 353 end
... ... @@ -1027,6 +1031,8 @@ module TestGroupdate
1027 1031 assert_result_date :day, "2013-05-03", "2013-05-03 02:30:00", false, day_start: 2.5
1028 1032 end
1029 1033  
  1034 + private
  1035 +
1030 1036 # helpers
1031 1037  
1032 1038 def assert_format(method, expected, format, options = {})
... ...