summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/database/rename_reserved_paths_migration_spec.rb
blob: 8b4ab6703c682a77d716c95b2b592ffcaef82289 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
require 'spec_helper'

describe Gitlab::Database::RenameReservedPathsMigration do
  let(:subject) do
    ActiveRecord::Migration.new.extend(
      Gitlab::Database::RenameReservedPathsMigration
    )
  end

  describe '#rename_wildcard_paths' do
    it 'should rename namespaces' do
      expect(subject).to receive(:rename_namespaces).
                           with(['first-path', 'second-path'], type: :wildcard)

      subject.rename_wildcard_paths(['first-path', 'second-path'])
    end

    it 'should rename projects'
  end

  describe '#rename_root_paths' do
    it 'should rename namespaces' do
      expect(subject).to receive(:rename_namespaces).
                           with(['the-path'], type: :top_level)

      subject.rename_root_paths('the-path')
    end
  end
end