Commit 56eb45b7 authored by Vitaly Slobodin's avatar Vitaly Slobodin

Fix Danger bot complains

parent c0b03f88
......@@ -46,7 +46,6 @@ export default {
zip_code: customer.zipCode,
company: customer.company,
},
selected_group: data.subscription.namespaceId,
subscription: {
plan_id: data.selectedPlanId,
payment_method_id: data.paymentMethod.id,
......
......@@ -67,7 +67,7 @@ RSpec.describe SubscriptionsController do
describe 'GET #buy_minutes' do
let_it_be(:group) { create(:group) }
subject(:buy_minutes) { get :buy_minutes, params: { namespace_id: group.id } }
subject(:buy_minutes) { get :buy_minutes, params: { selected_group: group.id } }
context 'with authenticated user' do
before do
......@@ -76,13 +76,25 @@ RSpec.describe SubscriptionsController do
sign_in(user)
end
it { is_expected.to render_template 'layouts/checkout' }
it { is_expected.to render_template :buy_minutes }
context 'when there are groups eligible for the addon' do
let_it_be(:group) { create(:group) }
before do
group.add_owner(user)
allow_next_instance_of(GitlabSubscriptions::FilterPurchaseEligibleNamespacesService, user: user, namespaces: [group]) do |instance|
allow(instance).to receive(:execute).and_return(instance_double(ServiceResponse, success?: true, payload: [group]))
end
end
it { is_expected.to render_template 'layouts/checkout' }
it { is_expected.to render_template :buy_minutes }
it 'assigns the eligible groups for the subscription' do
buy_minutes
it 'assigns the group for the addon' do
buy_minutes
expect(assigns(:group)).to eq group
expect(assigns(:group)).to eq group
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