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