aboutsummaryrefslogblamecommitdiffstats
path: root/activerecord/test/cases/associations/association_scope_test.rb
blob: d38648202e7e46d9d9b463da03173d6b34cd361d (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15














                                                                                        
require 'cases/helper'
require 'models/post'
require 'models/author'

module ActiveRecord
  module Associations
    class AssociationScopeTest < ActiveRecord::TestCase
      test 'does not duplicate conditions' do
        association_scope = AssociationScope.new(Author.new.association(:welcome_posts))
        wheres = association_scope.scope.where_values.map(&:right)
        assert_equal wheres.uniq, wheres
      end
    end
  end
end