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
@@ -17,6 +17,7 @@ namespace :dev do
|
||||
).find_or_create_by!(id: 10_000_000)
|
||||
showcase_user.mark_email_as_confirmed!
|
||||
showcase_user.approve!
|
||||
showcase_account.reload
|
||||
|
||||
french_post = Status.create_with(
|
||||
text: 'Ceci est un sondage public écrit en Français',
|
||||
@@ -200,6 +201,7 @@ namespace :dev do
|
||||
domain: 'example.org',
|
||||
uri: 'https://example.org/foo/bar',
|
||||
url: 'https://example.org/foo/bar',
|
||||
inbox_url: 'https://example.org/users/fake.example/inbox',
|
||||
locked: true
|
||||
).find_or_create_by!(id: 10_000_001)
|
||||
|
||||
|
||||
@@ -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