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:
parent
4cb93a39e2
commit
added06d3f
1 changed files with 2 additions and 0 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue