Skip to content

Commit

Permalink
Merge pull request consuldemocracy#2201 from wairbut-m2c/aperez-rake-…
Browse files Browse the repository at this point in the history
…tasks-spec

Add spec for 'rake db:dev_seed' task
  • Loading branch information
bertocq authored Dec 20, 2017
2 parents 9a51393 + b00a045 commit c3e8124
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions spec/lib/tasks/dev_seed_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
require 'rails_helper'
require 'rake'

describe 'rake db:dev_seed' do
before do
Rake.application.rake_require('tasks/db')
Rake::Task.define_task(:environment)
end

let :run_rake_task do
Rake::Task['db:dev_seed'].reenable
Rake.application.invoke_task('db:dev_seed')
end

it 'seeds the database without errors' do
expect { run_rake_task }.to_not raise_error
end
end

0 comments on commit c3e8124

Please sign in to comment.