Skip to content

Commit

Permalink
Renderer fails when calling validate_import_vm
Browse files Browse the repository at this point in the history
When using automation we see that there is an issue in validate_import_vm
and there is a time when api_version is not avialbale. We need to make sure
that validation passes.
  • Loading branch information
pkliczewski committed Apr 10, 2017
1 parent 00a2ae5 commit a048839
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Expand Up @@ -31,7 +31,7 @@ def import_vm(source_vm_id, target_params)
end

def validate_import_vm
api_version >= '4.0'
highest_supported_api_version && highest_supported_api_version >= '4'
end

private
Expand Down
Expand Up @@ -54,4 +54,18 @@
)
end
end

context 'checks version during validation' do
let(:ems) { FactoryGirl.create(:ems_redhat) }

it 'validates successfully' do
allow(ems).to receive(:highest_supported_api_version).and_return('4')
expect(ems.validate_import_vm).to be_truthy
end

it 'validates before connecting' do
allow(ems).to receive(:highest_supported_api_version).and_return(nil)
expect(ems.validate_import_vm).to be_falsey
end
end
end

0 comments on commit a048839

Please sign in to comment.