Fix error in dev:populate_sample_data task (#40995)
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
1 parent
88683ac613
commit
0e76219b38
2 files changed
+31
No files matched your search
@@ -0,0 +1,29 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'rails_helper'
|
||||
require 'rake'
|
||||
|
||||
RSpec.describe Rake::Task do
|
||||
describe 'dev:populate_sample_data' do
|
||||
subject { described_class['dev:populate_sample_data'] }
|
||||
|
||||
before do
|
||||
Rails.application.load_tasks
|
||||
subject.reenable
|
||||
end
|
||||
|
||||
describe '.invoke' do
|
||||
context 'when the task is invoked successfully' do
|
||||
it 'runs without aborting' do
|
||||
expect { subject.invoke }.to_not raise_error
|
||||
end
|
||||
|
||||
it 'populates accounts and users' do
|
||||
expect { subject.invoke }
|
||||
.to change(Account, :count).by(3)
|
||||
.and change(User, :count).by(2)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user