Files
mastodon/spec/lib/rake/task_devpopulate_sample_data_spec.rb
jcoffey-dev 4dfbb64241
Chromatic / Check for relevant changes (push) Canceled after 0s
Chromatic / Run Chromatic (push) Canceled after 0s
Import Mastodon v4.7.4
Snapshot of upstream tag v4.7.4 (commit d04059fc80be5cbba6b4dd5a8b94d63ffff09f2c) from
https://github.com/mastodon/mastodon, unmodified.
2026-10-29 08:11:58 -07:00

30 lines
716 B
Ruby

# 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 unless described_class.tasks.any?
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