Sha256: 07bf8b6f64df9fec13e4a3cace6a705939dddbdd58a7108c550d88c665e18765

Contents?: true

Size: 911 Bytes

Versions: 3

Compression:

Stored size: 911 Bytes

Contents

require 'spec_helper'

require 'netsuite_rails/spec/spec_helper'

describe NetSuiteRails::TestHelpers do
  include NetSuiteRails::TestHelpers
  include ExampleModels

  let(:fake_search_results) { OpenStruct.new(results: [ OpenStruct.new(internal_id: 0) ]) }

  before do
    allow(NetSuite::Records::Customer).to receive(:search).and_return(fake_search_results)
    allow(NetSuite::Records::Customer).to receive(:get)
  end

  it "should accept a standard NS gem object" do
    get_last_netsuite_object(NetSuite::Records::Customer)

    expect(NetSuite::Records::Customer).to have_received(:search)
    expect(NetSuite::Records::Customer).to have_received(:get)
  end

  it "should accept a record sync enabled object" do
    get_last_netsuite_object(StandardRecord.new)

    expect(NetSuite::Records::Customer).to have_received(:search)
    expect(NetSuite::Records::Customer).to have_received(:get)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
netsuite_rails-0.2.2 spec/models/spec_helper_spec.rb
netsuite_rails-0.2.1 spec/models/spec_helper_spec.rb
netsuite_rails-0.2.0 spec/models/spec_helper_spec.rb