Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the shop url clickable #9529

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/views/admin/enterprises/form/_primary_details.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
- front_shop_path = "#{main_app.root_url}#{@enterprise.permalink}/shop"
= link_to front_shop_path, front_shop_path , target: "_blank"
.row
.three.columns.alpha
= f.label :id, t('.ofn_uid')
Expand Down
13 changes: 10 additions & 3 deletions spec/system/admin/enterprises_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,13 @@

select2_select eg1.name, from: 'enterprise_group_ids'

within(".permalink") do
link_path = "#{main_app.root_url}#{@enterprise.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
Expand Down Expand Up @@ -186,7 +193,7 @@
shop_message_input = page.find("text-angular#enterprise_preferred_shopfront_message div[id^='taTextElement']")
shop_message_input.native.send_keys('This is my shopfront message.')
expect(page).to have_checked_field "enterprise_preferred_shopfront_order_cycle_order_orders_close_at"
#using "find" as fields outside of the screen and are not visible
#using "find" as fields outside of the screen and are not visible
Philwi marked this conversation as resolved.
Show resolved Hide resolved
find(:xpath, '//*[@id="enterprise_preferred_shopfront_order_cycle_order_orders_open_at"]').trigger("click")
find(:xpath, '//*[@id="enterprise_enable_subscriptions_true"]').trigger("click")

Expand Down Expand Up @@ -483,7 +490,7 @@
within(".side_menu") do
click_link "Shop Preferences"
end

Philwi marked this conversation as resolved.
Show resolved Hide resolved
choose "enterprise_preferred_shopfront_product_sorting_method_by_category"
find("#s2id_autogen7").click
find(".select2-result-label", text: "Tricky Taxon").click
Expand All @@ -504,7 +511,7 @@
within(".side_menu") do
click_link "Shop Preferences"
end

Philwi marked this conversation as resolved.
Show resolved Hide resolved
choose "enterprise_preferred_shopfront_product_sorting_method_by_producer"
find("#s2id_autogen8").click
find(".select2-result-label", text: "First Supplier").click
Expand Down