summaryrefslogtreecommitdiff
path: root/spec/serializers/issue_entity_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-12-14 00:08:27 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-12-14 00:08:27 +0000
commitb7d58ff8b17623f64ac7835a590e79d916e758ac (patch)
tree4f75a8f9e0e30cf8c7e944ea2c4461be396c0d5f /spec/serializers/issue_entity_spec.rb
parent0e2fc1701bd0c87cc458cbbb34c618b0e0dc5a14 (diff)
downloadgitlab-ce-b7d58ff8b17623f64ac7835a590e79d916e758ac.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/serializers/issue_entity_spec.rb')
-rw-r--r--spec/serializers/issue_entity_spec.rb32
1 files changed, 32 insertions, 0 deletions
diff --git a/spec/serializers/issue_entity_spec.rb b/spec/serializers/issue_entity_spec.rb
index 224ed0b402f..a1868b2631b 100644
--- a/spec/serializers/issue_entity_spec.rb
+++ b/spec/serializers/issue_entity_spec.rb
@@ -92,4 +92,36 @@ describe IssueEntity do
end
end
end
+
+ context 'when issuable in active or archived project' do
+ before do
+ project.add_developer(user)
+ end
+
+ context 'when project is active' do
+ it 'returns archived false' do
+ expect(subject[:is_project_archived]).to eq(false)
+ end
+
+ it 'returns nil for archived project doc' do
+ response = described_class.new(resource, request: request).as_json
+
+ expect(response[:archived_project_docs_path]).to be nil
+ end
+ end
+
+ context 'when project is archived' do
+ before do
+ project.update(archived: true)
+ end
+
+ it 'returns archived true' do
+ expect(subject[:is_project_archived]).to eq(true)
+ end
+
+ it 'returns archived project doc' do
+ expect(subject[:archived_project_docs_path]).to eq('/help/user/project/settings/index.md#archiving-a-project')
+ end
+ end
+ end
end