Skip to content

Commit

Permalink
test for #4917
Browse files Browse the repository at this point in the history
Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information
Neeraj Singh authored and josevalim committed Jun 22, 2010
1 parent ec37452 commit 7033be5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions activerecord/test/cases/relations_test.rb
Expand Up @@ -16,6 +16,13 @@ class RelationTest < ActiveRecord::TestCase
fixtures :authors, :topics, :entrants, :developers, :companies, :developers_projects, :accounts, :categories, :categorizations, :posts, :comments,
:taggings

def test_apply_relation_as_where_id
posts = Post.arel_table
post_authors = posts.where(posts[:author_id].eq(1)).project(posts[:id])
assert_equal 5, post_authors.to_a.size
assert_equal 5, Post.where(:id => post_authors).size
end

def test_scoped
topics = Topic.scoped
assert_kind_of ActiveRecord::Relation, topics
Expand Down

0 comments on commit 7033be5

Please sign in to comment.