Sha256: cd1da4e3595bd5e423b67465594ee4710e3e37a3ffd282f648b68816ea86e4d6
Contents?: true
Size: 970 Bytes
Versions: 39
Compression:
Stored size: 970 Bytes
Contents
require 'spec_helper' describe "Ey::Core::Collection" do let!(:client) { create_client(user: create_user) } context "with some accounts" do before(:each) { 50.times { create_account(client: client) } } describe "#total_count" do it "can get the total item count" do expect(client.accounts.all.total_count).to eq(50) end end describe "#first" do it "can get the first item" do account = client.accounts.all[1] expect(client.accounts.first(name: account.name)).to eq(account) end end describe "#each_page" do it "should yield multiple pages" do count = 0 client.accounts.all.each_page { |_| count += 1 } expect(count).to eq(3) end end describe "#each_entry" do it "should yield multiple entries" do count = 0 client.accounts.all.each_entry { |*| count += 1 } expect(count).to eq(50) end end end end
Version data entries
39 entries across 39 versions & 2 rubygems