Sha256: cea39fdc7cea283a68ec2ce49aad3133a31f2664fb242770f648388bb418fe5d

Contents?: true

Size: 741 Bytes

Versions: 15

Compression:

Stored size: 741 Bytes

Contents

require 'spec_helper'
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

15 entries across 15 versions & 1 rubygems

Version Path
contextio-1.7.2 spec/unit/contextio/api/association_helpers_spec.rb
contextio-1.7.1 spec/unit/contextio/api/association_helpers_spec.rb
contextio-1.7.0 spec/unit/contextio/api/association_helpers_spec.rb
contextio-1.6.0 spec/unit/contextio/api/association_helpers_spec.rb
contextio-1.5.0 spec/unit/contextio/api/association_helpers_spec.rb
contextio-1.4.0 spec/unit/contextio/api/association_helpers_spec.rb
contextio-1.3.0 spec/unit/contextio/api/association_helpers_spec.rb
contextio-1.2.4 spec/unit/contextio/api/association_helpers_spec.rb
contextio-1.2.3 spec/contextio/api/association_helpers_spec.rb
contextio-1.2.2 spec/contextio/api/association_helpers_spec.rb
contextio-1.2.1 spec/contextio/api/association_helpers_spec.rb
contextio-1.2.0 spec/contextio/api/association_helpers_spec.rb
contextio-1.1.0 spec/contextio/api/association_helpers_spec.rb
contextio-1.0.1 spec/contextio/api/association_helpers_spec.rb
contextio-1.0.0 spec/contextio/api/association_helpers_spec.rb