Skip to content

Commit 432b615

Browse files
authored
Merge pull request rails#43490 from jean-francois-labbe/main
re-add viewport meta tag to application layout
2 parents 0919aa9 + 9e50dd2 commit 432b615

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

railties/lib/rails/generators/rails/app/templates/app/views/layouts/application.html.erb.tt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<html>
33
<head>
44
<title><%= camelized %></title>
5+
<meta name="viewport" content="width=device-width,initial-scale=1">
56
<%%= csrf_meta_tags %>
67
<%%= csp_meta_tag %>
78

railties/test/application/rake_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ class Hello
182182
end
183183

184184
def test_code_statistics
185-
assert_match "Code LOC: 61 Test LOC: 3 Code to Test Ratio: 1:0.0",
185+
assert_match "Code LOC: 62 Test LOC: 3 Code to Test Ratio: 1:0.0",
186186
rails("stats")
187187
end
188188

railties/test/generators/app_generator_test.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,14 @@ def test_does_not_generate_system_test_files_if_skip_system_test_is_given
551551
end
552552
end
553553

554+
def test_viewport_meta_tag_is_present
555+
run_generator [destination_root]
556+
557+
assert_file "app/views/layouts/application.html.erb" do |contents|
558+
assert_match(/<meta name="viewport"/, contents)
559+
end
560+
end
561+
554562
def test_javascript_is_skipped_if_required
555563
run_generator [destination_root, "--skip-javascript"]
556564

0 commit comments

Comments
 (0)