Skip to content

Commit

Permalink
Merge pull request #5046 from consul/tenant_url
Browse files Browse the repository at this point in the history
Use the tenant URL as a link to the tenant
  • Loading branch information
javierm committed Dec 15, 2022
2 parents f70e3fa + 7bcdb6a commit d63efc7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
6 changes: 2 additions & 4 deletions app/components/admin/tenants/index_component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@
<tr id="<%= dom_id(tenant) %>">
<td><%= tenant.name %></td>
<td><%= tenant.schema %></td>
<td><%= tenant.host %></td>
<td><%= link_to tenant.host, root_url(host: tenant.host) %></td>
<td>
<%= render Admin::TableActionsComponent.new(tenant, actions: [:edit]) do |actions| %>
<%= actions.action(:show, text: t("admin.shared.view"), path: root_url(host: tenant.host)) %>
<% end %>
<%= render Admin::TableActionsComponent.new(tenant, actions: [:edit]) %>
</td>
</tr>
<% end %>
Expand Down
14 changes: 3 additions & 11 deletions spec/system/admin/tenants_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@

expect(page).to have_content "Tenant created successfully"

within("tr", text: "earth") do
expect(page).to have_content "earth.lvh.me"

click_link "View"
end
click_link "earth.lvh.me"

expect(current_host).to eq "http://earth.lvh.me"
expect(page).to have_current_path root_path
Expand All @@ -38,11 +34,7 @@
fill_in "Name", with: "Earthlings"
click_button "Create tenant"

within("tr", text: "earth") do
expect(page).to have_content "earth.lvh.me"

click_link "View"
end
click_link "earth.lvh.me"

expect(current_host).to eq "http://earth.lvh.me"
expect(page).to have_current_path root_path
Expand All @@ -65,7 +57,7 @@

expect(page).to have_content "Tenant updated successfully"

within("tr", text: "the-moon") { click_link "View" }
click_link "the-moon.lvh.me"

expect(current_host).to eq "http://the-moon.lvh.me"
expect(page).to have_current_path root_path
Expand Down

0 comments on commit d63efc7

Please sign in to comment.