diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-20 14:10:13 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-20 14:10:13 +0300 |
commit | 0ea3fcec397b69815975647f5e2aa5fe944a8486 (patch) | |
tree | 7979381b89d26011bcf9bdc989a40fcc2f1ed4ff /spec/services/bulk_update_integration_service_spec.rb | |
parent | 72123183a20411a36d607d70b12d57c484394c8e (diff) |
Add latest changes from gitlab-org/gitlab@15-1-stable-eev15.1.0-rc42
Diffstat (limited to 'spec/services/bulk_update_integration_service_spec.rb')
-rw-r--r-- | spec/services/bulk_update_integration_service_spec.rb | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/spec/services/bulk_update_integration_service_spec.rb b/spec/services/bulk_update_integration_service_spec.rb index dcc8d2df36d..e3e38aacaa2 100644 --- a/spec/services/bulk_update_integration_service_spec.rb +++ b/spec/services/bulk_update_integration_service_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' RSpec.describe BulkUpdateIntegrationService do - include JiraServiceHelper + include JiraIntegrationHelpers before_all do stub_jira_integration_test @@ -55,6 +55,20 @@ RSpec.describe BulkUpdateIntegrationService do .not_to eq(subgroup_integration.attributes.except(*excluded_attributes)) end + it 'does not change the created_at timestamp' do + subgroup_integration.update_column(:created_at, Time.utc('2022-01-01')) + + expect do + described_class.new(subgroup_integration, batch).execute + end.not_to change { integration.reload.created_at } + end + + it 'sets the updated_at timestamp to the current time', time_travel_to: Time.utc('2022-01-01') do + expect do + described_class.new(subgroup_integration, batch).execute + end.to change { integration.reload.updated_at }.to(Time.current) + end + context 'with integration with data fields' do let(:excluded_attributes) do %w[id service_id created_at updated_at encrypted_properties encrypted_properties_iv] @@ -69,6 +83,20 @@ RSpec.describe BulkUpdateIntegrationService do expect(integration.data_fields.attributes.except(*excluded_attributes)) .not_to eq(excluded_integration.data_fields.attributes.except(*excluded_attributes)) end + + it 'does not change the created_at timestamp' do + subgroup_integration.data_fields.update_column(:created_at, Time.utc('2022-01-02')) + + expect do + described_class.new(subgroup_integration, batch).execute + end.not_to change { integration.data_fields.reload.created_at } + end + + it 'sets the updated_at timestamp to the current time', time_travel_to: Time.utc('2022-01-01') do + expect do + described_class.new(subgroup_integration, batch).execute + end.to change { integration.data_fields.reload.updated_at }.to(Time.current) + end end end |