The db:dev_seed rake logs info as it progresses as information for the developer. But that's not needed when ran from its tests file, and it bloats the travis/rspec output with unnecessary information. Now the task will always log info unless the rake task receives an optional argument.
15 lines
341 B
Ruby
15 lines
341 B
Ruby
require 'rake'
|
|
require 'rails_helper'
|
|
Rake::Task.define_task(:environment)
|
|
Rake.application.rake_require('tasks/db')
|
|
|
|
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
|