diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-12-13 22:16:29 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-12-13 22:16:29 -0800 |
commit | f694d9e7c332cf4d9bce6742b440bf97308cefb5 (patch) | |
tree | 46731a9debf580e31a9f22dd7554467ab4a92ca9 | |
parent | 1c77cf2cc4d00097a52edf7ae6fa0de519273cc0 (diff) | |
download | rails-f694d9e7c332cf4d9bce6742b440bf97308cefb5.tar.gz rails-f694d9e7c332cf4d9bce6742b440bf97308cefb5.tar.bz2 rails-f694d9e7c332cf4d9bce6742b440bf97308cefb5.zip |
adding tests for factory methods
-rw-r--r-- | test/test_factory_methods.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/test_factory_methods.rb b/test/test_factory_methods.rb new file mode 100644 index 0000000000..89b10236d1 --- /dev/null +++ b/test/test_factory_methods.rb @@ -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 |