Sha256: c2224df19e8e0a5126729c60fff45095f7ef3228494db5551f543c34a364d6ec

Contents?: true

Size: 992 Bytes

Versions: 38

Compression:

Stored size: 992 Bytes

Contents

require 'spec_helper'

describe Metasploit::Model::Association::Reflection do
  context 'validations' do
    it { should validate_presence_of :model }
    it { should validate_presence_of :name }
    it { should validate_presence_of :class_name }
  end

  context '#klass' do
    subject(:klass) do
      reflection.klass
    end


    let(:class_name) do
      FactoryGirl.generate :metasploit_model_association_reflection_class_name
    end

    let(:class_name_class) do
      Class.new
    end

    let(:model) do
      Class.new
    end

    let(:name) do
      FactoryGirl.generate :metasploit_model_association_reflection_name
    end

    let(:reflection) do
      described_class.new(
          :model => model,
          :name => name,
          :class_name => class_name
      )
    end

    before(:each) do
      stub_const(class_name, class_name_class)
    end

    it 'should return Class with Class#name #class_name' do
      klass.should == class_name_class
    end
  end
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
metasploit-model-1.0.0.pre.rails.pre.4.0 spec/app/models/metasploit/model/association/reflection_spec.rb
metasploit-model-0.30.0 spec/app/models/metasploit/model/association/reflection_spec.rb
metasploit-model-0.30.0-java spec/app/models/metasploit/model/association/reflection_spec.rb
metasploit-model-0.29.2 spec/app/models/metasploit/model/association/reflection_spec.rb
metasploit-model-0.29.2-java spec/app/models/metasploit/model/association/reflection_spec.rb
metasploit-model-0.29.0 spec/app/models/metasploit/model/association/reflection_spec.rb
metasploit-model-0.29.0-java spec/app/models/metasploit/model/association/reflection_spec.rb
metasploit-model-0.28.0 spec/app/models/metasploit/model/association/reflection_spec.rb
metasploit-model-0.28.0-java spec/app/models/metasploit/model/association/reflection_spec.rb
metasploit-model-0.28.0.pre.engine.pre.requires spec/app/models/metasploit/model/association/reflection_spec.rb
metasploit-model-0.27.4 spec/app/models/metasploit/model/association/reflection_spec.rb
metasploit-model-0.27.4-java spec/app/models/metasploit/model/association/reflection_spec.rb
metasploit-model-0.27.3 spec/app/models/metasploit/model/association/reflection_spec.rb
metasploit-model-0.27.3-java spec/app/models/metasploit/model/association/reflection_spec.rb
metasploit-model-0.27.2 spec/app/models/metasploit/model/association/reflection_spec.rb
metasploit-model-0.27.2-java spec/app/models/metasploit/model/association/reflection_spec.rb
metasploit-model-0.27.1 spec/app/models/metasploit/model/association/reflection_spec.rb
metasploit-model-0.27.1-java spec/app/models/metasploit/model/association/reflection_spec.rb
metasploit-model-0.27.0 spec/app/models/metasploit/model/association/reflection_spec.rb
metasploit-model-0.27.0-java spec/app/models/metasploit/model/association/reflection_spec.rb