diff --git a/lib/js_routes/generators/base.rb b/lib/js_routes/generators/base.rb index e4bd9c6..9ecd484 100644 --- a/lib/js_routes/generators/base.rb +++ b/lib/js_routes/generators/base.rb @@ -10,7 +10,7 @@ def application_js_path "app/javascript/packs/application.js", "app/javascript/controllers/application.js", ].find do |path| - File.exists?(Rails.root.join(path)) + File.exist?(Rails.root.join(path)) end end end diff --git a/spec/js_routes/module_types/umd_spec.rb b/spec/js_routes/module_types/umd_spec.rb index 2e7503d..f15fb97 100644 --- a/spec/js_routes/module_types/umd_spec.rb +++ b/spec/js_routes/module_types/umd_spec.rb @@ -79,7 +79,7 @@ end it "should not generate file before initialization" do - expect(File.exists?(name)).to be_falsey + expect(File.exist?(name)).to be_falsey end end end diff --git a/spec/js_routes/zzz_last_post_rails_init_spec.rb b/spec/js_routes/zzz_last_post_rails_init_spec.rb index 3010e67..bc61f47 100644 --- a/spec/js_routes/zzz_last_post_rails_init_spec.rb +++ b/spec/js_routes/zzz_last_post_rails_init_spec.rb @@ -47,7 +47,7 @@ def evaluate(ctx, file) end it "should generate routes file" do - expect(File.exists?(NAME)).to be_truthy + expect(File.exist?(NAME)).to be_truthy end it "should not rewrite routes file if nothing changed" do