diff --git a/railties/test/generators/actions_test.rb b/railties/test/generators/actions_test.rb
index <HASH>..<HASH> 100644
--- a/railties/test/generators/actions_test.rb
+++ b/railties/test/generators/actions_test.rb
@@ -383,6 +383,7 @@ class ActionsTest < Rails::Generators::TestCase
     File.open(route_path, "wb") { |file| file.write(content) }
 
     routes = <<-F
+# frozen_string_literal: true
 Rails.application.routes.draw do
   root 'welcome#index'
 end
@@ -393,6 +394,7 @@ F
     action :route, "resources :product_lines"
 
     routes = <<-F
+# frozen_string_literal: true
 Rails.application.routes.draw do
   resources :product_lines
   root 'welcome#index'
Add frozen string pragma to expected routes files.