Sha256: 2c6d60fc7ad684e188a961df0219d9c95a61d4de7a1fb5948ff51f861f98ff8e

Contents?: true

Size: 1.27 KB

Versions: 2

Compression:

Stored size: 1.27 KB

Contents

# encoding: utf-8

shared_context 'demo application' do
  let(:request)           { Substation::Request.new(name, env, input) }
  let(:name)              { :create_person }
  let(:env)               { Demo::APP_ENV }

  let(:session_data)      { { 'account_id' => account_id } }

  let(:authorized_id)     {  1 }
  let(:unauthorized_id)   {  2 }
  let(:unknown_id)        { -1 }

  let(:processed_request) { Substation::Request.new(name, env, processed_input) }
  let(:actor)             { Demo::Domain::Actor.coerce(session_data, acting_person) }
  let(:acting_person)     { Demo::Domain::DTO::Person.new(:id => account_id, :name => 'Jane') }

  let(:accepted_input)    { Demo::Core::Input::Accepted.new(actor, person) }
  let(:incomplete_input)  { Demo::Core::Input::Incomplete.new(session_data, incomplete_data) }
  let(:incomplete_data)   { person }

  let(:person)            { Demo::Domain::DTO::Person.new(:id => nil, :name => person_name) }

  let(:error_response)     { Substation::Response::Failure.new(processed_request, error_data) }
  let(:exception_response) { Substation::Response::Exception.new(processed_request, error_data) }
  let(:error_data)         { error }

end

shared_context 'with registered chains' do
  let(:input)      { mock }
  let(:account_id) { authorized_id }
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
substation-0.0.11 spec/shared/context/integration/demo.rb
substation-0.0.10 spec/shared/context/integration/demo.rb