diff options
author | DJ Mountney <david@twkie.net> | 2016-05-15 17:59:49 +0300 |
---|---|---|
committer | DJ Mountney <david@twkie.net> | 2016-05-25 20:47:09 +0300 |
commit | 1a7326ba9ae4c7db0d03df0c114b84a22ab83ced (patch) | |
tree | 7f2802b194f5db25135d0916b164477fc3218203 /spec/tasks | |
parent | 40d4d8a4e7d3934731448a76c6d65db7943852c2 (diff) |
Switch the gitlab:db:configure task to use tables.any? instead of looking specifically for the schema_migrations table
Diffstat (limited to 'spec/tasks')
-rw-r--r-- | spec/tasks/gitlab/db_rake_spec.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/spec/tasks/gitlab/db_rake_spec.rb b/spec/tasks/gitlab/db_rake_spec.rb index fe70d5bcbf4..36d03a224e4 100644 --- a/spec/tasks/gitlab/db_rake_spec.rb +++ b/spec/tasks/gitlab/db_rake_spec.rb @@ -20,7 +20,7 @@ describe 'gitlab:db namespace rake task' do describe 'configure' do it 'should invoke db:migrate when schema has already been loaded' do - allow(ActiveRecord::Base.connection).to receive(:table_exists?).and_return(true) + allow(ActiveRecord::Base.connection).to receive(:tables).and_return(['default']) expect(Rake::Task['db:migrate']).to receive(:invoke) expect(Rake::Task['db:schema:load']).not_to receive(:invoke) expect(Rake::Task['db:seed_fu']).not_to receive(:invoke) @@ -28,7 +28,7 @@ describe 'gitlab:db namespace rake task' do end it 'should invoke db:shema:load and db:seed_fu when schema is not loaded' do - allow(ActiveRecord::Base.connection).to receive(:table_exists?).and_return(false) + allow(ActiveRecord::Base.connection).to receive(:tables).and_return([]) expect(Rake::Task['db:schema:load']).to receive(:invoke) expect(Rake::Task['db:seed_fu']).to receive(:invoke) expect(Rake::Task['db:migrate']).not_to receive(:invoke) @@ -46,7 +46,7 @@ describe 'gitlab:db namespace rake task' do end it 'should not invoke seed after a failed schema_load' do - allow(ActiveRecord::Base.connection).to receive(:table_exists?).and_return(false) + allow(ActiveRecord::Base.connection).to receive(:tables).and_return([]) allow(Rake::Task['db:schema:load']).to receive(:invoke).and_raise(RuntimeError, 'error') expect(Rake::Task['db:schema:load']).to receive(:invoke) expect(Rake::Task['db:seed_fu']).not_to receive(:invoke) |