Commit 5cf98ae4 authored by Mike Greiling's avatar Mike Greiling

Merge branch 'fix-notification-translation' into 'master'

Fix plural translation

See merge request gitlab-org/gitlab!23881
parents 2a84cfa3 2dbde568
......@@ -7,7 +7,7 @@
= image_tag('illustrations/subscription-success.svg', class: 'mw-xs')
.gl-banner-content.d-flex.flex-column.justify-content-center
%h3= _('Thanks for your purchase!')
- number_of_users = n_('1 user', '%{num} users', params[:quantity]) % { num: params[:quantity] }
- number_of_users = n_('1 user', '%{num} users', params[:quantity].to_i) % { num: params[:quantity] }
%p= _('You have successfully purchased a %{plan} plan subscription for %{seats}. You’ll receive a receipt via email.') % { plan: plan_title, seats: number_of_users }
.edit-group.d-flex.flex-column.align-items-center.gl-pt-5
#progress-bar
......
# frozen_string_literal: true
require 'spec_helper'
describe 'subscriptions/groups/edit' do
before do
assign(:group, Group.new)
allow(view).to receive(:params).and_return(quantity: quantity)
allow(view).to receive(:plan_title).and_return('Bronze')
allow(view).to receive(:group_path).and_return('')
allow(view).to receive(:subscriptions_groups_path).and_return('')
allow(view).to receive(:current_user).and_return(User.new)
end
context 'a single user' do
let(:quantity) { '1' }
it 'displays the correct notification for 1 user' do
render
expect(rendered).to have_text('You have successfully purchased a Bronze plan subscription for 1 user. You’ll receive a receipt via email.')
end
end
context 'multiple users' do
let(:quantity) { '2' }
it 'displays the correct notification for 2 users' do
render
expect(rendered).to have_text('You have successfully purchased a Bronze plan subscription for 2 users. You’ll receive a receipt via email.')
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