Skip to content

Commit

Permalink
Merge pull request #50688 from skipkayhil/hm-backport-48183-6-1
Browse files Browse the repository at this point in the history
Fix 6-1-stable CI
  • Loading branch information
rafaelfranca committed Jan 10, 2024
2 parents b035464 + cab1b81 commit 517ff4b
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 17 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ gem "rexml", require: false
# for railties
gem "bootsnap", ">= 1.4.4", require: false
gem "webrick", require: false
gem "readline-ext", require: false

# Active Job
group :job do
Expand Down
2 changes: 2 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@ GEM
rb-inotify (0.10.1)
ffi (~> 1.0)
rdoc (6.3.1)
readline-ext (0.2.0)
redcarpet (3.2.3)
redis (4.2.5)
regexp_parser (2.1.1)
Expand Down Expand Up @@ -612,6 +613,7 @@ DEPENDENCIES
rack-test (< 2)
rails!
rake (>= 13)
readline-ext
redcarpet (~> 3.2.3)
redis (~> 4.0)
redis-namespace!
Expand Down
51 changes: 34 additions & 17 deletions railties/test/application/asset_debugging_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,18 @@ class ::PostsController < ActionController::Base ; end
image_submit_tag: %r{<input type="image" src="/images/#{contents}" />}
}

class ::PostsController < ActionController::Base
def index
render params[:view_method]
end
end

cases.each do |(view_method, tag_match)|
app_file "app/views/posts/index.html.erb", "<%= #{view_method} '#{contents}', skip_pipeline: true %>"
app_file "app/views/posts/#{view_method}.html.erb", "<%= #{view_method} '#{contents}', skip_pipeline: true %>"

app "development"

class ::PostsController < ActionController::Base ; end

get "/posts?debug_assets=true"
get "/posts?debug_assets=true&view_method=#{view_method}"

body = last_response.body
assert_match(tag_match, body, "Expected `#{view_method}` to produce a match to #{tag_match}, but did not: #{body}")
Expand All @@ -111,14 +115,18 @@ class ::PostsController < ActionController::Base ; end
stylesheet_url: %r{http://example.org/stylesheets/#{contents}},
}

class ::PostsController < ActionController::Base
def index
render params[:view_method]
end
end

cases.each do |(view_method, tag_match)|
app_file "app/views/posts/index.html.erb", "<%= #{view_method} '#{contents}', skip_pipeline: true %>"
app_file "app/views/posts/#{view_method}.html.erb", "<%= #{view_method} '#{contents}', skip_pipeline: true %> "

app "development"

class ::PostsController < ActionController::Base ; end

get "/posts?debug_assets=true"
get "/posts?debug_assets=true&view_method=#{view_method}"

body = last_response.body
assert_match(tag_match, body, "Expected `#{view_method}` to produce a match to #{tag_match}, but did not: #{body}")
Expand All @@ -130,14 +138,19 @@ class ::PostsController < ActionController::Base ; end
/\/assets\/application-.*.\.js/ => {},
/application.js/ => { skip_pipeline: true },
}
cases.each do |(tag_match, options_hash)|
app_file "app/views/posts/index.html.erb", "<%= asset_path('application.js', #{options_hash}) %>"

app "development"
class ::PostsController < ActionController::Base
def index
render params[:version]
end
end

class ::PostsController < ActionController::Base ; end
cases.each_with_index do |(tag_match, options_hash), index|
app_file "app/views/posts/version_#{index}.html.erb", "<%= asset_path('application.js', #{options_hash}) %>"

app "development"

get "/posts?debug_assets=true"
get "/posts?debug_assets=true&version=version_#{index}"

body = last_response.body.strip
assert_match(tag_match, body, "Expected `asset_path` with `#{options_hash}` to produce a match to #{tag_match}, but did not: #{body}")
Expand All @@ -150,14 +163,18 @@ class ::PostsController < ActionController::Base ; end
public_compute_asset_path: /application.js/,
}

class ::PostsController < ActionController::Base
def index
render params[:view_method]
end
end

cases.each do |(view_method, tag_match)|
app_file "app/views/posts/index.html.erb", "<%= #{ view_method } 'application.js' %>"
app_file "app/views/posts/#{view_method}.html.erb", "<%= #{ view_method } 'application.js' %>"

app "development"

class ::PostsController < ActionController::Base ; end

get "/posts?debug_assets=true"
get "/posts?debug_assets=true&view_method=#{view_method}"

body = last_response.body.strip
assert_match(tag_match, body, "Expected `#{view_method}` to produce a match to #{ tag_match }, but did not: #{ body }")
Expand Down

0 comments on commit 517ff4b

Please sign in to comment.