Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
j_platform / spec / models / client_membership_spec.rb
Size: Mime:
require 'spec_helper'

describe JPlatform::ClientMembership, :type => :model do

  describe "#==" do
    it "returns true when objects IDs are the same" do
      client_member = JPlatform::ClientMembership.new(id: 1, name: "test")
      other = JPlatform::ClientMembership.new(id: 1, name: "bar")
      expect(client_member == other).to be_truthy
    end
    it "returns false when objects IDs are different" do
      client_member = JPlatform::ClientMembership.new(id: 1)
      other = JPlatform::ClientMembership.new(id: 2)
      expect(client_member == other).to be_falsey
    end
  end

  describe "Retrieve client member from api properly" do
    before(:each) do
      stub_get("/api/v1/client_memberships/1.json").to_return(body: fixture("client_membership1.json"), headers: {content_type: "application/json; charset=utf-8"})
    end
    it "return the client member information" do
      JPlatform::ClientMembership.find(1)
      expect(a_get("/api/v1/client_memberships/1.json")).to have_been_made
    end
  end
end