debian-mirror-gitlab/spec/requests/groups/usage_quotas_controller_spec.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

49 lines
1.2 KiB
Ruby
Raw Normal View History

2023-03-04 22:38:38 +05:30
# frozen_string_literal: true
require 'spec_helper'
2023-03-17 16:20:25 +05:30
RSpec.describe Groups::UsageQuotasController, :with_license, feature_category: :subscription_cost_management do
2023-03-04 22:38:38 +05:30
let_it_be(:group) { create(:group) }
let_it_be(:subgroup) { create(:group, parent: group) }
let_it_be(:user) { create(:user) }
subject(:request) { get group_usage_quotas_path(group) }
before do
sign_in(user)
end
describe 'GET /groups/*group_id/-/usage_quotas' do
context 'when user has read_usage_quotas permission' do
before do
group.add_owner(user)
end
it 'renders index with 200 status code' do
request
expect(response).to have_gitlab_http_status(:ok)
expect(response.body).to match(/Placeholder for usage quotas Vue app/)
end
it 'renders 404 page if subgroup' do
get group_usage_quotas_path(subgroup)
expect(response).to have_gitlab_http_status(:not_found)
end
end
context 'when user does not have read_usage_quotas permission' do
before do
group.add_maintainer(user)
end
it 'renders not_found' do
request
expect(response).to have_gitlab_http_status(:not_found)
end
end
end
end