Calling `load_tasks` in several files made rails load the tasks several times, and so they were executed several times when called. Since the milestone migration can't be executed twice in a row (it would fail with duplicated ID records), loading the tasks several times made the milestone migrations task specs fail.
12 lines
247 B
Ruby
12 lines
247 B
Ruby
require 'rails_helper'
|
|
|
|
describe 'rake db:dev_seed' do
|
|
let :run_rake_task do
|
|
Rake.application.invoke_task('db:dev_seed[avoid_log]')
|
|
end
|
|
|
|
it 'seeds the database without errors' do
|
|
expect { run_rake_task }.not_to raise_error
|
|
end
|
|
end
|