spec/slack/web/api/endpoints/custom_specs/views_spec.rb in slack-ruby-client-1.0.0 vs spec/slack/web/api/endpoints/custom_specs/views_spec.rb in slack-ruby-client-1.1.0

- old
+ new

@@ -8,20 +8,20 @@ describe 'views_open' do context 'with a hash for view' do let(:view_str) { '{"celery":"man"}' } it 'automatically converts view into JSON' do - expect(client).to receive(:post).with('views.open', trigger_id: trigger_id, view: view_str) + expect(client).to receive(:post).with('views.open', { trigger_id: trigger_id, view: view_str }) client.views_open(trigger_id: trigger_id, view: { celery: 'man' }) end end context 'with a string for view' do let(:view_str) { 'celery man' } it 'leaves view as is' do - expect(client).to receive(:post).with('views.open', trigger_id: trigger_id, view: view_str) + expect(client).to receive(:post).with('views.open', { trigger_id: trigger_id, view: view_str }) client.views_open(trigger_id: trigger_id, view: 'celery man') end end end @@ -30,65 +30,73 @@ context 'with a hash for view' do let(:view_str) { '{"celery":"man"}' } it 'automatically converts view into JSON' do - expect(client).to receive(:post).with('views.publish', - user_id: user_id, - trigger_id: trigger_id, - view: view_str) + expect(client).to receive(:post).with( + 'views.publish', + { + trigger_id: trigger_id, + user_id: user_id, + view: view_str + } + ) client.views_publish(user_id: user_id, trigger_id: trigger_id, view: { celery: 'man' }) end end context 'with a string for view' do let(:view_str) { 'celery man' } it 'leaves view as is' do - expect(client).to receive(:post).with('views.publish', - user_id: user_id, - trigger_id: trigger_id, - view: view_str) + expect(client).to receive(:post).with( + 'views.publish', + { + user_id: user_id, + trigger_id: trigger_id, + view: view_str + } + ) client.views_publish(user_id: user_id, trigger_id: trigger_id, view: 'celery man') end end end describe 'views_push' do context 'with a hash for view' do let(:view_str) { '{"celery":"man"}' } it 'automatically converts view into JSON' do - expect(client).to receive(:post).with('views.push', trigger_id: trigger_id, view: view_str) + expect(client).to receive(:post).with('views.push', { trigger_id: trigger_id, view: view_str }) client.views_push(trigger_id: trigger_id, view: { celery: 'man' }) end end context 'with a string for view' do let(:view_str) { 'celery man' } it 'leaves view as is' do - expect(client).to receive(:post).with('views.push', trigger_id: trigger_id, view: view_str) + expect(client).to receive(:post).with('views.push', { trigger_id: trigger_id, view: view_str }) client.views_push(trigger_id: trigger_id, view: 'celery man') end end end describe 'views_update' do context 'with a hash for view' do let(:view_str) { '{"celery":"man"}' } it 'automatically converts view into JSON' do - expect(client).to receive(:post).with('views.update', view: view_str) + expect(client).to receive(:post).with('views.update', { view: view_str }) client.views_update(view: { celery: 'man' }) end end context 'with a string for view' do let(:view_str) { 'celery man' } it 'leaves view as is' do - expect(client).to receive(:post).with('views.update', view: view_str) + expect(client).to receive(:post).with('views.update', { view: view_str }) client.views_update(view: 'celery man') end end end end