Skip to content

Commit

Permalink
Adding core has_many test and adding self_grouping missing lib.
Browse files Browse the repository at this point in the history
  • Loading branch information
metaskills committed Sep 20, 2008
1 parent cbe87af commit 3d06ed3
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/grouped_scope.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require 'grouped_scope/errors'
require 'grouped_scope/proxy'
require 'grouped_scope/grouping'
require 'grouped_scope/self_grouping'
require 'grouped_scope/group'
require 'grouped_scope/class_methods'
require 'grouped_scope/instance_methods'
Expand Down
File renamed without changes.
33 changes: 33 additions & 0 deletions test/grouped_scope/has_many_association_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
require File.dirname(__FILE__) + '/../helper'

class HasManyAssociationTest < GroupedScope::TestCase

def setup
setup_environment
end

context 'For existing ungrouped has_many associations' do

setup do
@con = ActiveRecord::Base.connection
end

should 'be able to call it' do
@employee = Factory(:employee)
assert_instance_of Array, @employee.reports
end

# should 'description' do
# @employee = Factory(:employee)
# assert_instance_of Array, e.reports
# # assert_sql(/\(#{@con.quote_table_name('employees')}.#{@con.quote_column_name('id')} = dddd/) do
# #
# # end
# end


end



end

0 comments on commit 3d06ed3

Please sign in to comment.