1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Add a few more assertions

This commit is contained in:
John Hawthorn 2019-10-09 19:48:13 -07:00
parent 4cb93a39e2
commit added06d3f

View file

@ -43,6 +43,7 @@ module ApplicationTests
def assert_file_exists(filename)
globbed = Dir[filename]
assert Dir.exist?(File.dirname(filename)), "Directory #{File.dirname(filename)} does not exist"
assert globbed.one?, "Found #{globbed.size} files matching #{filename}. All files in the directory: #{Dir.entries(File.dirname(filename)).inspect}"
end
@ -418,6 +419,7 @@ module ApplicationTests
precompile!
assert_file_exists("#{app_path}/public/assets/application-*.js")
assert_match(/Post;/, File.read(Dir["#{app_path}/public/assets/application-*.js"].first))
end