Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,6 @@ jobs:
gemfile: gemfiles/Gemfile-rails.6.0.x
experimental: [false]
include:
- ruby: 2.5
os: ubuntu-latest
gemfile: gemfiles/Gemfile-rails-edge
experimental: true
- ruby: 2.6
os: ubuntu-latest
gemfile: gemfiles/Gemfile-rails-edge
experimental: true
- ruby: 2.7
os: ubuntu-latest
gemfile: gemfiles/Gemfile-rails-edge
Expand Down
2 changes: 1 addition & 1 deletion gemfiles/Gemfile-rails-edge
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }

gemspec path: "../"

gem "rails", github: "rails/rails"
gem "rails", github: "rails/rails", branch: "main"
gem "arel", github: "rails/arel"
gem "rake", ">= 11.1"
gem "rack-proxy", require: false
Expand Down
30 changes: 21 additions & 9 deletions test/helper_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,29 +117,41 @@ def test_preload_pack_asset
end

def test_stylesheet_pack_tag_split_chunks
assert_equal \
%(<link rel="stylesheet" media="screen" href="/packs/1-c20632e7baf2c81200d3.chunk.css" />\n) +
assert_equal stylesheet_packs_with_chunks_tag("application", "hello_stimulus").in?([
%(<link rel="stylesheet" href="/packs/1-c20632e7baf2c81200d3.chunk.css" media="screen" />\n) +
%(<link rel="stylesheet" href="/packs/application-k344a6d59eef8632c9d1.chunk.css" media="screen" />\n) +
%(<link rel="stylesheet" href="/packs/hello_stimulus-k344a6d59eef8632c9d1.chunk.css" media="screen" />),

%(<link rel="stylesheet" media="screen" href="/packs/1-c20632e7baf2c81200d3.chunk.css" />\n) +
%(<link rel="stylesheet" media="screen" href="/packs/application-k344a6d59eef8632c9d1.chunk.css" />\n) +
%(<link rel="stylesheet" media="screen" href="/packs/hello_stimulus-k344a6d59eef8632c9d1.chunk.css" />),
stylesheet_packs_with_chunks_tag("application", "hello_stimulus")
]),
true
end

def test_stylesheet_pack_tag
assert_equal \
assert_equal stylesheet_pack_tag("bootstrap.css").in?([
%(<link rel="stylesheet" href="/packs/bootstrap-c38deda30895059837cf.css" media="screen" />),

%(<link rel="stylesheet" media="screen" href="/packs/bootstrap-c38deda30895059837cf.css" />),
stylesheet_pack_tag("bootstrap.css")
]), true
end

def test_stylesheet_pack_tag_symbol
assert_equal \
assert_equal stylesheet_pack_tag(:bootstrap).in?([
%(<link rel="stylesheet" href="/packs/bootstrap-c38deda30895059837cf.css" media="screen" />),

%(<link rel="stylesheet" media="screen" href="/packs/bootstrap-c38deda30895059837cf.css" />),
stylesheet_pack_tag(:bootstrap)
]), true
end

def test_stylesheet_pack_tag_splat
assert_equal \
assert_equal stylesheet_pack_tag("bootstrap.css", "application.css", media: "all").in?([
%(<link rel="stylesheet" href="/packs/bootstrap-c38deda30895059837cf.css" media="all" />\n) +
%(<link rel="stylesheet" href="/packs/application-dd6b1cd38bfa093df600.css" media="all" />),

%(<link rel="stylesheet" media="all" href="/packs/bootstrap-c38deda30895059837cf.css" />\n) +
%(<link rel="stylesheet" media="all" href="/packs/application-dd6b1cd38bfa093df600.css" />),
stylesheet_pack_tag("bootstrap.css", "application.css", media: "all")
]), true
end
end