From a103b5392ef291e52cda76313eb435e04eaf2bf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Fri, 17 Apr 2020 16:15:33 +0200 Subject: [PATCH] Use more consistent parameter names I incorrectly used "text" as variable name in commit 2cdc6a1b. In similar places, we use `label`. We also use named parameters when only `with:` is provided. --- spec/support/common_actions/verifications.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/support/common_actions/verifications.rb b/spec/support/common_actions/verifications.rb index 72723dcfa..92ef462e0 100644 --- a/spec/support/common_actions/verifications.rb +++ b/spec/support/common_actions/verifications.rb @@ -44,8 +44,8 @@ module Verifications end end - def fill_in_ckeditor(text, params = {}) - locator = find("label", text: text)[:for] + def fill_in_ckeditor(label, with:) + locator = find("label", text: label)[:for] until page.execute_script("return CKEDITOR.instances.#{locator}.status === 'ready';") do sleep 0.01 @@ -54,11 +54,11 @@ module Verifications # Fill the editor content page.execute_script <<-SCRIPT var ckeditor = CKEDITOR.instances.#{locator} - ckeditor.setData("#{params[:with]}") + ckeditor.setData("#{with}") ckeditor.focus() ckeditor.updateElement() SCRIPT - expect(page).to have_ckeditor text, with: params[:with] + expect(page).to have_ckeditor label, with: with end end