Sha256: dd318c9928c90dc242ca52c5fd69a81caa780496d2ab59edf483931cce79672c

Contents?: true

Size: 1.05 KB

Versions: 1

Compression:

Stored size: 1.05 KB

Contents

require 'spec_helper'

RSpec.describe Slack::Web::Api::Endpoints::Users do
  let(:client) { Slack::Web::Client.new }
  context 'users' do
    it 'list', vcr: { cassette_name: 'web/users_list' } do
      json = client.users_list(presence: true)
      expect(json.ok).to be true
      expect(json.members.size).to eq 9
      expect(json.members.first.presence).to eq 'away'
    end
    it 'list', vcr: { cassette_name: 'web/paginated_users_list' } do
      members = []
      client.users_list(presence: true, limit: 5) do |json|
        expect(json.ok).to be true
        members.concat json.members
      end
      expect(members.size).to eq 23
    end
    it 'info', vcr: { cassette_name: 'web/users_info' } do
      json = client.users_info(user: '@aws')
      expect(json.user.name).to eq 'aws'
    end
    it 'search', vcr: { cassette_name: 'web/users_info' } do
      json = client.users_search(user: 'aws')
      expect(json.ok).to be true
      expect(json.members.size).to eq 1
      expect(json.members.first.name).to eq 'aws'
    end if defined?(Picky)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
slack-ruby-client-0.10.0 spec/slack/web/api/endpoints/custom_specs/users_spec.rb