Skip to content

Commit

Permalink
test assume role feature too
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderZagaynov committed May 28, 2019
1 parent abd99b5 commit ff9a17a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
3 changes: 2 additions & 1 deletion spec/controllers/ems_cloud_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@
'ap-southeast-1',
nil,
true,
instance_of(URI::Generic)
instance_of(URI::Generic),
:assume_role => nil,
]),
User.current_user.userid,
zone.name
Expand Down
14 changes: 12 additions & 2 deletions spec/controllers/mixins/ems_common/angular_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,8 @@
@params = {
:default_userid => "abc",
:default_password => "abc",
:default_url => "http://abc.test/mypath"
:default_url => "http://abc.test/mypath",
:service_account => "test_arn",
}
@ems = FactoryBot.create(:ems_amazon)
allow(@ems).to receive(:to_s).and_return('ManageIQ::Providers::Amazon::CloudManager')
Expand All @@ -234,7 +235,16 @@
@params[:cred_type] = "default"
@ems_cloud_controller.instance_variable_set(:@_params, @params)

expected_connect_options = ["abc", "v2:{XpADRTTI7f11hNT7AuDaKg==}", :EC2, nil, nil, true, URI.parse("http://abc.test/mypath")]
expected_connect_options = [
"abc",
"v2:{XpADRTTI7f11hNT7AuDaKg==}",
:EC2,
nil,
nil,
true,
URI.parse("http://abc.test/mypath"),
:assume_role => "test_arn",
]
expect(@ems_cloud_controller.send(:get_task_args, @ems)).to eq(expected_connect_options)
end
end
Expand Down

0 comments on commit ff9a17a

Please sign in to comment.