Skip to content

Commit be6c6c1

Browse files
committed
Applying comments from review
1 parent 08097f6 commit be6c6c1

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

test/shopify_app/controller_concerns/login_protection_test.rb

+3-10
Original file line numberDiff line numberDiff line change
@@ -628,16 +628,9 @@ def assert_fullpage_redirected(shop_domain, expect_embedded)
628628
assert_equal "{\"myshopifyUrl\":\"https://#{shop_domain}\",\"url\":\"#{example_url}\"}",
629629
elements.first["data-target"]
630630
end
631-
632-
if expect_embedded
633-
assert_select "script", 2 do |elements|
634-
assert_equal "https://cdn.shopify.com/shopifycloud/app-bridge.js", elements[0]["src"]
635-
assert_match %r/\/assets\/shopify_app\/redirect-[^\.]*\.js/, elements[1]["src"]
636-
end
637-
else
638-
assert_select "script", 1 do |elements|
639-
assert_match %r/\/assets\/shopify_app\/redirect-[^\.]*\.js/, elements[0]["src"]
640-
end
631+
assert_select "script" do |elements|
632+
assert elements.any? { |element| element["src"] =~ %r/\/assets\/shopify_app\/redirect-[^\.]*\.js/ }
633+
assert_equal expect_embedded, elements.any? { |element| element["src"] == "https://cdn.shopify.com/shopifycloud/app-bridge.js" }
641634
end
642635
end
643636

0 commit comments

Comments
 (0)