spec/lib/poms/views_spec.rb in poms-1.1.0 vs spec/lib/poms/views_spec.rb in poms-1.2.0

- old
+ new

@@ -14,6 +14,25 @@ describe '#by_group' do it 'returns the correct group url' do expect(subject.by_group('POMS_S_NPO_823012')).to eq('http://docs.poms.omroep.nl/media/_design/media/_view/by-group?include_docs=true&key=%22POMS_S_NPO_823012%22&reduce=false') end end + + describe '#descendants_by_type' do + it 'builds a url' do + expect(subject.descendants_by_type('POMS_S_NPO_823012')) + .to eq( + 'http://docs.poms.omroep.nl/media/_design/media/_view/by-ancestor-and-type?include_docs=true&key=%5B%22POMS_S_NPO_823012%22%2C+%22BROADCAST%22%5D&reduce=false' + ) + end + + it 'can switch to not include docs' do + expect( + subject.descendants_by_type('POMS_S_NPO_823012', + 'BROADCAST', + include_docs: false)) + .to eq( + 'http://docs.poms.omroep.nl/media/_design/media/_view/by-ancestor-and-type?include_docs=false&key=%5B%22POMS_S_NPO_823012%22%2C+%22BROADCAST%22%5D&reduce=false' + ) + end + end end