Merge pull request #5046 from consul/tenant_url

Use the tenant URL as a link to the tenant
This commit is contained in:
Javi Martín
2022-12-15 13:20:07 +01:00
committed by GitHub
2 changed files with 5 additions and 15 deletions

View File

@@ -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 %>

View File

@@ -19,11 +19,7 @@ describe "Tenants", :admin, :seed_tenants do
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
@@ -38,11 +34,7 @@ describe "Tenants", :admin, :seed_tenants do
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
@@ -65,7 +57,7 @@ describe "Tenants", :admin, :seed_tenants do
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