Skip to content

Commit

Permalink
+ added test case for sql server issue with exists? and missing alias…
Browse files Browse the repository at this point in the history
… clause (commit 0eae392)
  • Loading branch information
iaddict committed Aug 17, 2011
1 parent b7fd7e8 commit 453a8c2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions activerecord/test/cases/log_subscriber_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,13 @@ def test_exists_query_logging
assert_match(/SELECT .*?FROM .?developers.?/i, @logger.logged(:debug).last)
end

def test_exists_query_alias
Developer.exists? 1
wait
assert_equal 1, @logger.logged(:debug).size
assert_match(/SELECT .*?1 AS _one.*? FROM .?developers.?/i, @logger.logged(:debug).last)
end

def test_cached_queries
ActiveRecord::Base.cache do
Developer.all
Expand Down

0 comments on commit 453a8c2

Please sign in to comment.