Sha256: cbab51a960297a2e584c50f7d40a4216266d132b6f4cc7400b9dcb7c98f9a628

Contents?: true

Size: 801 Bytes

Versions: 1

Compression:

Stored size: 801 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Dimelo::CCP::Attachment do
  let(:client) { Dimelo::CCP::API::Client.new('https://domain-test.api.answers.dimelo.com/1.0', 'access_token' => 'foo') }

  describe Dimelo::CCP::QuestionAttachment do

    it 'use question path' do
      expect(client).to receive(:transport).with(:get, 'questions/1/attachments', {:offset=>0, :limit=>30}).and_return('[]')
      Dimelo::CCP::QuestionAttachment.find({:question_id => 1}, client)
    end

  end

  describe Dimelo::CCP::AnswerAttachment do

    it 'use answer path' do
      expect(client).to receive(:transport).with(:get, 'questions/2/answers/1/attachments', {:offset=>0, :limit=>30}).and_return('[]')
      Dimelo::CCP::AnswerAttachment.find({question_id: 2, answer_id: 1}, client)
    end

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dimelo_ccp_api-0.5.0 spec/lib/dimelo/ccp/api/model/attachment_spec.rb