Skip to content

Commit

Permalink
テストを修正
Browse files Browse the repository at this point in the history
  • Loading branch information
yasuhito committed Jun 4, 2024
1 parent 3882911 commit 04c5d33
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 3 additions & 1 deletion apps/www/test/application_system_test_case.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@

# rubocop:disable Metrics/ClassLength
class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
driven_by :selenium_chrome_headless
driven_by(:selenium, using: :headless_chrome) do |driver_option|
driver_option.add_argument('--headless=new')
end

def assert_steps(number)
assert_selector 'circuit-step:not([data-shadow])', count: number
Expand Down
10 changes: 8 additions & 2 deletions apps/www/test/system/share_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ class ShareTest < ApplicationSystemTestCase
assert_equal 2, windows.size
within_window windows[1] do
json = URI.encode_www_form_component('{"cols":[]}')
assert_equal "https://twitter.com/share?hashtags=qni&url=#{current_session_base_url}/#{json}", CGI.unescape(current_url)
url = CGI.unescape(current_url)
expected_url = "https://x.com/share?hashtags=qni&url=#{current_session_base_url}/#{json}"

assert expected_url.include?(expected_url), "Expected '#{url}' to include '#{expected_url}'"
end
end

Expand All @@ -79,7 +82,10 @@ class ShareTest < ApplicationSystemTestCase

within_window windows[1] do
json = URI.encode_www_form_component('{"cols":[],"title":"Grover反復"}')
assert_equal "https://twitter.com/share?text=Grover反復&hashtags=qni&url=#{current_session_base_url}/#{json}", CGI.unescape(current_url)
url = CGI.unescape(current_url)
expected_url = "https://x.com/share?text=Grover反復&hashtags=qni&url=#{current_session_base_url}/#{json}"

assert expected_url.include?(expected_url), "Expected '#{url}' to include '#{expected_url}'"
end
end
end

0 comments on commit 04c5d33

Please sign in to comment.