summaryrefslogtreecommitdiff
path: root/spec/models
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-04-08 12:09:42 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-04-08 12:09:42 +0000
commit403678e00406edc8094f087ec70e00aa29e49bef (patch)
tree447d6d4967e9a11895683b27e637a50bd9fc0602 /spec/models
parentf5050253469fc0961c02deec0e698ad62bdd9de5 (diff)
downloadgitlab-ce-403678e00406edc8094f087ec70e00aa29e49bef.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/ci/group_spec.rb8
-rw-r--r--spec/models/concerns/ci/maskable_spec.rb6
2 files changed, 10 insertions, 4 deletions
diff --git a/spec/models/ci/group_spec.rb b/spec/models/ci/group_spec.rb
index 5516a1a9c61..868382e3756 100644
--- a/spec/models/ci/group_spec.rb
+++ b/spec/models/ci/group_spec.rb
@@ -3,12 +3,14 @@
require 'spec_helper'
describe Ci::Group do
+ let_it_be(:project) { create(:project) }
+
+ let!(:jobs) { build_list(:ci_build, 1, :success, project: project) }
+
subject do
- described_class.new('test', name: 'rspec', jobs: jobs)
+ described_class.new(project, 'test', name: 'rspec', jobs: jobs)
end
- let!(:jobs) { build_list(:ci_build, 1, :success) }
-
it { is_expected.to include_module(StaticModel) }
it { is_expected.to respond_to(:stage) }
diff --git a/spec/models/concerns/ci/maskable_spec.rb b/spec/models/concerns/ci/maskable_spec.rb
index 22ffb294819..01861b39165 100644
--- a/spec/models/concerns/ci/maskable_spec.rb
+++ b/spec/models/concerns/ci/maskable_spec.rb
@@ -61,8 +61,12 @@ describe Ci::Maskable do
expect(subject.match?(string)).to eq(false)
end
+ it 'does not match strings using unsupported characters' do
+ expect(subject.match?('HelloWorld%#^')).to eq(false)
+ end
+
it 'matches valid strings' do
- expect(subject.match?('helloworld')).to eq(true)
+ expect(subject.match?('Hello+World_123/@:-.')).to eq(true)
end
end