提交 b93fc47c 编写于 作者: G Gannon McGibbon

Remove redundant suffixes on generated system tests.

上级 57423440
* Remove redundant suffixes on generated system tests.
*Gannon McGibbon*
* Add an `abort_on_failure` boolean option to the generator method that shell
out (`generate`, `rake`, `rails_command`) to abort the generator if the
command fails.
......
......@@ -14,6 +14,11 @@ def create_test_files
template "system_test.rb", File.join("test/system", class_path, "#{file_name.pluralize}_test.rb")
end
private
def file_name
@_file_name ||= super.sub(/_test\z/i, "")
end
end
end
end
......@@ -16,4 +16,18 @@ def test_namespaced_system_test_skeleton_is_created
run_generator %w(admin/user)
assert_file "test/system/admin/users_test.rb", /class Admin::UsersTest < ApplicationSystemTestCase/
end
def test_test_name_is_pluralized
run_generator %w(user)
assert_no_file "test/system/user_test.rb"
assert_file "test/system/users_test.rb"
end
def test_test_suffix_is_not_duplicated
run_generator %w(users_test)
assert_no_file "test/system/users_test_test.rb"
assert_file "test/system/users_test.rb"
end
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册