Sha256: fc6ff3ff382200557568fd9c52c2ca32973dbceac681ebdeea331c762c5b6b22

Contents?: true

Size: 670 Bytes

Versions: 2

Compression:

Stored size: 670 Bytes

Contents

# encoding: utf-8

shared_context 'Session::Relation' do
  let(:users)    { session[:users] }
  let(:object)   { users }

  let(:session)  { Session.new(env) }
  let(:env)      { Session::Environment.new({ users: relation }, tracker) }
  let(:tracker)  { Session::Tracker.new }

  let(:mapper)   { Mapper.build([[:id, Integer], [:name, String]], model, keys: [:id]) }
  let(:model)    { mock_model(:id, :name) }
  let(:header)   { TEST_ENV.schema[:users].header }
  let(:axiom)    { Axiom::Relation::Variable.new(Axiom::Relation.new(header, [[1, 'John'], [2, 'Jane']])) }
  let(:relation) { Relation.new(axiom, mapper) }

  let(:user) { session[:users].to_a.first }
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rom-session-0.1.1 spec/shared/unit/relation_context.rb
rom-session-0.1.0 spec/shared/unit/relation_context.rb