diff options
Diffstat (limited to 'spec/controllers/groups/registry/repositories_controller_spec.rb')
-rw-r--r-- | spec/controllers/groups/registry/repositories_controller_spec.rb | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/spec/controllers/groups/registry/repositories_controller_spec.rb b/spec/controllers/groups/registry/repositories_controller_spec.rb index 9463483b7b0..eb702d65325 100644 --- a/spec/controllers/groups/registry/repositories_controller_spec.rb +++ b/spec/controllers/groups/registry/repositories_controller_spec.rb @@ -14,7 +14,7 @@ describe Groups::Registry::RepositoriesController do sign_in(user) end - context 'GET #index' do + shared_examples 'renders a list of repositories' do context 'when container registry is enabled' do it 'show index page' do expect(Gitlab::Tracking).not_to receive(:event) @@ -33,6 +33,7 @@ describe Groups::Registry::RepositoriesController do } expect(response).to match_response_schema('registry/repositories') + expect(response).to include_pagination_headers end it 'returns a list of projects for json format' do @@ -89,5 +90,29 @@ describe Groups::Registry::RepositoriesController do expect(response).to have_gitlab_http_status(:not_found) end end + + context 'with :vue_container_registry_explorer feature flag disabled' do + before do + stub_feature_flags(vue_container_registry_explorer: false) + end + + it 'has the correct response schema' do + get :index, params: { + group_id: group, + format: :json + } + + expect(response).to match_response_schema('registry/repositories') + expect(response).not_to include_pagination_headers + end + end + end + + context 'GET #index' do + it_behaves_like 'renders a list of repositories' + end + + context 'GET #show' do + it_behaves_like 'renders a list of repositories' end end |