Sha256: 3ac5517d744cce1b91f6580e0a8e69e44377eee88aec6d0a73582e035e4c41cc

Contents?: true

Size: 1.45 KB

Versions: 24

Compression:

Stored size: 1.45 KB

Contents

require 'spec_helper'

describe Metasploit::Credential::Public do
  it_should_behave_like 'Metasploit::Concern.run'

  context 'database' do
    context 'columns' do
      it_should_behave_like 'timestamp database columns'

      it { should have_db_column(:username).of_type(:string).with_options(null: false) }
    end

    context 'indices' do
      it { should have_db_index(:username).unique(true) }
    end
  end

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

      it { should be_valid }
    end
  end

  context 'mass assignment security' do
    it { should_not allow_mass_assignment_of(:created_at) }
    it { should_not allow_mass_assignment_of(:updated_at) }
    it { should allow_mass_assignment_of(:username) }
  end

  context 'search' do
    let(:base_class) {
      described_class
    }

    context 'attributes' do
      it_should_behave_like 'search_attribute',
                            :username,
                            type: :string

      it_should_behave_like 'search_with',
                            Metasploit::Credential::Search::Operator::Type,
                            name: :type,
                            class_names: %w{
                              Metasploit::Credential::BlankUsername
                              Metasploit::Credential::Username
                            }
    end
  end

end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
metasploit-credential-0.14.8 spec/models/metasploit/credential/public_spec.rb
metasploit-credential-0.14.5 spec/models/metasploit/credential/public_spec.rb
metasploit-credential-0.14.4 spec/models/metasploit/credential/public_spec.rb
metasploit-credential-0.14.3 spec/models/metasploit/credential/public_spec.rb
metasploit-credential-0.14.2 spec/models/metasploit/credential/public_spec.rb
metasploit-credential-0.14.1 spec/models/metasploit/credential/public_spec.rb
metasploit-credential-0.14.0 spec/models/metasploit/credential/public_spec.rb
metasploit-credential-0.13.19 spec/models/metasploit/credential/public_spec.rb
metasploit-credential-0.13.18 spec/models/metasploit/credential/public_spec.rb
metasploit-credential-0.13.17 spec/models/metasploit/credential/public_spec.rb
metasploit-credential-0.13.16 spec/models/metasploit/credential/public_spec.rb
metasploit-credential-0.13.15 spec/models/metasploit/credential/public_spec.rb
metasploit-credential-0.13.12 spec/models/metasploit/credential/public_spec.rb
metasploit-credential-0.13.11 spec/models/metasploit/credential/public_spec.rb
metasploit-credential-0.13.10 spec/models/metasploit/credential/public_spec.rb
metasploit-credential-0.13.9 spec/models/metasploit/credential/public_spec.rb
metasploit-credential-0.13.8 spec/models/metasploit/credential/public_spec.rb
metasploit-credential-0.13.7 spec/models/metasploit/credential/public_spec.rb
metasploit-credential-0.13.6 spec/models/metasploit/credential/public_spec.rb
metasploit-credential-0.13.5 spec/models/metasploit/credential/public_spec.rb