summaryrefslogtreecommitdiff
path: root/spec/models/pages/lookup_path_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-09-25 09:06:04 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-09-25 09:06:04 +0000
commit1cfd8874ee6702184d5608f533b30bab722b4f9d (patch)
tree4921070efdc0ad2d1c3c7d8a3a60c73928b57d25 /spec/models/pages/lookup_path_spec.rb
parentfbcb36880cda3a29cfa4ebed4d080701c302256b (diff)
downloadgitlab-ce-1cfd8874ee6702184d5608f533b30bab722b4f9d.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models/pages/lookup_path_spec.rb')
-rw-r--r--spec/models/pages/lookup_path_spec.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/spec/models/pages/lookup_path_spec.rb b/spec/models/pages/lookup_path_spec.rb
index 2146b0c9abd..c05d4c82634 100644
--- a/spec/models/pages/lookup_path_spec.rb
+++ b/spec/models/pages/lookup_path_spec.rb
@@ -57,8 +57,18 @@ describe Pages::LookupPath do
end
describe '#prefix' do
- it 'returns "/"' do
+ it 'returns "/" for pages group root projects' do
+ project = instance_double(Project, pages_group_root?: true)
+ lookup_path = described_class.new(project, trim_prefix: 'mygroup')
+
expect(lookup_path.prefix).to eq('/')
end
+
+ it 'returns the project full path with the provided prefix removed' do
+ project = instance_double(Project, pages_group_root?: false, full_path: 'mygroup/myproject')
+ lookup_path = described_class.new(project, trim_prefix: 'mygroup')
+
+ expect(lookup_path.prefix).to eq('/myproject/')
+ end
end
end