Sha256: 743950eb32b2b37855820b4f9f0913462d540a62e8eec634ca284f2f12ef27ab

Contents?: true

Size: 1017 Bytes

Versions: 9

Compression:

Stored size: 1017 Bytes

Contents

describe ChatWork::IncomingRequest do
  describe ".get", type: :api do
    subject { ChatWork::IncomingRequest.get(&block) }

    before do
      stub_chatwork_request(:get, "/incoming_requests")
    end

    it_behaves_like :a_chatwork_api, :get, "/incoming_requests"
  end

  describe ".update", type: :api do
    subject { ChatWork::IncomingRequest.update(request_id: request_id, &block) }

    let(:request_id) { 123 }

    before do
      stub_chatwork_request(:put, "/incoming_requests/#{request_id}", "/incoming_requests/{request_id}")
    end

    it_behaves_like :a_chatwork_api, :put, "/incoming_requests/{request_id}"
  end

  describe ".destroy", type: :api do
    subject { ChatWork::IncomingRequest.destroy(request_id: request_id, &block) }

    let(:request_id) { 123 }

    before do
      stub_chatwork_request(:delete, "/incoming_requests/#{request_id}", "/incoming_requests/{request_id}", 204)
    end

    it_behaves_like :a_chatwork_api, :delete, "/incoming_requests/{request_id}", 204
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
chatwork-1.0.0 spec/lib/chatwork/incoming_request_spec.rb
chatwork-0.12.3 spec/lib/chatwork/incoming_request_spec.rb
chatwork-0.12.2 spec/lib/chatwork/incoming_request_spec.rb
chatwork-0.12.1 spec/lib/chatwork/incoming_request_spec.rb
chatwork-0.12.0 spec/lib/chatwork/incoming_request_spec.rb
chatwork-0.11.0 spec/lib/chatwork/incoming_request_spec.rb
chatwork-0.10.0 spec/lib/chatwork/incoming_request_spec.rb
chatwork-0.9.0 spec/lib/chatwork/incoming_request_spec.rb
chatwork-0.8.0 spec/lib/chatwork/incoming_request_spec.rb