cleaning up some of the specs

bug/bundler_fix
darkbushido 2017-01-12 16:17:12 -06:00
parent e5d8a64770
commit c20cdc2943
1 changed files with 391 additions and 388 deletions

View File

@ -21,6 +21,7 @@ RSpec.describe Msf::Ui::Console::CommandDispatcher::Creds do
let(:password) { 'thispass' }
let(:realm) { 'thisrealm' }
let(:realm_type) { 'Active Directory Domain' }
context 'Searching' do
describe '-u' do
let(:nomatch_username) { 'thatuser' }
let(:nomatch_password) { 'thatpass' }
@ -31,25 +32,27 @@ RSpec.describe Msf::Ui::Console::CommandDispatcher::Creds do
let!(:origin) { FactoryGirl.create(:metasploit_credential_origin_import) }
let!(:priv) { FactoryGirl.create(:metasploit_credential_password, data: password) }
let!(:pub) { FactoryGirl.create(:metasploit_credential_username, username: username) }
let!(:blank_pub) { blank_pub = FactoryGirl.create(:metasploit_credential_blank_username) }
let!(:nonblank_priv) { FactoryGirl.create(:metasploit_credential_password, data: nonblank_password) }
let!(:nonblank_pub) { FactoryGirl.create(:metasploit_credential_username, username: nonblank_username) }
let!(:blank_priv) { FactoryGirl.create(:metasploit_credential_password, data: blank_password) }
before(:example) do
priv = FactoryGirl.create(:metasploit_credential_password, data: password)
pub = FactoryGirl.create(:metasploit_credential_username, username: username)
FactoryGirl.create(:metasploit_credential_core,
origin: origin,
private: priv,
public: pub,
realm: nil,
workspace: framework.db.workspace)
blank_pub = FactoryGirl.create(:metasploit_credential_blank_username)
nonblank_priv = FactoryGirl.create(:metasploit_credential_password, data: nonblank_password)
FactoryGirl.create(:metasploit_credential_core,
origin: origin,
private: nonblank_priv,
public: blank_pub,
realm: nil,
workspace: framework.db.workspace)
nonblank_pub = FactoryGirl.create(:metasploit_credential_username, username: nonblank_username)
blank_priv = FactoryGirl.create(:metasploit_credential_password, data: blank_password)
FactoryGirl.create(:metasploit_credential_core,
origin: origin,
private: blank_priv,
@ -236,12 +239,12 @@ RSpec.describe Msf::Ui::Console::CommandDispatcher::Creds do
end
end
end
describe 'add' do
end
describe 'Adding' do
let(:pub) { FactoryGirl.create(:metasploit_credential_username, username: username) }
let(:priv) { FactoryGirl.create(:metasploit_credential_password, data: password) }
let(:r) { FactoryGirl.create(:metasploit_credential_realm, key: realm_type, value: realm) }
context 'Cores with public privates and realms' do
context 'username password and realm' do
it 'creates a core if one does not exist' do
expect {
@ -260,7 +263,6 @@ RSpec.describe Msf::Ui::Console::CommandDispatcher::Creds do
}.to_not change { Metasploit::Credential::Core.count }
end
end
context 'username and realm' do
it 'creates a core if one does not exist' do
expect {
@ -336,7 +338,6 @@ RSpec.describe Msf::Ui::Console::CommandDispatcher::Creds do
}.to_not change { Metasploit::Credential::Core.count }
end
end
context 'private_types' do
context 'password' do
it 'creates a core if one does not exist' do
@ -419,7 +420,6 @@ RSpec.describe Msf::Ui::Console::CommandDispatcher::Creds do
end
end
end
context 'realm-types' do
Metasploit::Model::Realm::Key::SHORT_NAMES.each do |short_name, long_name|
context "#{short_name}" do
@ -442,6 +442,9 @@ RSpec.describe Msf::Ui::Console::CommandDispatcher::Creds do
end
end
end
end
end
context 'Cores with Logins' do
end
end