Sha256: b38942414b6c14171af42bf718cd897e37495fdd76d5fab6dbf333e98d8d4f79

Contents?: true

Size: 595 Bytes

Versions: 2

Compression:

Stored size: 595 Bytes

Contents

# frozen_string_literal: true

require 'rails_helper'

Rails.application.load_tasks

RSpec.describe 'dirty_seed:seed' do # rubocop:disable Rspec/DescribeClass
  before do
    ENV['COUNT'] = '8'
    Rake::Task[:'dirty_seed:seed'].invoke
  end

  it 'seeds data' do
    # As expected, Juliett can not be seed
    regular_models = [Alfa, Bravo, Charlie, Delta, Echo, Golf, Hotel, India]
    expect(regular_models.map(&:count).all? { |c| c == 8 }).to be true
    # 8 Foxtrot + 8 inherited Golf model
    expect(Foxtrot.count).to eq 16
    # unseedable
    expect(Juliett.none?).to be true
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dirty_seed-0.1.8 spec/lib/tasks/dirty_seed_tasks_spec.rb
dirty_seed-0.1.7 spec/lib/tasks/dirty_seed_tasks_spec.rb