Skip to content

Commit

Permalink
Change JoinPart test from an integration to a unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
Kelley Reynolds committed Jul 5, 2012
1 parent 6050d01 commit 07dad77
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
13 changes: 0 additions & 13 deletions activerecord/test/cases/associations/eager_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,6 @@ def test_eager_with_has_one_through_join_model_with_conditions_on_the_through
assert_nil member.favourite_club
end

def test_loading_with_one_association_without_primary_key
Comment.primary_key = nil
begin
assert_nothing_raised do
Post.includes(:comments).references(:comments).all
end
rescue
raise $!
ensure
Comment.primary_key = 'id'
end
end

def test_loading_with_one_association
posts = Post.find(:all, :include => :comments)
post = posts.find { |p| p.id == 1 }
Expand Down
8 changes: 8 additions & 0 deletions activerecord/test/cases/associations/join_dependency_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
require "cases/helper"
require 'models/edge'

class JoinDependencyTest < ActiveRecord::TestCase
def test_column_names_with_alias_handles_nil_primary_key
assert_equal Edge.column_names, ActiveRecord::Associations::JoinDependency::JoinBase.new(Edge).column_names_with_alias.map(&:first)
end
end

0 comments on commit 07dad77

Please sign in to comment.