Sha256: 3f84b9cfa7590ea6f47011e58a755b910a7c7dcec4b0ec08ce923befd3854903

Contents?: true

Size: 590 Bytes

Versions: 3

Compression:

Stored size: 590 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Session::Relation, '#delete' do
  subject { users.delete(user) }

  include_context 'Session::Relation'

  let(:state) { subject.state(user) }

  context 'with a persisted object' do
    it_behaves_like 'a command method'

    specify { expect(state).to be_deleted }
  end

  context 'with a transient object' do
    let(:user) { users.new }

    specify do
      expect { subject }.to raise_error(
        Session::State::TransitionError,
        'cannot delete object with ROM::Session::State::Transient state'
      )
    end
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
rom-0.2.0 spec/unit/rom/session/relation/delete_spec.rb
rom-session-0.1.1 spec/unit/rom/session/relation/delete_spec.rb
rom-session-0.1.0 spec/unit/rom/session/relation/delete_spec.rb