summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/regex_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-10-16 21:07:22 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-10-16 21:07:22 +0000
commite924e9e7cb9df21b3bc3d51d5f955da28ba3a225 (patch)
tree598ccb6f09e55ad06e628a90d27628f20ae693fe /spec/lib/gitlab/regex_spec.rb
parent8e45d25f7dde6508839ffee719c0ddc2cf6b12d3 (diff)
downloadgitlab-ce-e924e9e7cb9df21b3bc3d51d5f955da28ba3a225.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/regex_spec.rb')
-rw-r--r--spec/lib/gitlab/regex_spec.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/lib/gitlab/regex_spec.rb b/spec/lib/gitlab/regex_spec.rb
index 3036e3a9754..b557baed258 100644
--- a/spec/lib/gitlab/regex_spec.rb
+++ b/spec/lib/gitlab/regex_spec.rb
@@ -64,4 +64,15 @@ describe Gitlab::Regex do
it { is_expected.not_to match('.my/image') }
it { is_expected.not_to match('my/image.') }
end
+
+ describe '.aws_account_id_regex' do
+ subject { described_class.aws_arn_regex }
+
+ it { is_expected.to match('arn:aws:iam::123456789012:role/role-name') }
+ it { is_expected.to match('arn:aws:s3:::bucket/key') }
+ it { is_expected.to match('arn:aws:ec2:us-east-1:123456789012:volume/vol-1') }
+ it { is_expected.to match('arn:aws:rds:us-east-1:123456789012:pg:prod') }
+ it { is_expected.not_to match('123456789012') }
+ it { is_expected.not_to match('role/role-name') }
+ end
end