lib/polyblock/capybara_helpers.rb in polyblock-1.1.0 vs lib/polyblock/capybara_helpers.rb in polyblock-1.1.1

- old
+ new

@@ -12,11 +12,11 @@ raise "Locator #{locator} not found!!" end # Fill the editor content page.execute_script <<-SCRIPT var ckeditor = CKEDITOR.instances['#{locator}']; - ckeditor.setData('#{params[:with].gsub("'", "\\'")}'); + ckeditor.setData('#{params[:with].gsub("'", "\\\'")}'); ckeditor.focus(); setTimeout(function(){ ckeditor.updateElement(); }, 1); SCRIPT @@ -27,10 +27,10 @@ page.execute_script <<-SCRIPT var element = $('.polyblock[data-pbname="#{name}"]'); var ckeditor = CKEDITOR.instances[element.attr('id')]; setTimeout(function(){ ckeditor.fire('focus'); - ckeditor.setData('#{params[:with]}'); + ckeditor.setData('#{params[:with].gsub("'", "\\\'")}'); ckeditor.focus(); ckeditor.updateElement(); }, 1); SCRIPT sleep 0.1