mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
removing tests of deprecated methods
This commit is contained in:
parent
f694d9e7c3
commit
87c022bc98
2 changed files with 2 additions and 36 deletions
|
@ -35,10 +35,8 @@ module Arel
|
||||||
table = Table.new :users
|
table = Table.new :users
|
||||||
fc = FakeCrudder.new
|
fc = FakeCrudder.new
|
||||||
fc.from table
|
fc.from table
|
||||||
fc.insert [[table[:id], 'foo']]
|
im = fc.compile_insert [[table[:id], 'foo']]
|
||||||
fc.engine.calls.find { |method, _|
|
assert_instance_of Arel::InsertManager, im
|
||||||
method == :insert
|
|
||||||
}.wont_be_nil
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -48,12 +48,6 @@ module Arel
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'primary_key' do
|
|
||||||
it 'should return an attribute' do
|
|
||||||
@relation.primary_key.name.must_equal :id
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
describe 'select_manager' do
|
describe 'select_manager' do
|
||||||
it 'should return an empty select manager' do
|
it 'should return an empty select manager' do
|
||||||
sm = @relation.select_manager
|
sm = @relation.select_manager
|
||||||
|
@ -113,13 +107,6 @@ module Arel
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'new' do
|
describe 'new' do
|
||||||
it 'takes :columns' do
|
|
||||||
columns = Table.engine.connection.columns("users")
|
|
||||||
@relation = Table.new(:users, :columns => columns)
|
|
||||||
@relation.columns.first.name.must_equal :id
|
|
||||||
@relation.engine.must_equal Table.engine
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'should accept an engine' do
|
it 'should accept an engine' do
|
||||||
rel = Table.new :users, 'foo'
|
rel = Table.new :users, 'foo'
|
||||||
rel.engine.must_equal 'foo'
|
rel.engine.must_equal 'foo'
|
||||||
|
@ -176,14 +163,6 @@ module Arel
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'columns' do
|
|
||||||
it 'returns a list of columns' do
|
|
||||||
columns = @relation.columns
|
|
||||||
columns.length.must_equal 4
|
|
||||||
columns.map { |x| x.name.to_s }.sort.must_equal %w{ created_at bool name id }.sort
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
it "should have a name" do
|
it "should have a name" do
|
||||||
@relation.name.must_equal 'users'
|
@relation.name.must_equal 'users'
|
||||||
end
|
end
|
||||||
|
@ -201,15 +180,4 @@ module Arel
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe Table do
|
|
||||||
describe 'when checking the existence of a table' do
|
|
||||||
it 'should be present in the table cache despite the class of its name' do
|
|
||||||
[ 'users', :users ].each do |name|
|
|
||||||
relation = Table.new name
|
|
||||||
Table.table_cache(relation.engine).key?(relation.name).must_equal true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue