Sha256: a5b04152fcd888e07f01ad50976b241592359c051fc50718683ff04c0a92079d

Contents?: true

Size: 799 Bytes

Versions: 2

Compression:

Stored size: 799 Bytes

Contents

require_relative '../../spec_helper'

describe Commands::Account::Create do
  #TODO: GJ: validate array
  # is_required :created_by, :name

  context 'creating an account' do
    let(:response) { subject.class.run(params) }

    context 'with valid params' do
      let(:account) { {
        application_id: 111,
        created_by: 234,
        name: 'My New Group'
      } }
      let(:params) { {
        accounts: [account]
      } }

      it 'returns the newly created account' do
        response.success?.should == true

        accounts = response.result[:accounts]
        accounts.length.should == 1

        accounts.first[:application_id].should == 111
        accounts.first[:created_by].should == 234
        accounts.first[:name].should == "My New Group"
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
restpack_account_service-0.0.4 spec/commands/account/create_spec.rb
restpack_account_service-0.0.3 spec/commands/account/create_spec.rb