diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 11:27:35 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 11:27:35 +0300 |
commit | 7e9c479f7de77702622631cff2628a9c8dcbc627 (patch) | |
tree | c8f718a08e110ad7e1894510980d2155a6549197 /spec/lib/atlassian/jira_connect/serializers/repository_entity_spec.rb | |
parent | e852b0ae16db4052c1c567d9efa4facc81146e88 (diff) |
Add latest changes from gitlab-org/gitlab@13-6-stable-eev13.6.0-rc42
Diffstat (limited to 'spec/lib/atlassian/jira_connect/serializers/repository_entity_spec.rb')
-rw-r--r-- | spec/lib/atlassian/jira_connect/serializers/repository_entity_spec.rb | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/spec/lib/atlassian/jira_connect/serializers/repository_entity_spec.rb b/spec/lib/atlassian/jira_connect/serializers/repository_entity_spec.rb index 23ba1770827..9100398ecc5 100644 --- a/spec/lib/atlassian/jira_connect/serializers/repository_entity_spec.rb +++ b/spec/lib/atlassian/jira_connect/serializers/repository_entity_spec.rb @@ -3,6 +3,8 @@ require 'spec_helper' RSpec.describe Atlassian::JiraConnect::Serializers::RepositoryEntity do + let(:update_sequence_id) { nil } + subject do project = create(:project, :repository) commits = [project.commit] @@ -13,9 +15,23 @@ RSpec.describe Atlassian::JiraConnect::Serializers::RepositoryEntity do project, commits: commits, branches: branches, - merge_requests: merge_requests + merge_requests: merge_requests, + update_sequence_id: update_sequence_id ).to_json end it { is_expected.to match_schema('jira_connect/repository') } + + context 'with custom update_sequence_id' do + let(:update_sequence_id) { 1.0 } + + it 'passes the update_sequence_id on to the nested entities', :aggregate_failures do + parsed_subject = Gitlab::Json.parse(subject) + + expect(parsed_subject['updateSequenceId']).to eq(update_sequence_id) + expect(parsed_subject['commits'].first['updateSequenceId']).to eq(update_sequence_id) + expect(parsed_subject['branches'].first['updateSequenceId']).to eq(update_sequence_id) + expect(parsed_subject['pullRequests'].first['updateSequenceId']).to eq(update_sequence_id) + end + end end |