Skip to content

Commit

Permalink
TextualSummary: fix external links in PhysicalServer test.
Browse files Browse the repository at this point in the history
  • Loading branch information
martinpovolny committed Jul 17, 2018
1 parent cfefc83 commit 6f76606
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions spec/helpers/physical_server_helper/textual_summary_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,31 @@

result = helper.textual_ipv4
expect(result[:label]).to eq("IPv4 Address")
expect(result[:value]).to eq("<a target=\"_blank\" href=\"https://192.168.1.1\">192.168.1.1</a>")
expect(result[:value]).to eq([{:link => "https://192.168.1.1", :external => true, :value => "192.168.1.1"}])

network.ipaddress = "192.168.1.1,192.168.1.2"
result = helper.textual_ipv4
expect(result[:label]).to eq("IPv4 Address")
expect(result[:value]).to eq("<a target=\"_blank\" href=\"https://192.168.1.1\">192.168.1.1</a>, <a target=\"_blank\" href=\"https://192.168.1.2\">192.168.1.2</a>")
expect(result[:value]).to eq(
[
{:link => "https://192.168.1.1", :external => true, :value => "192.168.1.1"},
{:link => "https://192.168.1.2", :external => true, :value => "192.168.1.2"}
]
)

network.ipaddress = "192.168.1.1, 192.168.1.2"
result = helper.textual_ipv4
expect(result[:label]).to eq("IPv4 Address")
expect(result[:value]).to eq("<a target=\"_blank\" href=\"https://192.168.1.1\">192.168.1.1</a>, <a target=\"_blank\" href=\"https://192.168.1.2\">192.168.1.2</a>")
expect(result[:value]).to eq(
[
{:link => "https://192.168.1.1", :external => true, :value => "192.168.1.1"},
{:link => "https://192.168.1.2", :external => true, :value => "192.168.1.2"}
]
)

network.ipaddress = ""
result = helper.textual_ipv4
expect(result[:label]).to eq("IPv4 Address")
expect(result[:value]).to eq("")
expect(result[:value]).to eq([])
end
end

0 comments on commit 6f76606

Please sign in to comment.