Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix some test failures due to MySQL assumptions. Closes #3149.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3254 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit dc106b932cf7674151ec0162715407f5b2ec92f2 1 parent 57838bd
@jeremy jeremy authored
View
14 activerecord/test/associations_go_eager_test.rb
@@ -222,17 +222,23 @@ def test_preconfigured_includes_with_has_one
def test_preconfigured_includes_with_has_many
posts = authors(:david).posts_with_comments
- assert_equal 2, posts.first.comments.size
+ one = posts.detect { |p| p.id == 1 }
+ assert_equal 5, posts.size
+ assert_equal 2, one.comments.size
end
def test_preconfigured_includes_with_habtm
posts = authors(:david).posts_with_categories
- assert_equal 2, posts.first.categories.size
+ one = posts.detect { |p| p.id == 1 }
+ assert_equal 5, posts.size
+ assert_equal 2, one.categories.size
end
def test_preconfigured_includes_with_has_many_and_habtm
posts = authors(:david).posts_with_comments_and_categories
- assert_equal 2, posts.first.comments.size
- assert_equal 2, posts.first.categories.size
+ one = posts.detect { |p| p.id == 1 }
+ assert_equal 5, posts.size
+ assert_equal 2, one.comments.size
+ assert_equal 2, one.categories.size
end
end
View
7 activerecord/test/associations_test.rb
@@ -1404,7 +1404,10 @@ def test_update_attributes_after_push_without_duplicate_join_table_rows
assert developer.save
developer.projects << project
developer.update_attribute("name", "Bruza")
- assert_equal 1, developer.connection.select_one("SELECT count(*) FROM developers_projects WHERE
- project_id = #{project.id} AND developer_id = #{developer.id}")["count(*)"].to_i
+ assert_equal 1, Developer.connection.select_value(<<-end_sql).to_i
+ SELECT count(*) FROM developers_projects
+ WHERE project_id = #{project.id}
+ AND developer_id = #{developer.id}
+ end_sql
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.