Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-02-23 15:13:44 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-02-23 15:13:44 +0300
commitb286069fdfe9a02beb2a26ce73511159a372002d (patch)
treeef6a92fae93c1a66be3a98921da93383542bd2c1 /spec/tasks/dev_rake_spec.rb
parente9c3815d3d3e8a9ba07b899c491db38ac621fe57 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/tasks/dev_rake_spec.rb')
-rw-r--r--spec/tasks/dev_rake_spec.rb38
1 files changed, 38 insertions, 0 deletions
diff --git a/spec/tasks/dev_rake_spec.rb b/spec/tasks/dev_rake_spec.rb
new file mode 100644
index 00000000000..7bc27d2732c
--- /dev/null
+++ b/spec/tasks/dev_rake_spec.rb
@@ -0,0 +1,38 @@
+# frozen_string_literal: true
+
+require 'rake_helper'
+
+RSpec.describe 'dev rake tasks' do
+ before do
+ Rake.application.rake_require 'tasks/gitlab/setup'
+ Rake.application.rake_require 'tasks/gitlab/shell'
+ Rake.application.rake_require 'tasks/dev'
+ end
+
+ describe 'setup' do
+ subject(:setup_task) { run_rake_task('dev:setup') }
+
+ let(:connections) { Gitlab::Database.database_base_models.values.map(&:connection) }
+
+ it 'sets up the development environment', :aggregate_failures do
+ expect(Rake::Task['gitlab:setup']).to receive(:invoke)
+
+ expect(connections).to all(receive(:execute).with('ANALYZE'))
+
+ expect(Rake::Task['gitlab:shell:setup']).to receive(:invoke)
+
+ setup_task
+ end
+ end
+
+ describe 'load' do
+ subject(:load_task) { run_rake_task('dev:load') }
+
+ it 'eager loads the application', :aggregate_failures do
+ expect(Rails.configuration).to receive(:eager_load=).with(true)
+ expect(Rails.application).to receive(:eager_load!)
+
+ load_task
+ end
+ end
+end