Added test when task generator called on revoke
This commit is contained in:
parent
91f53dbd7a
commit
d4265021d0
|
@ -7,6 +7,18 @@ class TaskGeneratorTest < Rails::Generators::TestCase
|
|||
|
||||
def test_task_is_created
|
||||
run_generator
|
||||
assert_file "lib/tasks/feeds.rake", /namespace :feeds/
|
||||
assert_file "lib/tasks/feeds.rake" do |content|
|
||||
assert_match(/namespace :feeds/, content)
|
||||
assert_match(/task foo:/, content)
|
||||
assert_match(/task bar:/, content)
|
||||
end
|
||||
end
|
||||
|
||||
def test_task_on_revoke
|
||||
task_path = 'lib/tasks/feeds.rake'
|
||||
run_generator
|
||||
assert_file task_path
|
||||
run_generator ['feeds'], behavior: :revoke
|
||||
assert_no_file task_path
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue