From 0fa5c771784c6e5fc3d9cd077b766625c18f7fa9 Mon Sep 17 00:00:00 2001 From: Philipp Winkler Date: Tue, 9 Aug 2022 20:55:37 +0200 Subject: [PATCH] Make shop url clickable --- .../admin/enterprises/form/_primary_details.html.haml | 4 ++-- spec/system/admin/enterprises_spec.rb | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/views/admin/enterprises/form/_primary_details.html.haml b/app/views/admin/enterprises/form/_primary_details.html.haml index ac7f37b58414..5a43bafb0cd1 100644 --- a/app/views/admin/enterprises/form/_primary_details.html.haml +++ b/app/views/admin/enterprises/form/_primary_details.html.haml @@ -70,8 +70,8 @@ %div{'ofn-with-tip' => t('.link_to_front_tip')} %a= t('admin.whats_this') .eight.columns.omega - = surround main_app.root_url, "/shop" do - {{Enterprise.permalink}} + - link_to_front_shop = "#{main_app.root_url}#{@enterprise.permalink}'/shop'" + = link_to link_to_front_shop, link_to_front_shop , target: "_blank" .row .three.columns.alpha = f.label :id, t('.ofn_uid') diff --git a/spec/system/admin/enterprises_spec.rb b/spec/system/admin/enterprises_spec.rb index 00c244e7b2f9..b92459f4f134 100644 --- a/spec/system/admin/enterprises_spec.rb +++ b/spec/system/admin/enterprises_spec.rb @@ -137,6 +137,13 @@ select2_select eg1.name, from: 'enterprise_group_ids' + within(".permalink") do + link_path = "#{main_app.root_url}eaterprises-permalink/shop" + link = find_link(link) + expect(link[:href]).to eq link_path + expect(link[:target]).to eq '_blank' + end + accept_alert do click_link "Payment Methods" end