From a0b102999afeec902ac45d1dcaeffcfa6c2ff2a0 Mon Sep 17 00:00:00 2001 From: George Claghorn Date: Sun, 19 May 2019 01:47:29 -0400 Subject: Prefer Capybara::Node::Element#execute_script --- actiontext/lib/action_text/system_test_helper.rb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'actiontext/lib') diff --git a/actiontext/lib/action_text/system_test_helper.rb b/actiontext/lib/action_text/system_test_helper.rb index 6c9dcc11a7..7b01c4f0b7 100644 --- a/actiontext/lib/action_text/system_test_helper.rb +++ b/actiontext/lib/action_text/system_test_helper.rb @@ -25,10 +25,7 @@ module ActionText # # # fill_in_rich_text_area "message[content]", with: "Hello world!" def fill_in_rich_text_area(locator, with:) - page.execute_script(<<~JS, find(:rich_text_area, locator).native, with.to_s) - const [element, html] = arguments; - element.editor.loadHTML(html); - JS + find(:rich_text_area, locator).execute_script("this.editor.loadHTML(arguments[0])", with.to_s) end end end -- cgit v1.2.3