Sha256: 20735bf0ed5decc8cfe05ad23780c6af1864b5b46a33c3a9621df0b65fc5f587

Contents?: true

Size: 524 Bytes

Versions: 8

Compression:

Stored size: 524 Bytes

Contents

require 'spec_helper'

describe Id::Model::Association do

  module Foo
    module Bar
      module Baz
        class Quux
        end
      end
    end
  end

  let (:model) { stub(name: "Foo::Bar::Baz::Quux") }
  let (:has_one) { Id::Model::Association.new(model, "yak", {}) }

  describe "hierarchy" do
    it "builds the class and module hierarchy for the model" do
      has_one.hierarchy.constants.should eq [
        Foo::Bar::Baz::Quux,
        Foo::Bar::Baz,
        Foo::Bar,
        Foo
      ]
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
id-0.0.9 spec/lib/id/model/association_spec.rb
id-0.0.8 spec/lib/id/model/association_spec.rb
id-0.0.7 spec/lib/id/model/association_spec.rb
id-0.0.6 spec/lib/id/model/association_spec.rb
id-0.0.5 spec/lib/id/model/association_spec.rb
id-0.0.4 spec/lib/id/model/association_spec.rb
id-0.0.3 spec/lib/id/model/association_spec.rb
id-0.0.2 spec/lib/id/model/association_spec.rb