Sha256: cd1ffeb7d9adc55118d10b3de56eb33c0d2f5d64d05fc815b6867c73af81e70c
Contents?: true
Size: 819 Bytes
Versions: 23
Compression:
Stored size: 819 Bytes
Contents
require 'spec_helper' describe Legato::Response do context "An instance of Response" do before :each do raw_body = File.read(File.dirname(__FILE__) + '/../../fixtures/simple_response.json') @response = Legato::Response.new(stub(:body => raw_body)) end it 'has a collection of OpenStruct instances' do @response.collection.first.should == OpenStruct.new({:browser=>"Android Browser", :pageviews=>"93"}) end it 'has the number of total results' do @response.total_results.should == 13 end it 'has the totals for all results hash' do @response.totals_for_all_results.should == {'pageviews' => 3710} end it 'handles no rows returned' do @response.stubs(:data).returns({'rows' => nil}) @response.collection.should == [] end end end
Version data entries
23 entries across 23 versions & 2 rubygems