-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move webpack tests to a subdirectory
- Loading branch information
Showing
2 changed files
with
34 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
require "test_helper" | ||
|
||
class WebpackInstallerTest < ActiveSupport::TestCase | ||
include RailsAppHelpers | ||
|
||
test "installer for webpack" do | ||
with_new_rails_app do | ||
out, _err = run_command("bin/rails", "javascript:install:webpack") | ||
|
||
assert_equal File.read("#{__dir__}/../../lib/install/Procfile.dev"), File.read("Procfile.dev") | ||
assert_equal File.read("#{__dir__}/../../lib/install/webpack/webpack.config.js"), File.read("webpack.config.js") | ||
|
||
if sprockets? | ||
assert_match "//= link_tree ../images", File.read("app/assets/config/manifest.js") | ||
assert_match "//= link_directory ../stylesheets .css", File.read("app/assets/config/manifest.js") | ||
assert_match "//= link_tree ../builds", File.read("app/assets/config/manifest.js") | ||
end | ||
end | ||
end | ||
|
||
test "installer with pre-existing Procfile" do | ||
with_new_rails_app do | ||
File.write("Procfile.dev", "pre: existing\n") | ||
_out, _err = run_command("bin/rails", "javascript:install:webpack") | ||
|
||
assert_equal "pre: existing\njs: yarn build --watch\n", File.read("Procfile.dev") | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters