Sha256: 917ad1cca43034a347afdba3c1fff15f5d2bd0a77b81d8c5e017b1dc6fc0193e

Contents?: true

Size: 730 Bytes

Versions: 5

Compression:

Stored size: 730 Bytes

Contents

# frozen_string_literal: true
require 'spec_helper'

RSpec.describe Notion::Api::Endpoints::Users do
  let(:client) { Notion::Client.new }

  context 'users' do
    it 'lists', vcr: { cassette_name: 'users_list' } do
      response = client.users_list
      expect(response.results.size).to be 3
    end

    it 'paginated list', vcr: { cassette_name: 'paginated_users_list' } do
      members = []
      client.users_list(limit: 2) do |page|
        members.concat page.results
      end
      expect(members.size).to eq 3
    end

    it 'retrieves', vcr: { cassette_name: 'users' } do
      response = client.user(id: 'a8da8d30-c858-4c3d-87ad-3f2d477bd98d')
      expect(response.name).to eql 'Nicolas Goutay'
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
notion-ruby-client-0.0.8 spec/notion/api/endpoints/users_spec.rb
notion-ruby-client-0.0.7 spec/notion/api/endpoints/users_spec.rb
notion-ruby-client-0.0.6 spec/notion/api/endpoints/users_spec.rb
notion-ruby-client-0.0.5 spec/notion/api/endpoints/users_spec.rb
notion-ruby-client-0.0.4 spec/notion/api/endpoints/users_spec.rb