Sha256: 904035086f70fccea0dc222f79dfb45a5c10e303231aeb8e00c0168fb35c41f2

Contents?: true

Size: 1008 Bytes

Versions: 3

Compression:

Stored size: 1008 Bytes

Contents

require "clever-ruby"
require 'webmock/rspec'

describe Clever::DataApi do
  before(:each) do
    WebMock.allow_net_connect!
    @api_instance = Clever::DataApi.new
    Clever.configure do |config|
      config.access_token = 'DEMO_TOKEN'
    end
  end

  describe ".get_contacts_for_student" do
    it "returns array of StudentContacts" do
      student_id = "530e5961049e75a9262cffe4"
      contacts = @api_instance.get_contacts_for_student(student_id).data
      expect(contacts.length).to eq(1)
      expect(contacts.first.class).to eq(Clever::StudentContact)
      expect(contacts.first.id).not_to be nil
    end
  end

  describe ".get_contacts" do
    it "returns array of StudentContactResponses" do
      contacts = @api_instance.get_contacts.data
      expect(contacts).not_to be_empty
      expect(contacts.first.class).to eq(Clever::StudentContactResponse)
      expect(contacts.first.data.class).to eq(Clever::StudentContact)
      expect(contacts.first.data.id).not_to be nil
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
clever-ruby-1.2.4 spec/data_api_spec.rb
clever-ruby-1.2.3 spec/data_api_spec.rb
clever-ruby-1.2.2 spec/data_api_spec.rb