Sha256: cd11e1d83815d2d3e29850ffcee1ea417a6d15b7bacf21d0baaefde9eab9a07b

Contents?: true

Size: 1.01 KB

Versions: 26

Compression:

Stored size: 1.01 KB

Contents

require 'spec_helper'

module Spree
  describe Migrations do
    let(:app_migrations) { [".", "34_add_title.rb", "52_add_text.rb"] }
    let(:engine_migrations) { [".", "334_create_orders.spree.rb", "777_create_products.spree.rb"] }

    let(:config) { double("Config", root: "dir") }

    let(:engine_dir) { "dir/db/migrate" }
    let(:app_dir) { "#{Rails.root}/db/migrate" }

    subject { described_class.new(config, "spree") }

    it "detects missing migrations" do
      expect(Dir).to receive(:entries).with(app_dir).and_return app_migrations
      expect(Dir).to receive(:entries).with(engine_dir).and_return engine_migrations

      expect(subject.missing_migrations.size).to eq 2
    end

    context "no missing migrations" do
      it "says nothing" do
        expect(Dir).to receive(:entries).with(engine_dir).and_return engine_migrations
        expect(Dir).to receive(:entries).with(app_dir).and_return(app_migrations + engine_migrations)
        expect(subject.missing_migrations.size).to eq 0
      end
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
solidus_core-2.3.1 spec/lib/spree/migrations_spec.rb
solidus_core-2.2.2 spec/lib/spree/migrations_spec.rb
solidus_core-2.1.1 spec/lib/spree/migrations_spec.rb
solidus_core-2.0.3 spec/lib/spree/migrations_spec.rb
solidus_core-1.4.2 spec/lib/spree/migrations_spec.rb
solidus_core-2.3.0 spec/lib/spree/migrations_spec.rb
solidus_core-2.3.0.rc3 spec/lib/spree/migrations_spec.rb
solidus_core-2.3.0.rc2 spec/lib/spree/migrations_spec.rb
solidus_core-2.3.0.rc1 spec/lib/spree/migrations_spec.rb
solidus_core-2.3.0.beta1 spec/lib/spree/migrations_spec.rb
solidus_core-2.0.2 spec/lib/spree/migrations_spec.rb
solidus_core-1.4.1 spec/lib/spree/migrations_spec.rb
solidus_core-2.2.1 spec/lib/spree/migrations_spec.rb
solidus_core-2.2.0 spec/lib/spree/migrations_spec.rb
solidus_core-2.2.0.rc1 spec/lib/spree/migrations_spec.rb
solidus_core-2.2.0.beta1 spec/lib/spree/migrations_spec.rb
solidus_core-2.1.0 spec/lib/spree/migrations_spec.rb
solidus_core-2.1.0.rc1 spec/lib/spree/migrations_spec.rb
solidus_core-2.0.1 spec/lib/spree/migrations_spec.rb
solidus_core-2.1.0.beta1 spec/lib/spree/migrations_spec.rb