Sha256: 2eb804aad01d6af8407fd61939db3aaaa2eaff55c75e46b47aefc63566527f47

Contents?: true

Size: 1.27 KB

Versions: 9

Compression:

Stored size: 1.27 KB

Contents

require 'spec_helper'

describe CreateDossierGroup do
  let(:session) { Fabricate :roqua_core_api_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')
                                     .and_return("dossier_group" => {})
    CreateDossierGroup.run!(session: session, attributes: {some: 'attributes'}, organization_id: 'some_organization_id')
  end

  it 'returns a DossierGroup model' do
    allow(session).to receive(:post).with('/dossier_groups', dossier_group: {some: 'attributes'},
                                                             organization_id: 'some_organization_id')
                                    .and_return('dossier_group' => {'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

9 entries across 9 versions & 1 rubygems

Version Path
roqua-core-api-0.3.1 spec/lib/roqua/core_api/create_dossier_group_spec.rb
roqua-core-api-0.3.0 spec/lib/roqua/core_api/create_dossier_group_spec.rb
roqua-core-api-0.2.4 spec/lib/roqua/core_api/create_dossier_group_spec.rb
roqua-core-api-0.2.3 spec/lib/roqua/core_api/create_dossier_group_spec.rb
roqua-core-api-0.2.2 spec/lib/roqua/core_api/create_dossier_group_spec.rb
roqua-core-api-0.2.1 spec/lib/roqua/core_api/create_dossier_group_spec.rb
roqua-core-api-0.2.0 spec/lib/roqua/core_api/create_dossier_group_spec.rb
roqua-core-api-0.1.1 spec/lib/roqua/core_api/create_dossier_group_spec.rb
roqua-core-api-0.1.0 spec/lib/roqua/core_api/create_dossier_group_spec.rb