Sha256: a6441c8ba58726e1b3d0a7483d035469feb7a5c6f2fb161f595a3038d53a10d7

Contents?: true

Size: 487 Bytes

Versions: 3

Compression:

Stored size: 487 Bytes

Contents

shared_examples :entity_collection do |entity_type, key|
  let(:params) { double(headers: {}, parsed_body: { key => [] }) }

  subject { described_class.new(params) }

  context "#build" do
    it "returns a collection(#{described_class})" do
      expect(subject.build).to be_a(described_class)
    end
  end

  context "#collection" do
    before { subject.build }

    it "returns items(#{entity_type})" do
      expect(subject.collection).to all(be_a(entity_type))
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rexpense-2.1.0 spec/support/shared_examples/entity_collection.rb
rexpense-2.0.0 spec/support/shared_examples/entity_collection.rb
rexpense-1.0.0 spec/support/shared_examples/entity_collection.rb