spec/eucalyptus/resource_spec.rb in eucalyptus-0.2.13 vs spec/eucalyptus/resource_spec.rb in eucalyptus-0.3.0
- old
+ new
@@ -55,11 +55,11 @@
let(:response) { [{ "id" => "123"}, {"id" => "321"}] }
let(:graph) { double(:graph, get_connection: response) }
let(:parent) { double(:parent, id: 123) }
it 'returns a collection of resources' do
- expect(Eucalyptus::CustomAudience.all(graph: graph, parent: parent)).to be_a Array
+ expect(Eucalyptus::CustomAudience.all(graph: graph, parent: parent)).to be_a Eucalyptus::ResponseCollection
end
context 'when the target class has defined valid known fields' do
let(:graph) { double(:graph, get_connection: [{ "id" => "123", "name" => "test-audience" }]) }
@@ -103,9 +103,19 @@
it 'updates a resource' do
VCR.use_cassette("updating_adset") do
graph = double(:graph, put_connections: {success: true})
ad_set = Eucalyptus::AdSet.find(6025097880671)
expect(ad_set.update(graph: graph, fields: {bid_type: "CPM"})).to eql({success: true})
+ end
+ end
+ end
+
+ describe '#next_page' do
+ it 'updates a resource' do
+ VCR.use_cassette("adsets_next") do
+ ad_sets = Eucalyptus::AdSet.all
+ expect(ad_sets.next_page).to be_a Eucalyptus::ResponseCollection
+ expect(ad_sets.next_page.first).to be_a Eucalyptus::AdSet
end
end
end
describe '#method_missing' do