summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/regex_spec.rb
diff options
context:
space:
mode:
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