Created
April 1, 2014 18:05
-
-
Save rusllonrails/9919635 to your computer and use it in GitHub Desktop.
Rspec cover class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lib/tasks/dummy.rake | |
namespace :db do | |
desc "Add system data" | |
task dummy: :environment do | |
SeedDummyData.run | |
end | |
end | |
class SeedDummyData | |
class << self | |
def run | |
do_something | |
end | |
def do_something | |
...here your logic bla bla bla | |
end | |
end | |
end | |
spec/tasks/seed_dummy_data_spec.rb | |
require "spec_helper" | |
describe "Seed dummy data task" do | |
before(:all) do | |
Rake::Task["db:dummy"].invoke | |
end | |
it "should populate 18 approaches" do | |
expect(Approach.count).to eq 17 | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment