Sha256: 39b009a2066e60b8d435c068736cee471eba6e312205baa9f08cfd35239ff884

Contents?: true

Size: 1.12 KB

Versions: 25

Compression:

Stored size: 1.12 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") }

    before do
      expect(File).to receive(:directory?).with(app_dir).and_return true
    end

    it "warns about 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

      silence_stream(STDOUT) {
        expect(subject.check).to eq true
      }
    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.check).to eq nil
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 2 rubygems

Version Path
solidus_core-1.3.2 spec/lib/spree/migrations_spec.rb
spree_core-3.3.0.rc1 spec/lib/spree/migrations_spec.rb
spree_core-3.1.5 spec/lib/spree/migrations_spec.rb
spree_core-3.2.1 spec/lib/spree/migrations_spec.rb
spree_core-3.2.0 spec/lib/spree/migrations_spec.rb
spree_core-3.1.4 spec/lib/spree/migrations_spec.rb
spree_core-3.2.0.rc3 spec/lib/spree/migrations_spec.rb
spree_core-3.2.0.rc2 spec/lib/spree/migrations_spec.rb
spree_core-3.2.0.rc1 spec/lib/spree/migrations_spec.rb
spree_core-3.1.3 spec/lib/spree/migrations_spec.rb
spree_core-3.1.2 spec/lib/spree/migrations_spec.rb
spree_core-3.0.10 spec/lib/spree/migrations_spec.rb
spree_core-3.1.1 spec/lib/spree/migrations_spec.rb
solidus_core-1.3.1 spec/lib/spree/migrations_spec.rb
solidus_core-1.3.0 spec/lib/spree/migrations_spec.rb
solidus_core-1.3.0.rc2 spec/lib/spree/migrations_spec.rb
spree_core-3.1.0 spec/lib/spree/migrations_spec.rb
spree_core-3.1.0.rc4 spec/lib/spree/migrations_spec.rb
solidus_core-1.3.0.rc1 spec/lib/spree/migrations_spec.rb
spree_core-3.0.9 spec/lib/spree/migrations_spec.rb