Sha256: c51b67c5f882caf24e119c3c19133ed6d5df8ce499a84f722d4573e5d16fd295

Contents?: true

Size: 1.29 KB

Versions: 5

Compression:

Stored size: 1.29 KB

Contents

require 'spec_helper'

describe Mdm::ModuleAuthor do
  context 'associations' do
    it { should belong_to(:module_detail).class_name('Mdm::ModuleDetail') }
  end

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

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

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

      it { should be_valid }
      its(:email) { should_not be_nil }
    end

    context 'mdm_module_author' do
      subject(:mdm_module_author) do
        FactoryGirl.build :mdm_module_author
      end

      it { should be_valid }
    end
  end

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

  context 'validations' do
    it { should_not validate_presence_of(:email) }
    it { should validate_presence_of(:module_detail) }
    it { should validate_presence_of(:name) }
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
metasploit_data_models-0.7.0 spec/app/models/mdm/module_author_spec.rb
metasploit_data_models-0.7.0-java spec/app/models/mdm/module_author_spec.rb
metasploit_data_models-0.6.16 spec/app/models/mdm/module_author_spec.rb
metasploit_data_models-0.6.14 spec/app/models/mdm/module_author_spec.rb
metasploit_data_models-0.6.13 spec/app/models/mdm/module_author_spec.rb