Sha256: 37368b2384a922e85214dfdcddce62193f6841d6a3f2062c7f6c02b5df40d170

Contents?: true

Size: 630 Bytes

Versions: 8

Compression:

Stored size: 630 Bytes

Contents

require "spec_helper"

describe "notes" do
  let(:client) { Intercom::Client.new(token: 'token') }

  it 'gets a note' do
    client.expects(:get).with("/notes/123", {}).returns({"id" => "123", "body" => "<p>Note to leave on user</p>", "created_at" => 1234567890})
    client.notes.find(id: '123')
  end

  it "sets/gets allowed keys" do
    params = {"body" => "Note body", "email" => "me@example.com", :user_id => "abc123"}
    note = Intercom::Note.new(params)

    _(note.to_hash.keys.sort).must_equal params.keys.map(&:to_s).sort
    params.keys.each do |key|
      _(note.send(key)).must_equal params[key]
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
intercom-4.2.1 spec/unit/intercom/note_spec.rb
intercom-4.2.0 spec/unit/intercom/note_spec.rb
intercom-4.1.3 spec/unit/intercom/note_spec.rb
intercom-4.1.2 spec/unit/intercom/note_spec.rb
intercom-4.1.1 spec/unit/intercom/note_spec.rb
intercom-4.1.0 spec/unit/intercom/note_spec.rb
intercom-4.0.1 spec/unit/intercom/note_spec.rb
intercom-4.0.0 spec/unit/intercom/note_spec.rb