summaryrefslogtreecommitdiff
path: root/spec/lib/container_registry
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-09-09 09:14:13 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-09-09 09:14:13 +0000
commit6021fa2fc624b7d6902273bae55c5b8b2b2b3fff (patch)
tree54d044a94c33f737d46ecb4829930868fd79105e /spec/lib/container_registry
parent377c02f959f45d07a6d1f3c4d7f5afc6ad5162ff (diff)
downloadgitlab-ce-6021fa2fc624b7d6902273bae55c5b8b2b2b3fff.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/container_registry')
-rw-r--r--spec/lib/container_registry/tag_spec.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/spec/lib/container_registry/tag_spec.rb b/spec/lib/container_registry/tag_spec.rb
index 190ddef0cd5..cb5c6a60e1d 100644
--- a/spec/lib/container_registry/tag_spec.rb
+++ b/spec/lib/container_registry/tag_spec.rb
@@ -240,6 +240,31 @@ RSpec.describe ContainerRegistry::Tag do
it_behaves_like 'setting and caching the created_at value'
end
end
+
+ describe 'updated_at=' do
+ subject do
+ tag.updated_at = input
+ tag.updated_at
+ end
+
+ context 'with a valid input' do
+ let(:input) { 2.days.ago.iso8601 }
+
+ it { is_expected.to eq(DateTime.iso8601(input)) }
+ end
+
+ context 'with a nil input' do
+ let(:input) { nil }
+
+ it { is_expected.to eq(nil) }
+ end
+
+ context 'with an invalid input' do
+ let(:input) { 'not a timestamp' }
+
+ it { is_expected.to eq(nil) }
+ end
+ end
end
end
end