Sha256: c64a28b1c3f860db8598f98629b72f54548024684d270327c8148d7a5efb6e73

Contents?: true

Size: 446 Bytes

Versions: 2

Compression:

Stored size: 446 Bytes

Contents

RSpec.describe ROM::Relation, '#left_join' do
  subject(:relation) { container.relations.users }

  include_context 'users and tasks'

  with_adapters do
    it 'joins relations using left outer join' do
      result = relation.left_join(:tasks, user_id: :id).select(:name, :title)

      expect(result.to_a).to match_array([
        { name: 'Joe', title: "Joe's task" },
        { name: 'Jane', title: "Jane's task" }
      ])
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rom-sql-0.9.1 spec/unit/relation/left_join_spec.rb
rom-sql-0.9.0 spec/unit/relation/left_join_spec.rb