Skip to content
This repository has been archived by the owner on Nov 12, 2019. It is now read-only.

Commit

Permalink
Niceify new left outer join test from PR #21
Browse files Browse the repository at this point in the history
  • Loading branch information
jonatack committed Apr 10, 2016
1 parent c308062 commit cb81e44
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions spec/polyamorous/join_dependency_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,16 @@ module Polyamorous
specify { expect(subject.send(method, join_associations)[1].table_name)
.to eq 'comments' }
end

if ActiveRecord::VERSION::MAJOR >= 5
context '#left_outer_joins in Rails 5 overrides join type specified' do
subject { new_join_dependency Person, new_join(:articles) }
specify {
expect(subject.join_constraints([], Arel::Nodes::OuterJoin).first.joins.map(&:class))
.to eq [Arel::Nodes::OuterJoin] }
end

context '#left_outer_join in Rails 5 overrides join type specified',
if: ActiveRecord::VERSION::MAJOR >= 5 do

let(:join_type_class) {
new_join_dependency(Person, new_join(:articles))
.join_constraints([], Arel::Nodes::OuterJoin).first.joins.map(&:class)
}

specify { expect(join_type_class).to eq [Arel::Nodes::OuterJoin] }
end
end
end

0 comments on commit cb81e44

Please sign in to comment.