Sha256: d72892b99f5cea09409e29c53e7cef413ed3d1826348f5bba6f95cd7548882f7

Contents?: true

Size: 1 KB

Versions: 13

Compression:

Stored size: 1 KB

Contents

require "spec_helper"

describe NetSuite::Records::EntityCustomField do
  describe ".get" do
    context "success" do
      let(:internal_id) { 1 }
      let(:response) do
        NetSuite::Response.new(
          success: true,
          body: { 
            access_level: "_edit",
            field_type: "_integerNumber",
            label: "Salesforce Customer ID",
            show_in_list: true,
          }
        )
      end

      it "returns a EntityCustomField instance with populated fields" do
        expect(NetSuite::Actions::Get)
          .to receive(:call)
          .with([NetSuite::Records::EntityCustomField, internal_id: internal_id], {})
          .and_return(response)

        record = NetSuite::Records::EntityCustomField.get(internal_id: internal_id)

        expect(record.access_level).to eql("_edit")
        expect(record.field_type).to eql("_integerNumber")
        expect(record.label).to eql("Salesforce Customer ID")
        expect(record.show_in_list).to eq(true)
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
netsuite-0.9.3 spec/netsuite/records/entity_custom_field_spec.rb
netsuite-0.9.2 spec/netsuite/records/entity_custom_field_spec.rb
netsuite-0.9.1 spec/netsuite/records/entity_custom_field_spec.rb
netsuite-0.9.0 spec/netsuite/records/entity_custom_field_spec.rb
netsuite-0.8.12 spec/netsuite/records/entity_custom_field_spec.rb
netsuite-0.8.11 spec/netsuite/records/entity_custom_field_spec.rb
netsuite-0.8.10 spec/netsuite/records/entity_custom_field_spec.rb
netsuite-0.8.9 spec/netsuite/records/entity_custom_field_spec.rb
netsuite-0.8.8 spec/netsuite/records/entity_custom_field_spec.rb
netsuite-0.8.7 spec/netsuite/records/entity_custom_field_spec.rb
netsuite-0.8.6 spec/netsuite/records/entity_custom_field_spec.rb
netsuite-0.8.5 spec/netsuite/records/entity_custom_field_spec.rb
netsuite-0.8.4 spec/netsuite/records/entity_custom_field_spec.rb