Sha256: 035d5812853c2b1dea5923a1a793c34dfe1a6e38b9df825905e111ebf2588c2b

Contents?: true

Size: 1.05 KB

Versions: 33

Compression:

Stored size: 1.05 KB

Contents

RSpec.describe Metasploit::Credential::Origin::Manual, type: :model do
  it_should_behave_like 'Metasploit::Concern.run'

  context 'associations' do
    it { is_expected.to have_many(:cores).class_name('Metasploit::Credential::Core').dependent(:destroy) }
    it { is_expected.to belong_to(:user).class_name('Mdm::User') }
  end

  context 'database' do
    context 'columns' do
      context 'foreign keys' do
        it { is_expected.to have_db_column(:user_id).of_type(:integer).with_options(null: false) }
      end

      it_should_behave_like 'timestamp database columns'
    end

    context 'indices' do
      context 'foreign keys' do
        it { is_expected.to have_db_index(:user_id) }
      end
    end
  end

  context 'factories' do
    context 'metasploit_credential_origin_manual' do
      subject(:metasploit_credential_origin_manual) do
        FactoryBot.build(:metasploit_credential_origin_manual)
      end

      it { is_expected.to be_valid }
    end
  end

  context 'validations' do
    it { is_expected.to validate_presence_of :user }
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
metasploit-credential-6.0.11 spec/models/metasploit/credential/origin/manual_spec.rb
metasploit-credential-6.0.10 spec/models/metasploit/credential/origin/manual_spec.rb
metasploit-credential-6.0.9 spec/models/metasploit/credential/origin/manual_spec.rb
metasploit-credential-6.0.8 spec/models/metasploit/credential/origin/manual_spec.rb
metasploit-credential-6.0.7 spec/models/metasploit/credential/origin/manual_spec.rb
metasploit-credential-6.0.6 spec/models/metasploit/credential/origin/manual_spec.rb
metasploit-credential-6.0.5 spec/models/metasploit/credential/origin/manual_spec.rb
metasploit-credential-6.0.4 spec/models/metasploit/credential/origin/manual_spec.rb
metasploit-credential-6.0.3 spec/models/metasploit/credential/origin/manual_spec.rb
metasploit-credential-6.0.2 spec/models/metasploit/credential/origin/manual_spec.rb
metasploit-credential-6.0.1 spec/models/metasploit/credential/origin/manual_spec.rb
metasploit-credential-6.0.0 spec/models/metasploit/credential/origin/manual_spec.rb
metasploit-credential-5.0.9 spec/models/metasploit/credential/origin/manual_spec.rb
metasploit-credential-5.0.8 spec/models/metasploit/credential/origin/manual_spec.rb
metasploit-credential-5.0.7 spec/models/metasploit/credential/origin/manual_spec.rb
metasploit-credential-5.0.6 spec/models/metasploit/credential/origin/manual_spec.rb
metasploit-credential-5.0.5 spec/models/metasploit/credential/origin/manual_spec.rb
metasploit-credential-5.0.4 spec/models/metasploit/credential/origin/manual_spec.rb
metasploit-credential-5.0.3 spec/models/metasploit/credential/origin/manual_spec.rb
metasploit-credential-5.0.2 spec/models/metasploit/credential/origin/manual_spec.rb