From e287b28909027184ce2b02beeb8eebfaa38d0c66 Mon Sep 17 00:00:00 2001 From: ishikawa999 Date: Thu, 18 Mar 2021 00:48:35 +0000 Subject: [PATCH 2/2] Fix to change the shortcut key according to the OS --- test/system/copy_to_clipboard_test.rb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/test/system/copy_to_clipboard_test.rb b/test/system/copy_to_clipboard_test.rb index c54508fea..34070b940 100644 --- a/test/system/copy_to_clipboard_test.rb +++ b/test/system/copy_to_clipboard_test.rb @@ -36,7 +36,7 @@ class CopyToClipboardSystemTest < ApplicationSystemTestCase # Paste the value copied to the clipboard into the textarea to get and test first('.icon-edit').click - find('textarea#issue_notes').send_keys([:control, 'v']) + find('textarea#issue_notes').send_keys([modifier_key, 'v']) assert find('textarea#issue_notes').value.end_with?('/issues/1') end @@ -50,7 +50,14 @@ class CopyToClipboardSystemTest < ApplicationSystemTestCase # Paste the value copied to the clipboard into the textarea to get and test first('.icon-edit').click - find('textarea#issue_notes').send_keys([:control, 'v']) + find('textarea#issue_notes').send_keys([modifier_key, 'v']) assert find('textarea#issue_notes').value.end_with?('/issues/1#note-2') end + + private + + def modifier_key + modifier = osx? ? "command" : "control" + modifier.to_sym + end end -- 2.11.0