Sha256: da385c68032b69f76c7cf7ac161d4393ff41c097fe53b8864ec9dafb034d3524

Contents?: true

Size: 646 Bytes

Versions: 12

Compression:

Stored size: 646 Bytes

Contents

require 'spec_helper'

describe NetSuite::Actions::Login do
  before { savon.mock! }
  after { savon.unmock! }

  it 'properly executes a login call' do
    message = {"platformMsgs:passport"=>{"platformCore:email"=>"email", "platformCore:password"=>"password", "platformCore:account"=>"1234", "platformCore:role"=>234}}

    savon.expects(:login).with(:message => message).returns(File.read('spec/support/fixtures/login.xml'))

    result = NetSuite::Actions::Login.call({
      email: 'email',
      password: 'password',
      role: 234
    })

    expect(result.success?).to eq(true)
    expect(result.body[:user_id]).to_not be_nil
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
netsuite-0.5.1 spec/netsuite/actions/login_spec.rb
netsuite-0.5.0 spec/netsuite/actions/login_spec.rb
netsuite-0.4.9 spec/netsuite/actions/login_spec.rb
netsuite-0.4.8 spec/netsuite/actions/login_spec.rb
netsuite-0.4.7 spec/netsuite/actions/login_spec.rb
netsuite-0.4.6 spec/netsuite/actions/login_spec.rb
netsuite-0.4.5 spec/netsuite/actions/login_spec.rb
netsuite-0.4.4 spec/netsuite/actions/login_spec.rb
netsuite-0.4.3 spec/netsuite/actions/login_spec.rb
netsuite-0.4.2 spec/netsuite/actions/login_spec.rb
netsuite-0.4.1 spec/netsuite/actions/login_spec.rb
netsuite-0.4.0 spec/netsuite/actions/login_spec.rb