Sha256: 75b7f62f5c9fac963004399f5c4689c07ab403b978f96770d44db149bf9e14ce

Contents?: true

Size: 362 Bytes

Versions: 12

Compression:

Stored size: 362 Bytes

Contents

RSpec.describe 'User model mapping' do
  let(:rom) { ROM.env }

  let(:users) { rom.relations[:users].map_with(:user) }

  before do
    rom.relations.users.insert(name: 'Piotr', email: 'piotr@test.com')
  end

  it 'works' do
    piotr = User.new(id: 1, name: 'Piotr', email: 'piotr@test.com')

    expect(users.by_name('Piotr').to_a).to eql([piotr])
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rom-rails-2.4.0 spec/integration/user_model_mapping_spec.rb
rom-rails-2.3.1 spec/integration/user_model_mapping_spec.rb
rom-rails-2.3.0 spec/integration/user_model_mapping_spec.rb
rom-rails-2.2.0 spec/integration/user_model_mapping_spec.rb
rom-rails-2.0.0 spec/integration/user_model_mapping_spec.rb
rom-rails-1.2.0 spec/integration/user_model_mapping_spec.rb
rom-rails-1.1.1 spec/integration/user_model_mapping_spec.rb
rom-rails-1.1.0 spec/integration/user_model_mapping_spec.rb
rom-rails-1.0.1 spec/integration/user_model_mapping_spec.rb
rom-rails-1.0.0 spec/integration/user_model_mapping_spec.rb
rom-rails-1.0.0.rc1 spec/integration/user_model_mapping_spec.rb
rom-rails-1.0.0.beta1 spec/integration/user_model_mapping_spec.rb