aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorge Claghorn <george@basecamp.com>2019-05-19 01:47:29 -0400
committerGeorge Claghorn <george@basecamp.com>2019-05-19 01:47:29 -0400
commita0b102999afeec902ac45d1dcaeffcfa6c2ff2a0 (patch)
treebef42de969111892cd17faa99ca51cb6422db081
parent88b12b2f605b5fbeefdfb4da7e6141de5b85a18f (diff)
downloadrails-a0b102999afeec902ac45d1dcaeffcfa6c2ff2a0.tar.gz
rails-a0b102999afeec902ac45d1dcaeffcfa6c2ff2a0.tar.bz2
rails-a0b102999afeec902ac45d1dcaeffcfa6c2ff2a0.zip
Prefer Capybara::Node::Element#execute_script
-rw-r--r--actiontext/lib/action_text/system_test_helper.rb5
1 files changed, 1 insertions, 4 deletions
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
# # <trix-editor input="trix_input_1"></trix-editor>
# fill_in_rich_text_area "message[content]", with: "Hello <em>world!</em>"
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