mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-25 20:46:48 +00:00
22 lines
536 B
Ruby
22 lines
536 B
Ruby
# frozen_string_literal: true
|
|
|
|
require 'spec_helper'
|
|
require 'rake'
|
|
|
|
describe 'enterprises.rake' do
|
|
describe ':remove_enterprise' do
|
|
context 'when the enterprises exists' do
|
|
it 'removes the enterprise' do
|
|
enterprise = create(:enterprise)
|
|
|
|
Rake.application.rake_require 'tasks/enterprises'
|
|
Rake::Task.define_task(:environment)
|
|
|
|
expect {
|
|
Rake.application.invoke_task "ofn:remove_enterprise[#{enterprise.id}]"
|
|
}.to change(Enterprise, :count).by(-1)
|
|
end
|
|
end
|
|
end
|
|
end
|