Skip to content

Commit

Permalink
Update keypair spec test
Browse files Browse the repository at this point in the history
Fixes issue caused by changes in ManageIQ/manageiq#15485
  • Loading branch information
tzumainn committed Jul 11, 2017
1 parent 9f612f0 commit 05bf79a
Showing 1 changed file with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
describe ManageIQ::Providers::Openstack::CloudManager::AuthKeyPair do
let(:ems) { FactoryGirl.create(:ems_openstack_with_authentication) }
let(:key_pair_attributes) { {:name => "key1", :public_key => "AAA...B"} }
let(:key_pair_attributes) { {
:name => "key1",
:fingerprint => "0000",
:public_key => "AAA...B",
:private_key => "BBB...C"} }
let(:the_raw_key_pair) do
double.tap do |key_pair|
allow(key_pair).to receive(:name).and_return('key1')
allow(key_pair).to receive(:fingerprint).and_return('0000')
allow(key_pair).to receive(:public_key).and_return('AAA...B')
allow(key_pair).to receive(:private_key).and_return('BBB...C')
end
end

describe 'key pair create and delete' do
it 'creates new key pair in nova' do
Expand All @@ -10,7 +22,7 @@
allow(ems).to receive(:connect).with(:service => 'Compute').and_return(service)
allow(service).to receive(:key_pairs).and_return(key_pairs)
allow(key_pairs).to receive(:create).with(key_pair_attributes).and_return(
FactoryGirl.create :auth_key_pair_openstack)
the_raw_key_pair)
subject.class.create_key_pair(ems.id, key_pair_attributes)
end

Expand Down

0 comments on commit 05bf79a

Please sign in to comment.