mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-25 20:46:48 +00:00
Apparently, Rake's way of reloading the task code confuses the code coverage report. Code tested by rake task specs was not recognised as covered even though it was.
22 lines
458 B
Ruby
22 lines
458 B
Ruby
# frozen_string_literal: true
|
|
|
|
require 'spec_helper'
|
|
|
|
RSpec.describe 'sample_data.rake' do
|
|
include_context "rake"
|
|
|
|
before do
|
|
# Create seed data required by the sample data.
|
|
create(:user)
|
|
DefaultShippingCategory.find_or_create
|
|
end
|
|
|
|
it "creates some sample data to play with" do
|
|
invoke_task "ofn:sample_data"
|
|
|
|
expect(EnterpriseGroup.count).to eq 1
|
|
expect(Customer.count).to eq 2
|
|
expect(Spree::Order.count).to eq 5
|
|
end
|
|
end
|