mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
adding tests for factory methods
This commit is contained in:
parent
1c77cf2cc4
commit
f694d9e7c3
1 changed files with 27 additions and 0 deletions
27
test/test_factory_methods.rb
Normal file
27
test/test_factory_methods.rb
Normal file
|
@ -0,0 +1,27 @@
|
|||
require 'helper'
|
||||
|
||||
module Arel
|
||||
module FactoryMethods
|
||||
class TestFactoryMethods < MiniTest::Unit::TestCase
|
||||
class Factory
|
||||
include Arel::FactoryMethods
|
||||
end
|
||||
|
||||
def setup
|
||||
@factory = Factory.new
|
||||
end
|
||||
|
||||
def test_create_join
|
||||
join = @factory.create_join :one, :two, :three
|
||||
assert_kind_of Nodes::Join, join
|
||||
assert_equal :three, join.constraint
|
||||
end
|
||||
|
||||
def test_create_on
|
||||
on = @factory.create_on :one
|
||||
assert_instance_of Nodes::On, on
|
||||
assert_equal :one, on.expr
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue