Sha256: 4480ae375953e7db39d007d3aca3d8397fbcd391f5c4ba0f51cdd6ea0ca6f63a

Contents?: true

Size: 1.16 KB

Versions: 16

Compression:

Stored size: 1.16 KB

Contents

require 'spec_helper'

describe CreateDossierGroup do
  let(:session) { Fabricate :oauth_session }

  it 'performs a post on the /dossier_groups api path' do
    expect(session).to receive(:post).with '/dossier_groups', dossier_group: {some: 'attributes'},
                                                              organization_id: 'some_organization_id'
    CreateDossierGroup.run!(session: session, attributes: {some: 'attributes'}, organization_id: 'some_organization_id')
  end

  it 'returns a Dossier model' do
    allow(session).to receive(:post).with('/dossier_groups', dossier_group: {some: 'attributes'},
                                                             organization_id: 'some_organization_id')
                                    .and_return 'id' => 'some_id', 'name' => 'some_name'
    dossier_group = CreateDossierGroup.run!(session: session,
                                            attributes: {some: 'attributes'},
                                            organization_id: 'some_organization_id')
    expect(dossier_group).to be_a(DossierGroup)
    expect(dossier_group.id).to eq('some_id')
    expect(dossier_group.name).to eq('some_name')
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
roqua-core-api-0.0.26 spec/lib/roqua/core_api/create_dossier_group_spec.rb
roqua-core-api-0.0.25 spec/lib/roqua/core_api/create_dossier_group_spec.rb
roqua-core-api-0.0.24 spec/lib/roqua/core_api/create_dossier_group_spec.rb
roqua-core-api-0.0.22 spec/lib/roqua/core_api/create_dossier_group_spec.rb
roqua-core-api-0.0.21 spec/lib/roqua/core_api/create_dossier_group_spec.rb
roqua-core-api-0.0.20 spec/lib/roqua/core_api/create_dossier_group_spec.rb
roqua-core-api-0.0.19 spec/lib/roqua/core_api/create_dossier_group_spec.rb
roqua-core-api-0.0.18 spec/lib/roqua/core_api/create_dossier_group_spec.rb
roqua-core-api-0.0.17 spec/lib/roqua/core_api/create_dossier_group_spec.rb
roqua-core-api-0.0.16 spec/lib/roqua/core_api/create_dossier_group_spec.rb
roqua-core-api-0.0.15 spec/lib/roqua/core_api/create_dossier_group_spec.rb
roqua-core-api-0.0.14 spec/lib/roqua/core_api/create_dossier_group_spec.rb
roqua-core-api-0.0.13 spec/lib/roqua/core_api/create_dossier_group_spec.rb
roqua-core-api-0.0.12 spec/lib/roqua/core_api/create_dossier_group_spec.rb
roqua-core-api-0.0.11 spec/lib/roqua/core_api/create_dossier_group_spec.rb
roqua-core-api-0.0.10 spec/lib/roqua/core_api/create_dossier_group_spec.rb