Sha256: 25d906fdce1150b4f882b418d3acfa5c31b89956bb505be99aa41dc68d608006

Contents?: true

Size: 719 Bytes

Versions: 3

Compression:

Stored size: 719 Bytes

Contents

require 'contextio/api/association_helpers'

describe "ContextIO::API::AssociationHelpers" do
  subject { ContextIO::API::AssociationHelpers }

  describe ".class_for_association_name" do
    context "when the resource is registered" do
      let(:resource_class) do
        Class.new
      end

      before do
        subject.register_resource(resource_class, :registered)
      end

      it "makes the resource available" do
        expect(subject.class_for_association_name(:registered)).to be(resource_class)
      end
    end

    context "when the resource is NOT registered" do
      it "returns nil" do
        expect(subject.class_for_association_name(:not_registered)).to be_nil
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
contextio-2.0.0 spec/unit/contextio/api/association_helpers_spec.rb
contextio-1.8.1 spec/unit/contextio/api/association_helpers_spec.rb
contextio-1.8.0 spec/unit/contextio/api/association_helpers_spec.rb