diff --git a/.travis.yml b/.travis.yml
index cffa53cb..d559f422 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -7,8 +7,10 @@ rvm:
- 2.1.10
- 2.2.9
- 2.3.6
- - 2.4.3
- - 2.5.0
+ - 2.4.10
+ - 2.5.8
+ - 2.6.6
+ - 2.7.1
- jruby
- ruby-head
matrix:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d6de41bd..c1fd4b2a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,26 @@
+## 4.6.1
+
+- update jquery to 3.7.1
+
+## 4.6.0
+
+- update jquery to 3.7.0
+
+## 4.5.1
+
+- update jquery to 3.6.1
+- update jquery-ujs to 1.2.3
+
+## 4.5.0
+
+- update jquery to 3.6.0
+
+## 4.4.0
+
+- update jquery to 3.5.1 (note: [3.5.0 contains important security updates](https://github.com/advisories/GHSA-jpcq-cgw6-v4j6))
+- unescape dollar signs and backticks in `assert_select_jquery` to match
+ Rails updated behavior.
+
## 4.3.5
- update jquery to 3.4.1
@@ -15,7 +38,7 @@
- update jquery to 3.3.0
- Add possibility to test HTML: all, attribute prefix, attribute contains,
attribute ends with, child, and class selectors
-- Fix matching mutiple calls for the same selector/function exception
+- Fix matching multiple calls for the same selector/function exception
## 4.3.1
diff --git a/VERSIONS.md b/VERSIONS.md
index 7768a85f..2ba46a11 100644
--- a/VERSIONS.md
+++ b/VERSIONS.md
@@ -2,6 +2,11 @@
| Gem | jQuery | jQuery UJS | jQuery UI |
|--------|--------|------------| ----------|
+| 4.6.1 | 1.12.4 & 2.2.4 & 3.7.1 | 1.2.3 | - |
+| 4.6.0 | 1.12.4 & 2.2.4 & 3.7.0 | 1.2.3 | - |
+| 4.5.1 | 1.12.4 & 2.2.4 & 3.6.1 | 1.2.3 | - |
+| 4.5.0 | 1.12.4 & 2.2.4 & 3.6.0 | 1.2.2 | - |
+| 4.4.0 | 1.12.4 & 2.2.4 & 3.5.1 | 1.2.2 | - |
| 4.3.5 | 1.12.4 & 2.2.4 & 3.4.1 | 1.2.2 | - |
| 4.3.4 | 1.12.4 & 2.2.4 & 3.4.0 | 1.2.2 | - |
| 4.3.3 | 1.12.4 & 2.2.4 & 3.3.1 | 1.2.2 | - |
diff --git a/lib/jquery/assert_select.rb b/lib/jquery/assert_select.rb
index debf99d1..1d82fb53 100644
--- a/lib/jquery/assert_select.rb
+++ b/lib/jquery/assert_select.rb
@@ -124,6 +124,8 @@ def unescape_js(js_string)
unescaped.gsub!('\n', "\n")
unescaped.gsub!('\076', '>')
unescaped.gsub!('\074', '<')
+ unescaped.gsub!(/\\\$/, '$')
+ unescaped.gsub!(/\\`/, '`')
# js encodes non-ascii characters.
unescaped.gsub!(PATTERN_UNICODE_ESCAPED_CHAR) {|u| [$1.hex].pack('U*')}
unescaped
diff --git a/lib/jquery/rails/version.rb b/lib/jquery/rails/version.rb
index 0310e7fa..a736a0d3 100644
--- a/lib/jquery/rails/version.rb
+++ b/lib/jquery/rails/version.rb
@@ -1,9 +1,9 @@
module Jquery
module Rails
- VERSION = "4.3.5"
+ VERSION = "4.6.1"
JQUERY_VERSION = "1.12.4"
JQUERY_2_VERSION = "2.2.4"
- JQUERY_3_VERSION = "3.4.1"
- JQUERY_UJS_VERSION = "1.2.2"
+ JQUERY_3_VERSION = "3.7.1"
+ JQUERY_UJS_VERSION = "1.2.3"
end
end
diff --git a/test/assert_select_jquery_test.rb b/test/assert_select_jquery_test.rb
index 90c6dcb0..632b0c2d 100644
--- a/test/assert_select_jquery_test.rb
+++ b/test/assert_select_jquery_test.rb
@@ -23,6 +23,8 @@ class AssertSelectJQueryTest < ActiveSupport::TestCase
// without semicolon
$("#browser_cart").hide("blind", 1000)
+
+ $('#item').html('
\\`Total\\`: \\$12.34
');
JS
setup do
@@ -43,6 +45,10 @@ def test_target_as_receiver
assert_select_jquery :remove, "#cart tr:not(.total_line) > *"
assert_select_jquery :remove, "[href|=\"val\"][href$=\"val\"][href^=\"val\"]"
assert_select_jquery :remove, "tr + td, li"
+
+ assert_select_jquery :html, '#item' do
+ assert_select 'span', '`Total`: $12.34'
+ end
end
assert_raise Minitest::Assertion, "No JQuery call matches [:show, :some_wrong]" do
diff --git a/vendor/assets/javascripts/jquery3.js b/vendor/assets/javascripts/jquery3.js
index 773ad95c..1a86433c 100644
--- a/vendor/assets/javascripts/jquery3.js
+++ b/vendor/assets/javascripts/jquery3.js
@@ -1,15 +1,12 @@
/*!
- * jQuery JavaScript Library v3.4.1
+ * jQuery JavaScript Library v3.7.1
* https://jquery.com/
*
- * Includes Sizzle.js
- * https://sizzlejs.com/
- *
- * Copyright JS Foundation and other contributors
+ * Copyright OpenJS Foundation and other contributors
* Released under the MIT license
* https://jquery.org/license
*
- * Date: 2019-05-01T21:04Z
+ * Date: 2023-08-28T13:37Z
*/
( function( global, factory ) {
@@ -23,7 +20,7 @@
// (such as Node.js), expose a factory as module.exports.
// This accentuates the need for the creation of a real `window`.
// e.g. var jQuery = require("jquery")(window);
- // See ticket #14549 for more info.
+ // See ticket trac-14549 for more info.
module.exports = global.document ?
factory( global, true ) :
function( w ) {
@@ -47,13 +44,16 @@
var arr = [];
-var document = window.document;
-
var getProto = Object.getPrototypeOf;
var slice = arr.slice;
-var concat = arr.concat;
+var flat = arr.flat ? function( array ) {
+ return arr.flat.call( array );
+} : function( array ) {
+ return arr.concat.apply( [], array );
+};
+
var push = arr.push;
@@ -73,12 +73,16 @@ var support = {};
var isFunction = function isFunction( obj ) {
- // Support: Chrome <=57, Firefox <=52
- // In some browsers, typeof returns "function" for HTML