Sha256: 82373fc9f44ca7cc5cde7fe439faa8251838abd5fcc4de85d554ce10404540bb

Contents?: true

Size: 1 KB

Versions: 69

Compression:

Stored size: 1 KB

Contents

require 'spec_helper'

describe Metasploit::Credential::Origin::Manual do
  it_should_behave_like 'Metasploit::Concern.run'

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

  context 'database' do
    context 'columns' do
      context 'foreign keys' do
        it { should 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 { should have_db_index(:user_id) }
      end
    end
  end

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

      it { should be_valid }
    end
  end

  context 'validations' do
    it { should validate_presence_of :user }
  end
end

Version data entries

69 entries across 69 versions & 1 rubygems

Version Path
metasploit-credential-0.14.8 spec/models/metasploit/credential/origin/manual_spec.rb
metasploit-credential-1.0.0.pre.rails.pre.4.0c spec/models/metasploit/credential/origin/manual_spec.rb
metasploit-credential-1.0.0.pre.rails.pre.4.0b spec/models/metasploit/credential/origin/manual_spec.rb
metasploit-credential-1.0.0.pre.rails.pre.4.0 spec/models/metasploit/credential/origin/manual_spec.rb
metasploit-credential-0.14.5 spec/models/metasploit/credential/origin/manual_spec.rb
metasploit-credential-0.14.4 spec/models/metasploit/credential/origin/manual_spec.rb
metasploit-credential-0.14.3 spec/models/metasploit/credential/origin/manual_spec.rb
metasploit-credential-0.14.2 spec/models/metasploit/credential/origin/manual_spec.rb
metasploit-credential-0.14.1 spec/models/metasploit/credential/origin/manual_spec.rb
metasploit-credential-0.14.0 spec/models/metasploit/credential/origin/manual_spec.rb
metasploit-credential-0.13.19 spec/models/metasploit/credential/origin/manual_spec.rb
metasploit-credential-0.13.18 spec/models/metasploit/credential/origin/manual_spec.rb
metasploit-credential-0.13.17 spec/models/metasploit/credential/origin/manual_spec.rb
metasploit-credential-0.13.16 spec/models/metasploit/credential/origin/manual_spec.rb
metasploit-credential-0.13.15 spec/models/metasploit/credential/origin/manual_spec.rb
metasploit-credential-0.13.12 spec/models/metasploit/credential/origin/manual_spec.rb
metasploit-credential-0.13.11 spec/models/metasploit/credential/origin/manual_spec.rb
metasploit-credential-0.13.10 spec/models/metasploit/credential/origin/manual_spec.rb
metasploit-credential-0.13.9 spec/models/metasploit/credential/origin/manual_spec.rb
metasploit-credential-0.13.8 spec/models/metasploit/credential/origin/manual_spec.rb