diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-02-17 13:42:42 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-02-17 13:42:42 -0800 |
commit | 23ce2f61b5a7699af8213bf1b5d581da194ab8f4 (patch) | |
tree | b2adcb398f6b5171e15fd681fd23d5c94ca1cdcf /activerecord/test/cases/relations_test.rb | |
parent | fe42effb11a97cf19777d7b0dba7e1e2dfd3316c (diff) | |
parent | c18e7ab44706735d9b1274760bdc62ad5bef7757 (diff) | |
download | rails-23ce2f61b5a7699af8213bf1b5d581da194ab8f4.tar.gz rails-23ce2f61b5a7699af8213bf1b5d581da194ab8f4.tar.bz2 rails-23ce2f61b5a7699af8213bf1b5d581da194ab8f4.zip |
Merge branch 'master' into adequaterecord
* master:
Revert "Merge pull request #13344 from ccutrer/fix-from-default-select"
No need to use symbols
Don't skip tests if they are not broken. Just don't define they
Fix typo [ci skip]
Resolve encoding issues with arrays of hstore (bug 11135).
Fix coffeescript sample [ci skip]
Diffstat (limited to 'activerecord/test/cases/relations_test.rb')
-rw-r--r-- | activerecord/test/cases/relations_test.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/activerecord/test/cases/relations_test.rb b/activerecord/test/cases/relations_test.rb index f45b578c0f..21d05e4ac0 100644 --- a/activerecord/test/cases/relations_test.rb +++ b/activerecord/test/cases/relations_test.rb @@ -151,11 +151,14 @@ class RelationTest < ActiveRecord::TestCase assert_equal relation.to_a, Comment.select('a.*').from(relation, :a).to_a end - def test_finding_with_subquery_without_select - relation = Topic.where(:approved => true) - assert_equal relation.to_a, Topic.from(relation).to_a + def test_finding_with_subquery_without_select_does_not_change_the_select + relation = Topic.where(approved: true) + assert_raises(ActiveRecord::StatementInvalid) do + Topic.from(relation).to_a + end end + def test_finding_with_conditions assert_equal ["David"], Author.where(:name => 'David').map(&:name) assert_equal ['Mary'], Author.where(["name = ?", 'Mary']).map(&:name) |