Sha256: 7660c1289da900af4d0c25879338f4b00db25b0100385a841a73c8c637cc42ec

Contents?: true

Size: 1 KB

Versions: 4

Compression:

Stored size: 1 KB

Contents

RSpec.describe Mdm::Module::Mixin, type: :model do

  it_should_behave_like 'Metasploit::Concern.run'

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

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

    context 'indices' do
      it { is_expected.to 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 { is_expected.to be_valid }
    end
  end

  context 'mass assignment security' do
    it { is_expected.not_to allow_mass_assignment_of(:detail_id) }
    it { is_expected.to allow_mass_assignment_of(:name) }
  end

  context 'validations' do
    it { is_expected.to validate_presence_of(:detail) }
    it { is_expected.to validate_presence_of(:name) }
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
metasploit_data_models-0.24.4 spec/app/models/mdm/module/mixin_spec.rb
metasploit_data_models-0.24.3 spec/app/models/mdm/module/mixin_spec.rb
metasploit_data_models-0.24.2 spec/app/models/mdm/module/mixin_spec.rb
metasploit_data_models-0.24.1.pre.rspec.pre.3.pre.1 spec/app/models/mdm/module/mixin_spec.rb