diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-04-08 16:27:33 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-04-08 16:27:33 -0700 |
commit | 8fc2241df61ce274b652fae09e4640a50a500af7 (patch) | |
tree | bac91d5ee8545238deaf2881a7fdaca3a4b6a837 /test | |
parent | 55c0071ce3685a78b4f039be24b2ab40b8779467 (diff) | |
download | rails-8fc2241df61ce274b652fae09e4640a50a500af7.tar.gz rails-8fc2241df61ce274b652fae09e4640a50a500af7.tar.bz2 rails-8fc2241df61ce274b652fae09e4640a50a500af7.zip |
removing unused join_sql method
Diffstat (limited to 'test')
-rw-r--r-- | test/test_select_manager.rb | 17 | ||||
-rw-r--r-- | test/visitors/test_join_sql.rb | 68 |
2 files changed, 5 insertions, 80 deletions
diff --git a/test/test_select_manager.rb b/test/test_select_manager.rb index 6258705e2f..6c7098b3d9 100644 --- a/test/test_select_manager.rb +++ b/test/test_select_manager.rb @@ -584,9 +584,8 @@ module Arel aliaz = table.alias manager = Arel::SelectManager.new Table.engine manager.from Nodes::InnerJoin.new(aliaz, table[:id].eq(aliaz[:id])) - manager.join_sql.must_be_like %{ - INNER JOIN "users" "users_2" "users"."id" = "users_2"."id" - } + assert_match 'INNER JOIN "users" "users_2" "users"."id" = "users_2"."id"', + manager.to_sql end it 'returns outer join sql' do @@ -594,9 +593,8 @@ module Arel aliaz = table.alias manager = Arel::SelectManager.new Table.engine manager.from Nodes::OuterJoin.new(aliaz, table[:id].eq(aliaz[:id])) - manager.join_sql.must_be_like %{ - LEFT OUTER JOIN "users" "users_2" "users"."id" = "users_2"."id" - } + assert_match 'LEFT OUTER JOIN "users" "users_2" "users"."id" = "users_2"."id"', + manager.to_sql end it 'can have a non-table alias as relation name' do @@ -619,12 +617,7 @@ module Arel it 'returns string join sql' do manager = Arel::SelectManager.new Table.engine manager.from Nodes::StringJoin.new(Nodes.build_quoted('hello')) - manager.join_sql.must_be_like %{ 'hello' } - end - - it 'returns nil join sql' do - manager = Arel::SelectManager.new Table.engine - manager.join_sql.must_be_nil + assert_match "'hello'", manager.to_sql end end diff --git a/test/visitors/test_join_sql.rb b/test/visitors/test_join_sql.rb deleted file mode 100644 index 34378dafe7..0000000000 --- a/test/visitors/test_join_sql.rb +++ /dev/null @@ -1,68 +0,0 @@ -require 'helper' - -module Arel - module Visitors - describe 'the join_sql visitor' do - before do - @visitor = ToSql.new Table.engine.connection - @visitor.extend(JoinSql) - end - - it 'should visit string join' do - sql = @visitor.accept Nodes::StringJoin.new(Nodes.build_quoted('omg')) - sql.must_be_like "'omg'" - end - - describe 'inner join' do - it 'should visit left if left is a join' do - t = Table.new :users - sm = t.select_manager - sm.join(t).on(t[:id]).join(t).on(t[:id]) - sm.join_sql.must_be_like %{ - INNER JOIN "users" ON "users"."id" - INNER JOIN "users" ON "users"."id" - } - end - end - - describe 'FULL outer join' do - it 'should visit left if left is a join' do - t = Table.new :users - sm = t.select_manager - sm.join(t, Nodes::FullOuterJoin).on(t[:id]).join( - t, Nodes::FullOuterJoin).on(t[:id]) - sm.join_sql.must_be_like %{ - FULL OUTER JOIN "users" ON "users"."id" - FULL OUTER JOIN "users" ON "users"."id" - } - end - end - - describe 'outer join' do - it 'should visit left if left is a join' do - t = Table.new :users - sm = t.select_manager - sm.join(t, Nodes::OuterJoin).on(t[:id]).join( - t, Nodes::OuterJoin).on(t[:id]) - sm.join_sql.must_be_like %{ - LEFT OUTER JOIN "users" ON "users"."id" - LEFT OUTER JOIN "users" ON "users"."id" - } - end - end - - describe 'right outer join' do - it 'should visit left if left is a join' do - t = Table.new :users - sm = t.select_manager - sm.join(t, Nodes::RightOuterJoin).on(t[:id]).join( - t, Nodes::RightOuterJoin).on(t[:id]) - sm.join_sql.must_be_like %{ - RIGHT OUTER JOIN "users" ON "users"."id" - RIGHT OUTER JOIN "users" ON "users"."id" - } - end - end - end - end -end |