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:
authorPawel Chojnacki <pawel@chojnacki.ws>2017-06-07 11:27:52 +0300
committerPawel Chojnacki <pawel@chojnacki.ws>2017-06-07 11:27:52 +0300
commitdbb3c28088b63c8cf40a90c599b6eedb4dfbbb66 (patch)
tree9e6c4d495e45355ef62c56c0c3e102f95220f89f /spec/models/deployment_spec.rb
parenta924152219c1367bf494f3f387d050ac3ff2d7d3 (diff)
parentdddc54aa0aea4088e5a233d18a62cb2435590fe9 (diff)
Merge remote-tracking branch 'upstream/master' into 28717-additional-metrics-review-branch
# Conflicts: # app/models/project_services/prometheus_service.rb # app/views/projects/services/_form.html.haml
Diffstat (limited to 'spec/models/deployment_spec.rb')
-rw-r--r--spec/models/deployment_spec.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/models/deployment_spec.rb b/spec/models/deployment_spec.rb
index bbb7dbf0922..d15ff9e5ffd 100644
--- a/spec/models/deployment_spec.rb
+++ b/spec/models/deployment_spec.rb
@@ -16,6 +16,19 @@ describe Deployment, models: true do
it { is_expected.to validate_presence_of(:ref) }
it { is_expected.to validate_presence_of(:sha) }
+ describe 'after_create callbacks' do
+ let(:environment) { create(:environment) }
+ let(:store) { Gitlab::EtagCaching::Store.new }
+
+ it 'invalidates the environment etag cache' do
+ old_value = store.get(environment.etag_cache_key)
+
+ create(:deployment, environment: environment)
+
+ expect(store.get(environment.etag_cache_key)).not_to eq(old_value)
+ end
+ end
+
describe '#includes_commit?' do
let(:project) { create(:project, :repository) }
let(:environment) { create(:environment, project: project) }