Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

18 lines (16 sloc) 0.885 kb
shared_examples_for "a management finder" do
it "returns an array of all #{subject_class_name} available to a user" do
MultiJson.stubs(:decode).returns({'items' => ['item1', 'item2']})
response = stub(:body => 'some json')
access_token = stub(:get => response)
user = stub(:access_token => access_token, :api_key => nil)
described_class.stubs(:new).returns('thing1', 'thing2')
described_class.all(user).should == ['thing1', 'thing2']
user.should have_received(:access_token)
access_token.should have_received(:get).with('https://www.googleapis.com/analytics/v3/management'+described_class.default_path)
response.should have_received(:body)
MultiJson.should have_received(:decode).with('some json')
described_class.should have_received(:new).with('item1', user)
described_class.should have_received(:new).with('item2', user)
end
end
Jump to Line
Something went wrong with that request. Please try again.