diff --git a/README.md b/README.md index 311dbfb..daef333 100644 --- a/README.md +++ b/README.md @@ -85,7 +85,7 @@ When errors are raised, the Rails test environment may not behave as in producti # Testing Rake Tasks with RSpec RSpec testing Rake task configuration and example: -- [spec/support/tasks.rb](spec/support/tasks.rb) +- [spec/support/tasks.rb](spec/support/tasks.rb) essential to load Rake tasks before specs run - [spec/tasks/subscription_tasks_spec.rb](spec/tasks/subscription_tasks_spec.rb) diff --git a/spec/tasks/subscription_tasks_spec.rb b/spec/tasks/subscription_tasks_spec.rb index bad307d..1c12b14 100644 --- a/spec/tasks/subscription_tasks_spec.rb +++ b/spec/tasks/subscription_tasks_spec.rb @@ -1,5 +1,7 @@ require 'rails_helper' +# IMPORTANT: Add spec/support/tasks.rb to your project to load rake tasks. + RSpec.describe "Subscription tasks", :type => :task do context "subscription:confirmation_overdue:delete" do @@ -34,7 +36,7 @@ def invoke_task task = Rake::Task["subscription:confirmation_overdue:delete"] - # Ensure task is re-enabled, as rake tasks by default are disabled + # Ensure task is re-enabled, as rake tasks by default are disabled # after running once within a process http://pivotallabs.com/how-i-test-rake-tasks/ task.reenable task.invoke