aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/test_factory_methods.rb27
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