Skip to content

Commit

Permalink
Merge pull request ManageIQ#123 from felipedf/fixing_tests_hostname
Browse files Browse the repository at this point in the history
Fixing tests for the new hostname validation
  • Loading branch information
agrare authored Jan 15, 2018
2 parents 464b546 + 70e98b9 commit f7509d2
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
let(:ems) do
FactoryGirl.create(:physical_infra_with_authentication,
:name => "LXCA",
:hostname => "https://10.243.9.123")
:hostname => "10.243.9.123")
end

let(:runner) { described_class.new(:ems_id => ems.id) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
let(:ems) do
FactoryGirl.create(:physical_infra_with_authentication,
:name => "LXCA",
:hostname => "https://10.243.9.123",
:hostname => "10.243.9.123",
:port => "443")
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
let(:ems) do
ems = FactoryGirl.create(:physical_infra,
:name => "LXCA",
:hostname => "https://10.243.9.123",
:hostname => "10.243.9.123",
:port => "443",
:ipaddress => "https://10.243.9.123/443")
ems.authentications = [auth]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
let(:ems) do
ems = FactoryGirl.create(:physical_infra,
:name => "LXCA",
:hostname => "https://10.243.9.123",
:hostname => "10.243.9.123",
:port => "443",
:ipaddress => "https://10.243.9.123:443")
ems.authentications = [auth]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
:ems_ref => "BD775D06821111E189A3E41F13ED5A1A")
@physical_infra_manager = FactoryGirl.create(:physical_infra,
:name => "LXCA",
:hostname => "https://10.243.9.123",
:hostname => "10.243.9.123",
:port => "443",
:ipaddress => "https://10.243.9.123")
@auth = FactoryGirl.create(:authentication,
Expand Down Expand Up @@ -49,7 +49,7 @@
:ems_ref => "EADEBE8316174750A27FEC2E8226AC48")
@physical_infra_manager = FactoryGirl.create(:physical_infra,
:name => "LXCA",
:hostname => "https://10.243.9.123",
:hostname => "10.243.9.123",
:port => "443",
:ipaddress => "https://10.243.9.123")
@auth = FactoryGirl.create(:authentication,
Expand Down Expand Up @@ -127,9 +127,9 @@
it "should build the console URI" do
@physical_infra_manager = FactoryGirl.create(:physical_infra,
:name => "LXCA1",
:hostname => "10.241.5.555",
:hostname => "10.243.5.255",
:port => "443",
:ipaddress => "10.243.5.555")
:ipaddress => "10.243.5.255")
console_uri = URI::HTTPS.build(:host => @physical_infra_manager.hostname,
:port => @physical_infra_manager.port)

Expand Down Expand Up @@ -246,7 +246,7 @@
before :each do
@physical_infra_manager = FactoryGirl.create(:physical_infra,
:name => "LXCA",
:hostname => "https://sample.com",
:hostname => "sample.com",
:port => "443")

@auth = FactoryGirl.create(:authentication,
Expand All @@ -264,7 +264,7 @@
@pattern_id = "1"
response_body = {:status => [200, "OK"], :body => JSON.generate("uuid" => [@uuid], "restart" => "immediate")}
WebMock.allow_net_connect!
stub_request(:post, File.join(@physical_infra_manager.hostname, @base_uri + @pattern_id)).to_return(response_body)
stub_request(:post, File.join("https://" + @physical_infra_manager.hostname, @base_uri + @pattern_id)).to_return(response_body)
end

subject do
Expand All @@ -288,7 +288,7 @@
@pattern_id = "2"

WebMock.allow_net_connect!
stub_request(:post, File.join(@physical_infra_manager.hostname, @base_uri + @pattern_id)).to_return(:status => [404, "OK"])
stub_request(:post, File.join("https://" + @physical_infra_manager.hostname, @base_uri + @pattern_id)).to_return(:status => [404, "OK"])
end

subject do
Expand Down

0 comments on commit f7509d2

Please sign in to comment.