diff options
Diffstat (limited to 'spec/controllers')
21 files changed, 49 insertions, 49 deletions
diff --git a/spec/controllers/abuse_reports_controller_spec.rb b/spec/controllers/abuse_reports_controller_spec.rb index 7104305e9d2..83cae3dae12 100644 --- a/spec/controllers/abuse_reports_controller_spec.rb +++ b/spec/controllers/abuse_reports_controller_spec.rb @@ -22,7 +22,7 @@ describe AbuseReportsController do get :new, params: { user_id: user_id } expect(response).to redirect_to root_path - expect(flash[:alert]).to eq('Cannot create the abuse report. The user has been deleted.') + expect(flash[:alert]).to eq(_('Cannot create the abuse report. The user has been deleted.')) end end @@ -33,7 +33,7 @@ describe AbuseReportsController do get :new, params: { user_id: user.id } expect(response).to redirect_to user - expect(flash[:alert]).to eq('Cannot create the abuse report. This user has been blocked.') + expect(flash[:alert]).to eq(_('Cannot create the abuse report. This user has been blocked.')) end end end diff --git a/spec/controllers/admin/groups_controller_spec.rb b/spec/controllers/admin/groups_controller_spec.rb index 647fce0ecef..4d2726d01f5 100644 --- a/spec/controllers/admin/groups_controller_spec.rb +++ b/spec/controllers/admin/groups_controller_spec.rb @@ -33,7 +33,7 @@ describe Admin::GroupsController do access_level: Gitlab::Access::GUEST } - expect(response).to set_flash.to 'Users were successfully added.' + expect(response).to set_flash.to _('Users were successfully added.') expect(response).to redirect_to(admin_group_path(group)) expect(group.users).to include group_user end @@ -45,7 +45,7 @@ describe Admin::GroupsController do access_level: Gitlab::Access::GUEST } - expect(response).to set_flash.to 'Users were successfully added.' + expect(response).to set_flash.to _('Users were successfully added.') expect(response).to redirect_to(admin_group_path(group)) end @@ -56,7 +56,7 @@ describe Admin::GroupsController do access_level: Gitlab::Access::GUEST } - expect(response).to set_flash.to 'No users specified.' + expect(response).to set_flash.to _('No users specified.') expect(response).to redirect_to(admin_group_path(group)) expect(group.users).not_to include group_user end diff --git a/spec/controllers/groups/clusters_controller_spec.rb b/spec/controllers/groups/clusters_controller_spec.rb index 0f28499194e..89cc2bc88fd 100644 --- a/spec/controllers/groups/clusters_controller_spec.rb +++ b/spec/controllers/groups/clusters_controller_spec.rb @@ -444,7 +444,7 @@ describe Groups::ClustersController do cluster.reload expect(response).to redirect_to(group_cluster_path(group, cluster)) - expect(flash[:notice]).to eq('Kubernetes cluster was successfully updated.') + expect(flash[:notice]).to eq(_('Kubernetes cluster was successfully updated.')) expect(cluster.enabled).to be_falsey expect(cluster.name).to eq('my-new-cluster-name') end @@ -525,7 +525,7 @@ describe Groups::ClustersController do .and change { Clusters::Providers::Gcp.count }.by(-1) expect(response).to redirect_to(group_clusters_path(group)) - expect(flash[:notice]).to eq('Kubernetes cluster integration was successfully removed.') + expect(flash[:notice]).to eq(_('Kubernetes cluster integration was successfully removed.')) end end @@ -538,7 +538,7 @@ describe Groups::ClustersController do .and change { Clusters::Providers::Gcp.count }.by(-1) expect(response).to redirect_to(group_clusters_path(group)) - expect(flash[:notice]).to eq('Kubernetes cluster integration was successfully removed.') + expect(flash[:notice]).to eq(_('Kubernetes cluster integration was successfully removed.')) end end end @@ -553,7 +553,7 @@ describe Groups::ClustersController do .and change { Clusters::Providers::Gcp.count }.by(0) expect(response).to redirect_to(group_clusters_path(group)) - expect(flash[:notice]).to eq('Kubernetes cluster integration was successfully removed.') + expect(flash[:notice]).to eq(_('Kubernetes cluster integration was successfully removed.')) end end end diff --git a/spec/controllers/groups/group_members_controller_spec.rb b/spec/controllers/groups/group_members_controller_spec.rb index ed38dadfd6b..71a13926cef 100644 --- a/spec/controllers/groups/group_members_controller_spec.rb +++ b/spec/controllers/groups/group_members_controller_spec.rb @@ -49,7 +49,7 @@ describe Groups::GroupMembersController do access_level: Gitlab::Access::GUEST } - expect(response).to set_flash.to 'Users were successfully added.' + expect(response).to set_flash.to _('Users were successfully added.') expect(response).to redirect_to(group_group_members_path(group)) expect(group.users).to include group_user end @@ -61,7 +61,7 @@ describe Groups::GroupMembersController do access_level: Gitlab::Access::GUEST } - expect(response).to set_flash.to 'No users specified.' + expect(response).to set_flash.to _('No users specified.') expect(response).to redirect_to(group_group_members_path(group)) expect(group.users).not_to include group_user end @@ -126,7 +126,7 @@ describe Groups::GroupMembersController do it '[HTML] removes user from members' do delete :destroy, params: { group_id: group, id: member } - expect(response).to set_flash.to 'User was successfully removed from group.' + expect(response).to set_flash.to _('User was successfully removed from group.') expect(response).to redirect_to(group_group_members_path(group)) expect(group.members).not_to include member end @@ -196,7 +196,7 @@ describe Groups::GroupMembersController do it 'removes user from members' do delete :leave, params: { group_id: group } - expect(response).to set_flash.to 'Your access request to the group has been withdrawn.' + expect(response).to set_flash.to _('Your access request to the group has been withdrawn.') expect(response).to redirect_to(group_path(group)) expect(group.requesters).to be_empty expect(group.users).not_to include user @@ -213,7 +213,7 @@ describe Groups::GroupMembersController do it 'creates a new GroupMember that is not a team member' do post :request_access, params: { group_id: group } - expect(response).to set_flash.to 'Your request for access has been queued for review.' + expect(response).to set_flash.to _('Your request for access has been queued for review.') expect(response).to redirect_to(group_path(group)) expect(group.requesters.exists?(user_id: user)).to be_truthy expect(group.users).not_to include user diff --git a/spec/controllers/omniauth_callbacks_controller_spec.rb b/spec/controllers/omniauth_callbacks_controller_spec.rb index 59463462e5a..d41fd7b0567 100644 --- a/spec/controllers/omniauth_callbacks_controller_spec.rb +++ b/spec/controllers/omniauth_callbacks_controller_spec.rb @@ -156,7 +156,7 @@ describe OmniauthCallbacksController, type: :controller do expect(request.env['warden']).not_to be_authenticated expect(response.status).to eq(302) - expect(controller).to set_flash[:alert].to('Wrong extern UID provided. Make sure Auth0 is configured correctly.') + expect(controller).to set_flash[:alert].to(_('Wrong extern UID provided. Make sure Auth0 is configured correctly.')) end end end diff --git a/spec/controllers/passwords_controller_spec.rb b/spec/controllers/passwords_controller_spec.rb index 0af55cf3408..e5fff3a9d0b 100644 --- a/spec/controllers/passwords_controller_spec.rb +++ b/spec/controllers/passwords_controller_spec.rb @@ -14,7 +14,7 @@ describe PasswordsController do post :create expect(response).to have_gitlab_http_status(302) - expect(flash[:alert]).to eq 'Password authentication is unavailable.' + expect(flash[:alert]).to eq _('Password authentication is unavailable.') end end @@ -24,7 +24,7 @@ describe PasswordsController do it 'prevents a password reset' do post :create, params: { user: { email: user.email } } - expect(flash[:alert]).to eq 'Password authentication is unavailable.' + expect(flash[:alert]).to eq _('Password authentication is unavailable.') end end end diff --git a/spec/controllers/profiles/preferences_controller_spec.rb b/spec/controllers/profiles/preferences_controller_spec.rb index 012f016b091..b73b85793f8 100644 --- a/spec/controllers/profiles/preferences_controller_spec.rb +++ b/spec/controllers/profiles/preferences_controller_spec.rb @@ -35,7 +35,7 @@ describe Profiles::PreferencesController do context 'on successful update' do it 'sets the flash' do go - expect(flash[:notice]).to eq 'Preferences saved.' + expect(flash[:notice]).to eq _('Preferences saved.') end it "changes the user's preferences" do @@ -58,7 +58,7 @@ describe Profiles::PreferencesController do go - expect(flash[:alert]).to eq('Failed to save preferences.') + expect(flash[:alert]).to eq(_('Failed to save preferences.')) end end diff --git a/spec/controllers/profiles_controller_spec.rb b/spec/controllers/profiles_controller_spec.rb index 11cb59aa12a..f912fafc74d 100644 --- a/spec/controllers/profiles_controller_spec.rb +++ b/spec/controllers/profiles_controller_spec.rb @@ -82,9 +82,9 @@ describe ProfilesController, :request_store do it 'allows setting a user status' do sign_in(user) - put :update, params: { user: { status: { message: 'Working hard!' } } } + put :update, params: { user: { status: { message: _('Working hard!') } } } - expect(user.reload.status.message).to eq('Working hard!') + expect(user.reload.status.message).to eq(_('Working hard!')) expect(response).to have_gitlab_http_status(302) end end diff --git a/spec/controllers/projects/clusters_controller_spec.rb b/spec/controllers/projects/clusters_controller_spec.rb index d94c18ddc02..16555b4cbf8 100644 --- a/spec/controllers/projects/clusters_controller_spec.rb +++ b/spec/controllers/projects/clusters_controller_spec.rb @@ -432,7 +432,7 @@ describe Projects::ClustersController do cluster.reload expect(response).to redirect_to(project_cluster_path(project, cluster)) - expect(flash[:notice]).to eq('Kubernetes cluster was successfully updated.') + expect(flash[:notice]).to eq(_('Kubernetes cluster was successfully updated.')) expect(cluster.enabled).to be_falsey expect(cluster.name).to eq('my-new-cluster-name') expect(cluster.platform_kubernetes.namespace).to eq('my-namespace') @@ -521,7 +521,7 @@ describe Projects::ClustersController do .and change { Clusters::Providers::Gcp.count }.by(-1) expect(response).to redirect_to(project_clusters_path(project)) - expect(flash[:notice]).to eq('Kubernetes cluster integration was successfully removed.') + expect(flash[:notice]).to eq(_('Kubernetes cluster integration was successfully removed.')) end end @@ -534,7 +534,7 @@ describe Projects::ClustersController do .and change { Clusters::Providers::Gcp.count }.by(-1) expect(response).to redirect_to(project_clusters_path(project)) - expect(flash[:notice]).to eq('Kubernetes cluster integration was successfully removed.') + expect(flash[:notice]).to eq(_('Kubernetes cluster integration was successfully removed.')) end end end @@ -549,7 +549,7 @@ describe Projects::ClustersController do .and change { Clusters::Providers::Gcp.count }.by(0) expect(response).to redirect_to(project_clusters_path(project)) - expect(flash[:notice]).to eq('Kubernetes cluster integration was successfully removed.') + expect(flash[:notice]).to eq(_('Kubernetes cluster integration was successfully removed.')) end end end diff --git a/spec/controllers/projects/commit_controller_spec.rb b/spec/controllers/projects/commit_controller_spec.rb index 26eec90da06..2ff635634b4 100644 --- a/spec/controllers/projects/commit_controller_spec.rb +++ b/spec/controllers/projects/commit_controller_spec.rb @@ -191,7 +191,7 @@ describe Projects::CommitController do }) expect(response).to redirect_to project_commits_path(project, 'master') - expect(flash[:notice]).to eq('The commit has been successfully reverted.') + expect(flash[:notice]).to eq(_('The commit has been successfully reverted.')) end end @@ -248,7 +248,7 @@ describe Projects::CommitController do }) expect(response).to redirect_to project_commits_path(project, 'master') - expect(flash[:notice]).to eq('The commit has been successfully cherry-picked into master.') + expect(flash[:notice]).to eq(_('The commit has been successfully cherry-picked into master.')) end end diff --git a/spec/controllers/projects/group_links_controller_spec.rb b/spec/controllers/projects/group_links_controller_spec.rb index 675eeff8d12..dc0bc35b794 100644 --- a/spec/controllers/projects/group_links_controller_spec.rb +++ b/spec/controllers/projects/group_links_controller_spec.rb @@ -99,7 +99,7 @@ describe Projects::GroupLinksController do expect(response).to redirect_to( project_project_members_path(project) ) - expect(flash[:alert]).to eq('Please select a group.') + expect(flash[:alert]).to eq(_('Please select a group.')) end end end diff --git a/spec/controllers/projects/imports_controller_spec.rb b/spec/controllers/projects/imports_controller_spec.rb index 3ebfe4b0918..a66eb9b2485 100644 --- a/spec/controllers/projects/imports_controller_spec.rb +++ b/spec/controllers/projects/imports_controller_spec.rb @@ -69,7 +69,7 @@ describe Projects::ImportsController do get :show, params: { namespace_id: project.namespace.to_param, project_id: project } - expect(flash[:notice]).to eq 'The project was successfully forked.' + expect(flash[:notice]).to eq _('The project was successfully forked.') expect(response).to redirect_to project_path(project) end end @@ -78,7 +78,7 @@ describe Projects::ImportsController do it 'redirects to namespace_project_path' do get :show, params: { namespace_id: project.namespace.to_param, project_id: project } - expect(flash[:notice]).to eq 'The project was successfully imported.' + expect(flash[:notice]).to eq _('The project was successfully imported.') expect(response).to redirect_to project_path(project) end end diff --git a/spec/controllers/projects/issues_controller_spec.rb b/spec/controllers/projects/issues_controller_spec.rb index a2c3bb2919d..65cc276ad90 100644 --- a/spec/controllers/projects/issues_controller_spec.rb +++ b/spec/controllers/projects/issues_controller_spec.rb @@ -131,7 +131,7 @@ describe Projects::IssuesController do it 'redirects to signin if not logged in' do get :new, params: { namespace_id: project.namespace, project_id: project } - expect(flash[:notice]).to eq 'Please sign in to create the new issue.' + expect(flash[:notice]).to eq _('Please sign in to create the new issue.') expect(response).to redirect_to(new_user_session_path) end @@ -768,7 +768,7 @@ describe Projects::IssuesController do it 'sets a flash message' do post_issue(title: 'Hello') - expect(flash[:notice]).to eq('Resolved all discussions.') + expect(flash[:notice]).to eq(_('Resolved all discussions.')) end describe "resolving a single discussion" do @@ -782,7 +782,7 @@ describe Projects::IssuesController do end it 'sets a flash message that one discussion was resolved' do - expect(flash[:notice]).to eq('Resolved 1 discussion.') + expect(flash[:notice]).to eq(_('Resolved 1 discussion.')) end end end @@ -1067,7 +1067,7 @@ describe Projects::IssuesController do import_csv - expect(flash[:alert]).to include('File upload error.') + expect(flash[:alert]).to include(_('File upload error.')) expect(response).to redirect_to(project_issues_path(project)) end end diff --git a/spec/controllers/projects/pipeline_schedules_controller_spec.rb b/spec/controllers/projects/pipeline_schedules_controller_spec.rb index 80506249ea9..b1d9dc22e91 100644 --- a/spec/controllers/projects/pipeline_schedules_controller_spec.rb +++ b/spec/controllers/projects/pipeline_schedules_controller_spec.rb @@ -410,7 +410,7 @@ describe Projects::PipelineSchedulesController do end expect(flash.to_a.size).to eq(2) - expect(flash[:alert]).to eq 'You cannot play this scheduled pipeline at the moment. Please wait a minute.' + expect(flash[:alert]).to eq _('You cannot play this scheduled pipeline at the moment. Please wait a minute.') expect(response).to have_gitlab_http_status(302) end end diff --git a/spec/controllers/projects/project_members_controller_spec.rb b/spec/controllers/projects/project_members_controller_spec.rb index 3cc3fe69fba..99b7f3304a7 100644 --- a/spec/controllers/projects/project_members_controller_spec.rb +++ b/spec/controllers/projects/project_members_controller_spec.rb @@ -52,7 +52,7 @@ describe Projects::ProjectMembersController do access_level: Gitlab::Access::GUEST } - expect(response).to set_flash.to 'Users were successfully added.' + expect(response).to set_flash.to _('Users were successfully added.') expect(response).to redirect_to(project_project_members_path(project)) end @@ -225,7 +225,7 @@ describe Projects::ProjectMembersController do project_id: project } - expect(response).to set_flash.to 'Your access request to the project has been withdrawn.' + expect(response).to set_flash.to _('Your access request to the project has been withdrawn.') expect(response).to redirect_to(project_path(project)) expect(project.requesters).to be_empty expect(project.users).not_to include user @@ -245,7 +245,7 @@ describe Projects::ProjectMembersController do project_id: project } - expect(response).to set_flash.to 'Your request for access has been queued for review.' + expect(response).to set_flash.to _('Your request for access has been queued for review.') expect(response).to redirect_to( project_path(project) ) diff --git a/spec/controllers/projects/services_controller_spec.rb b/spec/controllers/projects/services_controller_spec.rb index 4a5d2bdecb7..b4af153d77a 100644 --- a/spec/controllers/projects/services_controller_spec.rb +++ b/spec/controllers/projects/services_controller_spec.rb @@ -28,7 +28,7 @@ describe Projects::ServicesController do it 'returns error messages in JSON response' do put :test, params: { namespace_id: project.namespace, project_id: project, id: service.to_param, service: service_params } - expect(json_response['message']).to eq "Validations failed." + expect(json_response['message']).to eq _("Validations failed.") expect(json_response['service_response']).to include "Url can't be blank" expect(response).to have_gitlab_http_status(200) end @@ -111,7 +111,7 @@ describe Projects::ServicesController do expect(response).to have_gitlab_http_status(200) expect(json_response).to eq( 'error' => true, - 'message' => 'Test failed.', + 'message' => _('Test failed.'), 'service_response' => '', 'test_failed' => true ) @@ -126,7 +126,7 @@ describe Projects::ServicesController do params: { namespace_id: project.namespace, project_id: project, id: service.to_param, service: { active: true } } expect(response).to redirect_to(project_settings_integrations_path(project)) - expect(flash[:notice]).to eq 'JIRA activated.' + expect(flash[:notice]).to eq _('JIRA activated.') end end @@ -135,7 +135,7 @@ describe Projects::ServicesController do put :update, params: { namespace_id: project.namespace, project_id: project, id: service.to_param, service: { active: false } } - expect(flash[:notice]).to eq 'JIRA settings saved, but not activated.' + expect(flash[:notice]).to eq _('JIRA settings saved, but not activated.') end end diff --git a/spec/controllers/projects/tree_controller_spec.rb b/spec/controllers/projects/tree_controller_spec.rb index b15a2bc84a5..77cc55937ee 100644 --- a/spec/controllers/projects/tree_controller_spec.rb +++ b/spec/controllers/projects/tree_controller_spec.rb @@ -114,7 +114,7 @@ describe Projects::TreeController do it 'redirects to the new directory' do expect(subject) .to redirect_to("/#{project.full_path}/tree/#{branch_name}/#{path}") - expect(flash[:notice]).to eq('The directory has been successfully created.') + expect(flash[:notice]).to eq(_('The directory has been successfully created.')) end end diff --git a/spec/controllers/projects/wikis_controller_spec.rb b/spec/controllers/projects/wikis_controller_spec.rb index b2f40231796..7a8dc98c257 100644 --- a/spec/controllers/projects/wikis_controller_spec.rb +++ b/spec/controllers/projects/wikis_controller_spec.rb @@ -43,7 +43,7 @@ describe Projects::WikisController do subject expect(response).to have_http_status(:ok) - expect(flash[:notice]).to eq 'The content of this page is not encoded in UTF-8. Edits can only be made via the Git repository.' + expect(flash[:notice]).to eq _('The content of this page is not encoded in UTF-8. Edits can only be made via the Git repository.') end end diff --git a/spec/controllers/projects_controller_spec.rb b/spec/controllers/projects_controller_spec.rb index 9801ed19957..b64f170efa6 100644 --- a/spec/controllers/projects_controller_spec.rb +++ b/spec/controllers/projects_controller_spec.rb @@ -435,7 +435,7 @@ describe ProjectsController do expect(project.namespace).to eq(old_namespace) expect(response).to have_gitlab_http_status(200) - expect(flash[:alert]).to eq 'Please select a new namespace for your project.' + expect(flash[:alert]).to eq _('Please select a new namespace for your project.') end end end @@ -587,7 +587,7 @@ describe ProjectsController do format: :js) expect(forked_project.reload.forked?).to be_falsey - expect(flash[:notice]).to eq('The fork relationship has been removed.') + expect(flash[:notice]).to eq(_('The fork relationship has been removed.')) expect(response).to render_template(:remove_fork) end end diff --git a/spec/controllers/registrations_controller_spec.rb b/spec/controllers/registrations_controller_spec.rb index fd151e8a298..aae27e238d3 100644 --- a/spec/controllers/registrations_controller_spec.rb +++ b/spec/controllers/registrations_controller_spec.rb @@ -55,7 +55,7 @@ describe RegistrationsController do post(:create, params: user_params) expect(response).to render_template(:new) - expect(flash[:alert]).to include 'There was an error with the reCAPTCHA. Please solve the reCAPTCHA again.' + expect(flash[:alert]).to include _('There was an error with the reCAPTCHA. Please solve the reCAPTCHA again.') end it 'redirects to the dashboard when the recaptcha is solved' do @@ -112,7 +112,7 @@ describe RegistrationsController do end def expect_success - expect(flash[:notice]).to eq 'Account scheduled for removal.' + expect(flash[:notice]).to eq _('Account scheduled for removal.') expect(response.status).to eq(303) expect(response).to redirect_to new_user_session_path end diff --git a/spec/controllers/sessions_controller_spec.rb b/spec/controllers/sessions_controller_spec.rb index ea7242c1aa8..fa71ebb7d1b 100644 --- a/spec/controllers/sessions_controller_spec.rb +++ b/spec/controllers/sessions_controller_spec.rb @@ -101,7 +101,7 @@ describe SessionsController do post(:create, params: { user: user_params }) expect(response).to render_template(:new) - expect(flash[:alert]).to include 'There was an error with the reCAPTCHA. Please solve the reCAPTCHA again.' + expect(flash[:alert]).to include _('There was an error with the reCAPTCHA. Please solve the reCAPTCHA again.') expect(subject.current_user).to be_nil end |