spec/cases/graph_collection_spec.rb in koala-3.0.0.beta1 vs spec/cases/graph_collection_spec.rb in koala-3.0.0.beta2
- old
+ new
@@ -47,27 +47,27 @@
end
describe "when getting a whole page" do
before(:each) do
@second_page = {
- "data" => [:second, :page, :data],
+ "data" => ["second", "page", "data"],
"paging" => {}
}
@base = double("base")
@args = {"a" => 1}
@page_of_results = double("page of results")
end
it "should return the previous page of results" do
expect(@collection).to receive(:previous_page_params).and_return([@base, @args])
- expect(@api).to receive(:api).with(@base, @args, anything, anything).and_return(@second_page)
+ expect(@api).to receive(:api).with(@base, @args, anything, anything).and_return(Koala::HTTPService::Response.new(200, @second_page.to_json, {}))
expect(Koala::Facebook::API::GraphCollection).to receive(:new).with(@second_page, @api).and_return(@page_of_results)
expect(@collection.previous_page).to eq(@page_of_results)
end
it "should return the next page of results" do
expect(@collection).to receive(:next_page_params).and_return([@base, @args])
- expect(@api).to receive(:api).with(@base, @args, anything, anything).and_return(@second_page)
+ expect(@api).to receive(:api).with(@base, @args, anything, anything).and_return(Koala::HTTPService::Response.new(200, @second_page.to_json, {}))
expect(Koala::Facebook::API::GraphCollection).to receive(:new).with(@second_page, @api).and_return(@page_of_results)
expect(@collection.next_page).to eq(@page_of_results)
end