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:
authorThong Kuah <tkuah@gitlab.com>2019-07-01 11:27:58 +0300
committerThong Kuah <tkuah@gitlab.com>2019-07-08 00:13:21 +0300
commit1b5b0dea5228ae7fd520c8bca3f03c4799a4d31d (patch)
tree0969a78c3b959cf33b47a0de308fa385c62af157 /spec/models/environment_status_spec.rb
parent1668f40f430c656ed9c20898605db21a66cb5937 (diff)
Share project object in EnvironmentStatus
Otherwise, each EnvironmentStatus object instantiates its own project when really they are the same. Improves query count performance
Diffstat (limited to 'spec/models/environment_status_spec.rb')
-rw-r--r--spec/models/environment_status_spec.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/spec/models/environment_status_spec.rb b/spec/models/environment_status_spec.rb
index c503c35305f..e2836420df9 100644
--- a/spec/models/environment_status_spec.rb
+++ b/spec/models/environment_status_spec.rb
@@ -11,11 +11,10 @@ describe EnvironmentStatus do
let(:merge_request) { create(:merge_request, :deployed_review_app, deployment: deployment) }
let(:sha) { deployment.sha }
- subject(:environment_status) { described_class.new(environment, merge_request, sha) }
+ subject(:environment_status) { described_class.new(project, environment, merge_request, sha) }
it { is_expected.to delegate_method(:id).to(:environment) }
it { is_expected.to delegate_method(:name).to(:environment) }
- it { is_expected.to delegate_method(:project).to(:environment) }
it { is_expected.to delegate_method(:deployed_at).to(:deployment) }
it { is_expected.to delegate_method(:status).to(:deployment) }