Sha256: fe0200e5be8767555a75f4176f31f93c54cc6895c3b779569d3fa321df1ba3c3
Contents?: true
Size: 1.25 KB
Versions: 2
Compression:
Stored size: 1.25 KB
Contents
require 'spec_helper' describe Locomotive::Coal::Resources::ContentEntries do before { VCR.insert_cassette 'content_entries', record: :new_episodes } after { VCR.eject_cassette } let(:uri) { TEST_API_URI } let(:token) { api_token } let(:content_type) { Locomotive::Coal::Resources::Contents.new(uri, token).by_slug(:bands) } let(:entries) { described_class.new(uri, token, content_type) } describe '#all' do let(:query) { {} } let(:options) { {} } subject { entries.all(query, options) } it { expect(subject.size).not_to eq 0 } it { expect(subject._total_pages).not_to eq 0 } it { expect(subject._total_entries).not_to eq 0 } describe 'pagination' do let(:options) { { page: 2, per_page: 2 } } it { expect(subject.size).not_to eq 0 } it { expect(subject._total_pages).to be > 1 } it { expect(subject._total_entries).to be > 1 } end describe 'filter' do let(:query) { { _visible: true, name: 'Pearl Jam' } } it { expect(subject.size).to eq 1 } end end describe '#update' do let(:entry) { entries.all.first } subject { entries.update(entry._id, { name: 'Pearl Jam' }) } it { expect(subject._id).to eq entry._id } end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
locomotivecms_coal-1.0.0.pre.alpha.1 | spec/integration/resources/content_entries_spec.rb |
locomotivecms_coal-1.0.0.pre.alpha | spec/integration/resources/content_entries_spec.rb |