Sha256: 241de8726ef4d4b2dc51b35268131ac996876b650ec30c5b3b8187383a8f955b
Contents?: true
Size: 723 Bytes
Versions: 26
Compression:
Stored size: 723 Bytes
Contents
require 'spec_helper' describe Betterdocs::Dsl::Result::CollectionProperty do let :result do {} end let :representer do double('Betterdocs::ResultRepresenter') end let :sub_representer do double( 'Betterdocs::ResultRepresenter', hashify: { 'a' => 'hash' }, '<': true ) end let :property do sr = sub_representer described_class.new(representer, 'test', {}) do represent_with sr end end let :members do [ double('Member'), double('Member') ] end it 'calls representer for every member' do property.assign(result, double(test: members)) expect(result['test']).to eq [ { 'a' => 'hash' }, { 'a' => 'hash' }, ] end end
Version data entries
26 entries across 26 versions & 1 rubygems