diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-21 03:10:44 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-21 03:10:44 +0300 |
commit | c7a46b04196859929e8e4c04fbcbf8490f228edf (patch) | |
tree | d378b8cdd9f49903ed6f61810f61fb61217b6e3e /spec/serializers/linked_project_issue_entity_spec.rb | |
parent | 5c42c9355afa2bd5f95000b294ae6053f1d9219f (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/serializers/linked_project_issue_entity_spec.rb')
-rw-r--r-- | spec/serializers/linked_project_issue_entity_spec.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/serializers/linked_project_issue_entity_spec.rb b/spec/serializers/linked_project_issue_entity_spec.rb new file mode 100644 index 00000000000..864b5c45599 --- /dev/null +++ b/spec/serializers/linked_project_issue_entity_spec.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe LinkedProjectIssueEntity do + let_it_be(:user) { create(:user) } + let_it_be(:project) { create(:project) } + let_it_be(:issue_link) { create(:issue_link) } + + let(:request) { double('request') } + let(:related_issue) { issue_link.source.related_issues(user).first } + let(:entity) { described_class.new(related_issue, request: request, current_user: user) } + + before do + allow(request).to receive(:current_user).and_return(user) + allow(request).to receive(:issuable).and_return(issue_link.source) + issue_link.target.project.add_developer(user) + end + + describe 'issue_link_type' do + it { expect(entity.as_json).to include(link_type: 'relates_to') } + end +end |