aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_factory_methods.rb
blob: 89b10236d14162caa4b7c087ac1dbe2d8ae11a59 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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