Sha256: 3b782318d282df8c7cd516588f2a43bcda3a5082786c4a5eba5bc558bb20a658

Contents?: true

Size: 907 Bytes

Versions: 5

Compression:

Stored size: 907 Bytes

Contents

describe Unidom::Action::StateTransition, type: :model do

  before :each do
  end

  after :each do
  end

  context do

    model_attributes = {
      transitor_visitor_id:   SecureRandom.uuid,
      transitor_visitor_type: 'Unidom::Action::TransitorVisitor::Mock',
      transitor_party_id:     SecureRandom.uuid,
      transitor_party_type:   'Unidom::Action::TransitorParty::Mock',
      subject_id:             SecureRandom.uuid,
      subject_type:           'Unidom::Action::Subject::Mock',
      reason_id:              SecureRandom.uuid,
      from_state:             'C',
      thru_state:             'A'
    }

    it_behaves_like 'Unidom::Common::Concerns::ModelExtension', model_attributes

    it_behaves_like 'belongs_to', model_attributes, :reason, Unidom::Action::Reason, { name: 'Some Reason' }

    it_behaves_like 'monomorphic scope', model_attributes, :caused_by, :reason

  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
unidom-action-1.17.7 lib/rspec/models/unidom/action/state_transition_spec.rb
unidom-action-1.17.6 lib/rspec/models/unidom/action/state_transition_spec.rb
unidom-action-1.17.5 lib/rspec/models/unidom/action/state_transition_spec.rb
unidom-action-1.17.4 lib/rspec/models/unidom/action/state_transition_spec.rb
unidom-action-1.17.3 lib/rspec/models/unidom/action/state_transition_spec.rb