You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- require 'rails_helper'
- require 'rake'
-
- RSpec.describe 'post:sync' do
- around do |example|
- original_application = Rake.application
- Rake.application = Rake::Application.new
-
- Rake::Task.define_task(:environment)
- load Rails.root.join('lib/tasks/sync_posts.rake')
-
- example.run
- ensure
- Rake.application = original_application
- end
-
- it 'runs Youtube::Sync' do
- sync = instance_double(Youtube::Sync)
-
- expect(Youtube::Sync).to receive(:new).once.and_return(sync)
- expect(sync).to receive(:sync!).once
-
- Rake::Task['post:sync'].invoke
- end
- end
|