Sha256: 00a687a4c4d278000ec0c83f8ad19996526b598a27148cb9be4b045c2d804ae1

Contents?: true

Size: 872 Bytes

Versions: 12

Compression:

Stored size: 872 Bytes

Contents

require 'spec_helper'

describe BaseCRM::UsersService do
  describe 'Responds to' do
    subject { client.users  }

    it { should respond_to :all }
    it { should respond_to :find }
    it { should respond_to :self }
    it { should respond_to :where }
 
  end

  describe :all do
    it "returns a PaginatedResource" do
      expect(client.users.all()).to be_instance_of BaseCRM::PaginatedResource
    end
  end

  describe :where do
    it "returns an array" do
      expect(client.users.where(page: 1)).to be_an Array
    end
  end

  describe :find do
 
    it "returns an instance of User class" do
      user = client.users.self
      expect(client.users.find(user.id)).to be_instance_of BaseCRM::User
    end
  end

  describe :self do
    it "returns instance of User class" do
      expect(client.users.self).to be_instance_of BaseCRM::User 
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
basecrm-1.3.2 spec/services/users_service_spec.rb
basecrm-1.3.1 spec/services/users_service_spec.rb
basecrm-1.3.0 spec/services/users_service_spec.rb
basecrm-1.2.3 spec/services/users_service_spec.rb
basecrm-1.2.2 spec/services/users_service_spec.rb
basecrm-1.2.1 spec/services/users_service_spec.rb
basecrm-1.2.0 spec/services/users_service_spec.rb
basecrm-1.1.3 spec/services/users_service_spec.rb
basecrm-1.1.2 spec/services/users_service_spec.rb
basecrm-1.1.1 spec/services/users_service_spec.rb
basecrm-1.1.0 spec/services/users_service_spec.rb
basecrm-1.0.0 spec/services/users_service_spec.rb