Commit f537f574 authored by James Lopez's avatar James Lopez

Merge branch '276915-fj-enable-globally-sitemap-generation' into 'master'

Add sitemap generation for Gitlab.com and gitlab-org namespace [RUN ALL RSPEC] [RUN AS-IF-FOSS]

See merge request gitlab-org/gitlab!56947
parents b005bd81 3a8cfe96
---
name: gitlab_org_sitemap
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/46661
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/276915
milestone: '13.6'
type: development
group: group::editor
default_enabled: false
...@@ -7,7 +7,6 @@ class SitemapController < ApplicationController ...@@ -7,7 +7,6 @@ class SitemapController < ApplicationController
def show def show
return render_404 unless Gitlab.com? return render_404 unless Gitlab.com?
return render_404 unless Feature.enabled?(:gitlab_org_sitemap)
respond_to do |format| respond_to do |format|
format.xml do format.xml do
......
---
title: Add sitemap generation for Gitlab.com and gitlab-org namespace
merge_request: 56947
author:
type: added
...@@ -24,24 +24,12 @@ RSpec.describe SitemapController do ...@@ -24,24 +24,12 @@ RSpec.describe SitemapController do
let(:dot_com) { true } let(:dot_com) { true }
context 'with an authenticated user' do context 'with an authenticated user' do
let(:flag_value) { true }
before do before do
stub_feature_flags(gitlab_org_sitemap: flag_value)
allow(Sitemap::CreateService).to receive_message_chain(:new, :execute).and_return(result) allow(Sitemap::CreateService).to receive_message_chain(:new, :execute).and_return(result)
subject subject
end end
shared_examples 'gitlab_org_sitemap flag is disabled' do
let(:flag_value) { false }
it 'returns :not_found' do
expect(response).to have_gitlab_http_status(:not_found)
end
end
context 'when the sitemap generation raises an error' do context 'when the sitemap generation raises an error' do
let(:result) { ServiceResponse.error(message: 'foo') } let(:result) { ServiceResponse.error(message: 'foo') }
...@@ -49,8 +37,6 @@ RSpec.describe SitemapController do ...@@ -49,8 +37,6 @@ RSpec.describe SitemapController do
expect(response).to have_gitlab_http_status(:ok) expect(response).to have_gitlab_http_status(:ok)
expect(response.body).to include('<error>foo</error>') expect(response.body).to include('<error>foo</error>')
end end
it_behaves_like 'gitlab_org_sitemap flag is disabled'
end end
context 'when the sitemap was created suscessfully' do context 'when the sitemap was created suscessfully' do
...@@ -60,8 +46,6 @@ RSpec.describe SitemapController do ...@@ -60,8 +46,6 @@ RSpec.describe SitemapController do
expect(response).to have_gitlab_http_status(:ok) expect(response).to have_gitlab_http_status(:ok)
expect(response.body).to eq('foo') expect(response.body).to eq('foo')
end end
it_behaves_like 'gitlab_org_sitemap flag is disabled'
end end
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment