Sha256: 687c3fe2dffa34f87a603d658549af1b156cf465ae63e1f817d36e0663e41f64

Contents?: true

Size: 958 Bytes

Versions: 58

Compression:

Stored size: 958 Bytes

Contents

require 'spec_helper'

describe Mdm::Module::Mixin do

  it_should_behave_like 'Metasploit::Concern.run'

  context 'associations' do
    it { should belong_to(:detail).class_name('Mdm::Module::Detail') }
  end

  context 'database' do
    context 'columns' do
      it { should have_db_column(:detail_id).of_type(:integer) }
      it { should have_db_column(:name).of_type(:text) }
    end

    context 'indices' do
      it { should have_db_index(:detail_id) }
    end
  end

  context 'factories' do
    context 'mdm_module_mixin' do
      subject(:mdm_module_mixin) do
        FactoryGirl.build :mdm_module_mixin
      end

      it { should be_valid }
    end
  end

  context 'mass assignment security' do
    it { should_not allow_mass_assignment_of(:detail_id) }
    it { should allow_mass_assignment_of(:name) }
  end

  context 'validations' do
    it { should validate_presence_of(:detail) }
    it { should validate_presence_of(:name) }
  end
end

Version data entries

58 entries across 58 versions & 1 rubygems

Version Path
metasploit_data_models-0.19.8-java spec/app/models/mdm/module/mixin_spec.rb
metasploit_data_models-0.19.7 spec/app/models/mdm/module/mixin_spec.rb
metasploit_data_models-0.19.7-java spec/app/models/mdm/module/mixin_spec.rb
metasploit_data_models-0.19.4 spec/app/models/mdm/module/mixin_spec.rb
metasploit_data_models-0.19.4-java spec/app/models/mdm/module/mixin_spec.rb
metasploit_data_models-0.19.3-java spec/app/models/mdm/module/mixin_spec.rb
metasploit_data_models-0.19.3 spec/app/models/mdm/module/mixin_spec.rb
metasploit_data_models-0.19.0 spec/app/models/mdm/module/mixin_spec.rb
metasploit_data_models-0.19.0-java spec/app/models/mdm/module/mixin_spec.rb
metasploit_data_models-0.18.1-java spec/app/models/mdm/module/mixin_spec.rb
metasploit_data_models-0.18.1 spec/app/models/mdm/module/mixin_spec.rb
metasploit_data_models-0.18.0 spec/app/models/mdm/module/mixin_spec.rb
metasploit_data_models-0.18.0-java spec/app/models/mdm/module/mixin_spec.rb
metasploit_data_models-0.18.0.pre.compatibility spec/app/models/mdm/module/mixin_spec.rb
metasploit_data_models-0.17.3-java spec/app/models/mdm/module/mixin_spec.rb
metasploit_data_models-0.17.3 spec/app/models/mdm/module/mixin_spec.rb
metasploit_data_models-0.17.3.pre.metasploit.pre.concern-java spec/app/models/mdm/module/mixin_spec.rb
metasploit_data_models-0.17.3.pre.metasploit.pre.concern spec/app/models/mdm/module/mixin_spec.rb