Sha256: 15e1997ef7199ff062ab74cd740cca74c869154c67ed37090cabfedb245400a9

Contents?: true

Size: 993 Bytes

Versions: 4

Compression:

Stored size: 993 Bytes

Contents

describe ChatWork::IncomingRequest do
  describe ".get", type: :api do
    subject { ChatWork::IncomingRequest.get }

    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) }

    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) }

    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

4 entries across 4 versions & 1 rubygems

Version Path
chatwork-0.7.0 spec/lib/chatwork/incoming_request_spec.rb
chatwork-0.6.2 spec/lib/chatwork/incoming_request_spec.rb
chatwork-0.6.1 spec/lib/chatwork/incoming_request_spec.rb
chatwork-0.6.0 spec/lib/chatwork/incoming_request_spec.rb