diff options
Diffstat (limited to 'actionview')
-rw-r--r-- | actionview/CHANGELOG.md | 5 | ||||
-rw-r--r-- | actionview/README.rdoc | 4 | ||||
-rw-r--r-- | actionview/RUNNING_UJS_TESTS.rdoc | 9 | ||||
-rw-r--r-- | actionview/RUNNING_UNIT_TESTS.rdoc | 13 | ||||
-rw-r--r-- | actionview/lib/action_view/gem_version.rb | 2 | ||||
-rw-r--r-- | actionview/lib/action_view/helpers/asset_tag_helper.rb | 4 | ||||
-rw-r--r-- | actionview/package.json | 2 | ||||
-rw-r--r-- | actionview/test/template/asset_tag_helper_test.rb | 30 |
8 files changed, 52 insertions, 17 deletions
diff --git a/actionview/CHANGELOG.md b/actionview/CHANGELOG.md index c866cdcc33..125f7f7555 100644 --- a/actionview/CHANGELOG.md +++ b/actionview/CHANGELOG.md @@ -1,3 +1,8 @@ +## Rails 5.2.0.beta2 (November 28, 2017) ## + +* No changes. + + ## Rails 5.2.0.beta1 (November 27, 2017) ## * Change `form_with` to generates ids by default. diff --git a/actionview/README.rdoc b/actionview/README.rdoc index d5029599b7..03a0723564 100644 --- a/actionview/README.rdoc +++ b/actionview/README.rdoc @@ -11,7 +11,7 @@ The latest version of Action View can be installed with RubyGems: $ gem install actionview -Source code can be downloaded as part of the Rails project on GitHub +Source code can be downloaded as part of the Rails project on GitHub: * https://github.com/rails/rails/tree/master/actionview @@ -29,7 +29,7 @@ API documentation is at * http://api.rubyonrails.org -Bug reports can be filed for the Ruby on Rails project here: +Bug reports for the Ruby on Rails project can be filed here: * https://github.com/rails/rails/issues diff --git a/actionview/RUNNING_UJS_TESTS.rdoc b/actionview/RUNNING_UJS_TESTS.rdoc index a575624a06..e30c2aee55 100644 --- a/actionview/RUNNING_UJS_TESTS.rdoc +++ b/actionview/RUNNING_UJS_TESTS.rdoc @@ -1,7 +1,8 @@ == Running UJS tests -Ensure that you can build the project and run tests. -Run rake ujs:server first, and then run the web tests by -visiting http://localhost:4567 in your browser. +Ensure that you can build the project by running: + rake ujs:server -rake ujs:server +Then run the web tests by visiting the following URL in your browser: + + http://localhost:4567 diff --git a/actionview/RUNNING_UNIT_TESTS.rdoc b/actionview/RUNNING_UNIT_TESTS.rdoc index e99d5ca1df..4442dbdb9e 100644 --- a/actionview/RUNNING_UNIT_TESTS.rdoc +++ b/actionview/RUNNING_UNIT_TESTS.rdoc @@ -2,13 +2,13 @@ The easiest way to run the unit tests is through Rake. The default task runs the entire test suite for all classes. For more information, checkout the -full array of rake tasks with "rake -T" +full array of rake tasks with <tt>rake -T</tt> Rake can be found at https://ruby.github.io/rake/. == Running by hand -To run a single test suite +Run a single test suite: rake test TEST=path/to/test.rb @@ -18,10 +18,9 @@ which can be further narrowed down to one test: == Dependency on Active Record and database setup -Test cases in the test/activerecord/ directory depend on having -activerecord and sqlite3 installed. If Active Record is not in -actionview/../activerecord directory, or the sqlite3 rubygem is not installed, -these tests are skipped. - +Test cases in the +test/activerecord/+ directory depend on having +activerecord+ and +sqlite3+ installed. If Active Record is not in +actionview/../activerecord+ directory, or the +sqlite3+ Ruby gem is not installed, + these tests are skipped. Other tests are runnable from a fresh copy of actionview without any configuration. diff --git a/actionview/lib/action_view/gem_version.rb b/actionview/lib/action_view/gem_version.rb index ef233e23ef..ff7f2bb853 100644 --- a/actionview/lib/action_view/gem_version.rb +++ b/actionview/lib/action_view/gem_version.rb @@ -10,7 +10,7 @@ module ActionView MAJOR = 5 MINOR = 2 TINY = 0 - PRE = "beta1" + PRE = "beta2" STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".") end diff --git a/actionview/lib/action_view/helpers/asset_tag_helper.rb b/actionview/lib/action_view/helpers/asset_tag_helper.rb index e362f13798..f37f2ee0ff 100644 --- a/actionview/lib/action_view/helpers/asset_tag_helper.rb +++ b/actionview/lib/action_view/helpers/asset_tag_helper.rb @@ -91,7 +91,7 @@ module ActionView content_tag("script".freeze, "", tag_options) }.join("\n").html_safe - request.send_early_hints("Link" => early_hints_links.join("\n")) if respond_to?(:request) + request.send_early_hints("Link" => early_hints_links.join("\n")) if respond_to?(:request) && request sources_tags end @@ -140,7 +140,7 @@ module ActionView tag(:link, tag_options) }.join("\n").html_safe - request.send_early_hints("Link" => early_hints_links.join("\n")) if respond_to?(:request) + request.send_early_hints("Link" => early_hints_links.join("\n")) if respond_to?(:request) && request sources_tags end diff --git a/actionview/package.json b/actionview/package.json index a8f35ad26f..787ae06208 100644 --- a/actionview/package.json +++ b/actionview/package.json @@ -1,6 +1,6 @@ { "name": "rails-ujs", - "version": "5.2.0-beta1", + "version": "5.2.0-beta2", "description": "Ruby on Rails unobtrusive scripting adapter", "main": "lib/assets/compiled/rails-ujs.js", "files": [ diff --git a/actionview/test/template/asset_tag_helper_test.rb b/actionview/test/template/asset_tag_helper_test.rb index 7475f5cc3c..a8b66191bc 100644 --- a/actionview/test/template/asset_tag_helper_test.rb +++ b/actionview/test/template/asset_tag_helper_test.rb @@ -440,6 +440,14 @@ class AssetTagHelperTest < ActionView::TestCase } end + def test_stylesheet_link_tag_without_request + @request = nil + assert_dom_equal( + %(<link rel="stylesheet" media="screen" href="/stylesheets/foo.css" />), + stylesheet_link_tag("foo.css") + ) + end + def test_stylesheet_link_tag_is_html_safe assert stylesheet_link_tag("dir/file").html_safe? assert stylesheet_link_tag("dir/other/file", "dir/file2").html_safe? @@ -464,6 +472,11 @@ class AssetTagHelperTest < ActionView::TestCase assert_dom_equal %(<link href="//assets.example.com/stylesheets/wellington.css" media="screen" rel="stylesheet" />), stylesheet_link_tag("wellington") end + def test_javascript_include_tag_without_request + @request = nil + assert_dom_equal %(<script src="/javascripts/foo.js"></script>), javascript_include_tag("foo.js") + end + def test_image_path ImagePathToTag.each { |method, tag| assert_dom_equal(tag, eval(method)) } end @@ -778,6 +791,23 @@ class AssetTagHelperNonVhostTest < ActionView::TestCase end end +class AssetTagHelperWithoutRequestTest < ActionView::TestCase + tests ActionView::Helpers::AssetTagHelper + + undef :request + + def test_stylesheet_link_tag_without_request + assert_dom_equal( + %(<link rel="stylesheet" media="screen" href="/stylesheets/foo.css" />), + stylesheet_link_tag("foo.css") + ) + end + + def test_javascript_include_tag_without_request + assert_dom_equal %(<script src="/javascripts/foo.js"></script>), javascript_include_tag("foo.js") + end +end + class AssetUrlHelperControllerTest < ActionView::TestCase tests ActionView::Helpers::AssetUrlHelper |