diff options
author | Rémy Coutable <remy@rymai.me> | 2018-02-21 15:48:18 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2018-02-21 15:48:18 +0000 |
commit | 4bd3041418a1deb48887c459878b88b58cb703eb (patch) | |
tree | c1288b3353d05bc1d7c878195d2b05109f1cf00e /spec | |
parent | b5372d822e208b55c54f6a49976d90e026034539 (diff) | |
parent | 15ca2d5fb5961399d8031fa3c9da818ffb9cbb0f (diff) | |
download | gitlab-ce-4bd3041418a1deb48887c459878b88b58cb703eb.tar.gz |
Merge branch '40668-pages-domain-api-returns-404-when-using-a-specific-domain' into 'master'
Resolve "Pages Domain API returns 404 when using a specific domain"
Closes #40668
See merge request gitlab-org/gitlab-ce!17206
Diffstat (limited to 'spec')
-rw-r--r-- | spec/requests/api/pages_domains_spec.rb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/spec/requests/api/pages_domains_spec.rb b/spec/requests/api/pages_domains_spec.rb index 5d01dc37f0e..025165622b7 100644 --- a/spec/requests/api/pages_domains_spec.rb +++ b/spec/requests/api/pages_domains_spec.rb @@ -1,7 +1,7 @@ require 'rails_helper' describe API::PagesDomains do - set(:project) { create(:project) } + set(:project) { create(:project, path: 'my.project') } set(:user) { create(:user) } set(:admin) { create(:admin) } @@ -16,6 +16,7 @@ describe API::PagesDomains do let(:route) { "/projects/#{project.id}/pages/domains" } let(:route_domain) { "/projects/#{project.id}/pages/domains/#{pages_domain.domain}" } + let(:route_domain_path) { "/projects/#{project.path_with_namespace.gsub('/', '%2F')}/pages/domains/#{pages_domain.domain}" } let(:route_secure_domain) { "/projects/#{project.id}/pages/domains/#{pages_domain_secure.domain}" } let(:route_expired_domain) { "/projects/#{project.id}/pages/domains/#{pages_domain_expired.domain}" } let(:route_vacant_domain) { "/projects/#{project.id}/pages/domains/www.vacant-domain.test" } @@ -144,6 +145,16 @@ describe API::PagesDomains do expect(json_response['certificate']).to be_nil end + it 'returns pages domain with project path' do + get api(route_domain_path, user) + + expect(response).to have_gitlab_http_status(200) + expect(response).to match_response_schema('public_api/v4/pages_domain/detail') + expect(json_response['domain']).to eq(pages_domain.domain) + expect(json_response['url']).to eq(pages_domain.url) + expect(json_response['certificate']).to be_nil + end + it 'returns pages domain with a certificate' do get api(route_secure_domain, user) |