Sha256: ec5d95ed4754c924ca6fab8d93d1b01f8ffee0ac2af16a1c547724e7b31efb86
Contents?: true
Size: 1.13 KB
Versions: 7
Compression:
Stored size: 1.13 KB
Contents
# frozen_string_literal: true require 'spec_helper' RSpec.describe Slack::Web::Api::Endpoints::Dialog do let(:client) { Slack::Web::Client.new } context 'dialog_open' do it 'automatically converts dialog into JSON' do expect(client).to receive(:post).with( 'dialog.open', trigger_id: '12345.98765.abcd2358fdea', dialog: '[]' ) client.dialog_open(trigger_id: '12345.98765.abcd2358fdea', dialog: []) end context 'arguments' do it 'requires dialog' do expect { client.dialog_open(trigger_id: '123') }.to( raise_error(ArgumentError, /Required arguments :dialog missing/) ) end it 'requires trigger_id' do expect { client.dialog_open(dialog: []) }.to( raise_error(ArgumentError, /Required arguments :trigger_id missing/) ) end it 'likes both dialog and trigger_id' do expect(client).to( receive(:post).with('dialog.open', hash_including(trigger_id: '123', dialog: '[]')) ) expect { client.dialog_open(dialog: [], trigger_id: '123') }.not_to raise_error end end end end
Version data entries
7 entries across 7 versions & 1 rubygems