Skip to content

Commit

Permalink
Add specs for validate_encryption_key!
Browse files Browse the repository at this point in the history
  • Loading branch information
carbonin committed May 7, 2018
1 parent 89a8a0d commit 61922c4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions spec/database_configuration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@ def say(*_args)
it "normal case" do
allow(@config).to receive_messages(:validated => true)
expect(@config).to receive(:create_or_join_region).and_return(true)
expect(@config).to receive(:validate_encryption_key!).and_return(true)

allow(@config).to receive_messages(:merged_settings => @settings)
expect(@config).to receive(:do_save).with(@settings)
Expand Down Expand Up @@ -377,6 +378,11 @@ def say(*_args)
allow(@config).to receive(:create_or_join_region).and_raise
expect(@config.activate).to be_falsey
end

it "where the encryption key is invalid" do
allow(ManageIQ::ApplianceConsole::Utilities).to receive(:rake).with("evm:validate_encryption_key", {}).and_return(false)
expect(@config.activate).to be_falsey
end
end
end

Expand Down

0 comments on commit 61922c4

Please sign in to comment.