Sha256: cef5995b348359723c61c65b29425c4282a1d5aca372e2da855cad75b444a1ea

Contents?: true

Size: 1.23 KB

Versions: 12

Compression:

Stored size: 1.23 KB

Contents

require 'spec_helper'

describe Myfinance::Entities::AttachmentCollection do
  let(:response) { double(headers: { "Link" => "<https://sandbox.myfinance.com.br/entities?page=3>; rel=next, <http://https://sandbox.myfinance.com.br/entities?page=1>; rel=prev, <http://https://sandbox.myfinance.com.br/entities?page=3>; rel=last, <http://https://sandbox.myfinance.com.br/entities?page=1>; rel=first" },
                          parsed_body: [{"attachment" => {"id" => 12,"entity_id" => 1,"title" => "","attachment_file_name" => "extratoPoup.ofx","attachment_content_type" => "application/octet-stream","attachment_file_size" => 5517,"created_at" => "2011-11-10T15:52:59-02:00","updated_at" => "2011-11-10T15:52:59-02:00","download_url" => "https://app.myfinance.com.br/entities/1/attachments/12/download","attachables" => [],"links" => []}}]) }

  subject { Myfinance::Entities::AttachmentCollection.new(response) }

  describe '#build' do
    it 'returns order collection' do
      expect(subject.build.class).to eq(Myfinance::Entities::AttachmentCollection)
    end

    it "returns orders" do
      subject.build
      expect(subject.collection.count).to eq(1)
      expect(subject.collection.first.class).to eq(Myfinance::Entities::Attachment)
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
myfinance-1.4.1 spec/lib/myfinance/entities/attachment_collection_spec.rb
myfinance-1.4.0 spec/lib/myfinance/entities/attachment_collection_spec.rb
myfinance-1.3.1 spec/lib/myfinance/entities/attachment_collection_spec.rb
myfinance-1.3.0 spec/lib/myfinance/entities/attachment_collection_spec.rb
myfinance-1.2.1 spec/lib/myfinance/entities/attachment_collection_spec.rb
myfinance-1.2.0 spec/lib/myfinance/entities/attachment_collection_spec.rb
myfinance-1.1.0 spec/lib/myfinance/entities/attachment_collection_spec.rb
myfinance-1.0.0 spec/lib/myfinance/entities/attachment_collection_spec.rb
myfinance-0.7.0 spec/lib/myfinance/entities/attachment_collection_spec.rb
myfinance-0.6.0 spec/lib/myfinance/entities/attachment_collection_spec.rb
myfinance-0.5.0 spec/lib/myfinance/entities/attachment_collection_spec.rb
myfinance-0.4.0 spec/lib/myfinance/entities/attachment_collection_spec.rb