Sha256: e83a4fbf73c9010cb223b08eda3fb2984213c1bf670eeb160986df5b532344b9

Contents?: true

Size: 718 Bytes

Versions: 8

Compression:

Stored size: 718 Bytes

Contents

# frozen_string_literal: true
require 'spec_helper'

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

  context 'search' do
    it 'searches', vcr: { cassette_name: 'search' } do
      response = client.search
      expect(response.results.size).to eq 2
    end

    it 'searches with a query', vcr: { cassette_name: 'search_with_query' } do
      response = client.search(query: 'Nicolas')
      expect(response.results.size).to eq 1
    end

    it 'paginated search', vcr: { cassette_name: 'paginated_search' } do
      results = []
      client.search(page_size: 2) do |page|
        results.concat page.results
      end
      expect(results.size).to eq 2
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
notion-ruby-client-1.2.2 spec/notion/api/endpoints/search_spec.rb
notion-ruby-client-1.2.1 spec/notion/api/endpoints/search_spec.rb
notion-ruby-client-1.2.0 spec/notion/api/endpoints/search_spec.rb
notion-ruby-client-1.1.0 spec/notion/api/endpoints/search_spec.rb
notion-ruby-client-1.0.0 spec/notion/api/endpoints/search_spec.rb
notion-ruby-client-1.0.0.pre.beta2 spec/notion/api/endpoints/search_spec.rb
notion-ruby-client-1.0.0.pre.beta1 spec/notion/api/endpoints/search_spec.rb
notion-ruby-client-0.1.0.pre.beta1 spec/notion/api/endpoints/search_spec.rb