mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-25 20:46:48 +00:00
We removed some Spree magic a while back and that broke our sample data script. This is now corrected. I also added a spec so that we will notice broken seed data earlier.
27 lines
618 B
Ruby
27 lines
618 B
Ruby
# frozen_string_literal: true
|
|
|
|
require 'spec_helper'
|
|
require 'rake'
|
|
|
|
describe 'sample_data.rake' do
|
|
before(:all) do
|
|
Rake.application.rake_require 'tasks/sample_data'
|
|
Rake::Task.define_task(:environment)
|
|
end
|
|
|
|
before do
|
|
# Create seed data required by the sample data.
|
|
create(:user)
|
|
DefaultStockLocation.find_or_create
|
|
DefaultShippingCategory.find_or_create
|
|
end
|
|
|
|
it "creates some sample data to play with" do
|
|
Rake.application.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
|