diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-03 12:08:21 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-03 12:08:21 +0000 |
commit | 607646ef528729ebb30e593bce0a0447304fccc7 (patch) | |
tree | 515db21a0b51f0e6718f0b985bab800c61ce577c /spec/migrations/cleanup_environments_external_url_spec.rb | |
parent | 31a432e38a8b70d3ffb16afa8d7cfeee4f5f5921 (diff) | |
download | gitlab-ce-607646ef528729ebb30e593bce0a0447304fccc7.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/migrations/cleanup_environments_external_url_spec.rb')
-rw-r--r-- | spec/migrations/cleanup_environments_external_url_spec.rb | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/spec/migrations/cleanup_environments_external_url_spec.rb b/spec/migrations/cleanup_environments_external_url_spec.rb deleted file mode 100644 index 54fcb8c62cd..00000000000 --- a/spec/migrations/cleanup_environments_external_url_spec.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require Rails.root.join('db', 'migrate', '20181108091549_cleanup_environments_external_url.rb') - -describe CleanupEnvironmentsExternalUrl do - let(:environments) { table(:environments) } - let(:invalid_entries) { environments.where(environments.arel_table[:external_url].matches('javascript://%')) } - let(:namespaces) { table(:namespaces) } - let(:projects) { table(:projects) } - - before do - namespace = namespaces.create(name: 'foo', path: 'foo') - project = projects.create!(namespace_id: namespace.id) - - environments.create!(id: 1, project_id: project.id, name: 'poisoned', slug: 'poisoned', external_url: 'javascript://alert("1")') - end - - it 'clears every environment with a javascript external_url' do - expect do - subject.up - end.to change { invalid_entries.count }.from(1).to(0) - end - - it 'do not removes environments' do - expect do - subject.up - end.not_to change { environments.count } - end -end |