summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/controllers/abuse_reports_controller_spec.rb4
-rw-r--r--spec/controllers/admin/groups_controller_spec.rb6
-rw-r--r--spec/controllers/groups/clusters_controller_spec.rb8
-rw-r--r--spec/controllers/groups/group_members_controller_spec.rb10
-rw-r--r--spec/controllers/omniauth_callbacks_controller_spec.rb2
-rw-r--r--spec/controllers/passwords_controller_spec.rb4
-rw-r--r--spec/controllers/profiles/preferences_controller_spec.rb4
-rw-r--r--spec/controllers/profiles_controller_spec.rb4
-rw-r--r--spec/controllers/projects/clusters_controller_spec.rb8
-rw-r--r--spec/controllers/projects/commit_controller_spec.rb4
-rw-r--r--spec/controllers/projects/group_links_controller_spec.rb2
-rw-r--r--spec/controllers/projects/imports_controller_spec.rb4
-rw-r--r--spec/controllers/projects/issues_controller_spec.rb8
-rw-r--r--spec/controllers/projects/pipeline_schedules_controller_spec.rb2
-rw-r--r--spec/controllers/projects/project_members_controller_spec.rb6
-rw-r--r--spec/controllers/projects/services_controller_spec.rb8
-rw-r--r--spec/controllers/projects/tree_controller_spec.rb2
-rw-r--r--spec/controllers/projects/wikis_controller_spec.rb2
-rw-r--r--spec/controllers/projects_controller_spec.rb4
-rw-r--r--spec/controllers/registrations_controller_spec.rb4
-rw-r--r--spec/controllers/sessions_controller_spec.rb2
-rw-r--r--spec/factories/groups.rb2
-rw-r--r--spec/factories/projects.rb8
-rw-r--r--spec/factories/terms.rb2
-rw-r--r--spec/features/admin/admin_health_check_spec.rb2
-rw-r--r--spec/features/admin/admin_settings_spec.rb6
-rw-r--r--spec/features/admin/admin_users_impersonation_tokens_spec.rb4
-rw-r--r--spec/features/admin/admin_uses_repository_checks_spec.rb2
-rw-r--r--spec/features/atom/users_spec.rb2
-rw-r--r--spec/features/boards/add_issues_modal_spec.rb2
-rw-r--r--spec/features/boards/boards_spec.rb2
-rw-r--r--spec/features/boards/modal_filter_spec.rb2
-rw-r--r--spec/features/cycle_analytics_spec.rb6
-rw-r--r--spec/features/expand_collapse_diffs_spec.rb2
-rw-r--r--spec/features/explore/groups_list_spec.rb6
-rw-r--r--spec/features/groups/clusters/user_spec.rb6
-rw-r--r--spec/features/groups/members/request_access_spec.rb4
-rw-r--r--spec/features/groups/milestone_spec.rb2
-rw-r--r--spec/features/groups/settings/group_badges_spec.rb2
-rw-r--r--spec/features/groups_spec.rb6
-rw-r--r--spec/features/import/manifest_import_spec.rb2
-rw-r--r--spec/features/invites_spec.rb8
-rw-r--r--spec/features/issuables/discussion_lock_spec.rb2
-rw-r--r--spec/features/issuables/shortcuts_issuable_spec.rb2
-rw-r--r--spec/features/issues/create_issue_for_discussions_in_merge_request_spec.rb2
-rw-r--r--spec/features/issues/note_polling_spec.rb4
-rw-r--r--spec/features/issues/user_creates_issue_spec.rb2
-rw-r--r--spec/features/issues_spec.rb6
-rw-r--r--spec/features/merge_request/maintainer_edits_fork_spec.rb2
-rw-r--r--spec/features/merge_request/user_expands_diff_spec.rb4
-rw-r--r--spec/features/merge_request/user_locks_discussion_spec.rb2
-rw-r--r--spec/features/merge_request/user_posts_notes_spec.rb6
-rw-r--r--spec/features/merge_request/user_resolves_conflicts_spec.rb2
-rw-r--r--spec/features/merge_request/user_reverts_merge_request_spec.rb4
-rw-r--r--spec/features/merge_request/user_sees_merge_button_depending_on_unresolved_discussions_spec.rb2
-rw-r--r--spec/features/merge_request/user_sees_merge_widget_spec.rb2
-rw-r--r--spec/features/merge_request/user_sees_mr_with_deleted_source_branch_spec.rb4
-rw-r--r--spec/features/merge_request/user_sees_pipelines_spec.rb2
-rw-r--r--spec/features/merge_request/user_uses_quick_actions_spec.rb4
-rw-r--r--spec/features/merge_request/user_views_open_merge_request_spec.rb2
-rw-r--r--spec/features/milestone_spec.rb4
-rw-r--r--spec/features/password_reset_spec.rb2
-rw-r--r--spec/features/profiles/active_sessions_spec.rb2
-rw-r--r--spec/features/profiles/chat_names_spec.rb2
-rw-r--r--spec/features/profiles/oauth_applications_spec.rb2
-rw-r--r--spec/features/profiles/personal_access_tokens_spec.rb4
-rw-r--r--spec/features/profiles/user_visits_profile_preferences_page_spec.rb2
-rw-r--r--spec/features/projects/artifacts/file_spec.rb2
-rw-r--r--spec/features/projects/blobs/blob_show_spec.rb12
-rw-r--r--spec/features/projects/clusters/applications_spec.rb2
-rw-r--r--spec/features/projects/clusters/gcp_spec.rb14
-rw-r--r--spec/features/projects/clusters/user_spec.rb6
-rw-r--r--spec/features/projects/commit/cherry_pick_spec.rb6
-rw-r--r--spec/features/projects/commit/user_reverts_commit_spec.rb4
-rw-r--r--spec/features/projects/commits/user_browses_commits_spec.rb2
-rw-r--r--spec/features/projects/compare_spec.rb2
-rw-r--r--spec/features/projects/diffs/diff_show_spec.rb6
-rw-r--r--spec/features/projects/environments/environment_spec.rb6
-rw-r--r--spec/features/projects/features_visibility_spec.rb2
-rw-r--r--spec/features/projects/files/editing_a_file_spec.rb2
-rw-r--r--spec/features/projects/files/user_browses_files_spec.rb8
-rw-r--r--spec/features/projects/files/user_creates_files_spec.rb4
-rw-r--r--spec/features/projects/jobs_spec.rb12
-rw-r--r--spec/features/projects/members/user_requests_access_spec.rb4
-rw-r--r--spec/features/projects/milestones/milestone_spec.rb2
-rw-r--r--spec/features/projects/network_graph_spec.rb2
-rw-r--r--spec/features/projects/pipelines/pipelines_spec.rb8
-rw-r--r--spec/features/projects/services/user_activates_asana_spec.rb2
-rw-r--r--spec/features/projects/services/user_activates_assembla_spec.rb2
-rw-r--r--spec/features/projects/services/user_activates_atlassian_bamboo_ci_spec.rb2
-rw-r--r--spec/features/projects/services/user_activates_emails_on_push_spec.rb2
-rw-r--r--spec/features/projects/services/user_activates_flowdock_spec.rb2
-rw-r--r--spec/features/projects/services/user_activates_hipchat_spec.rb4
-rw-r--r--spec/features/projects/services/user_activates_irker_spec.rb2
-rw-r--r--spec/features/projects/services/user_activates_issue_tracker_spec.rb2
-rw-r--r--spec/features/projects/services/user_activates_jetbrains_teamcity_ci_spec.rb2
-rw-r--r--spec/features/projects/services/user_activates_jira_spec.rb8
-rw-r--r--spec/features/projects/services/user_activates_mattermost_slash_command_spec.rb8
-rw-r--r--spec/features/projects/services/user_activates_packagist_spec.rb2
-rw-r--r--spec/features/projects/services/user_activates_pivotaltracker_spec.rb2
-rw-r--r--spec/features/projects/services/user_activates_prometheus_spec.rb2
-rw-r--r--spec/features/projects/services/user_activates_pushover_spec.rb2
-rw-r--r--spec/features/projects/services/user_activates_slack_notifications_spec.rb2
-rw-r--r--spec/features/projects/services/user_activates_slack_slash_command_spec.rb4
-rw-r--r--spec/features/projects/settings/forked_project_settings_spec.rb2
-rw-r--r--spec/features/projects/settings/project_badges_spec.rb2
-rw-r--r--spec/features/projects/settings/user_renames_a_project_spec.rb6
-rw-r--r--spec/features/projects/settings/visibility_settings_spec.rb6
-rw-r--r--spec/features/projects/snippets/create_snippet_spec.rb6
-rw-r--r--spec/features/projects/snippets/user_comments_on_snippet_spec.rb4
-rw-r--r--spec/features/projects/wiki/user_creates_wiki_page_spec.rb20
-rw-r--r--spec/features/projects/wiki/user_updates_wiki_page_spec.rb10
-rw-r--r--spec/features/projects/wiki/user_views_wiki_page_spec.rb2
-rw-r--r--spec/features/projects_spec.rb2
-rw-r--r--spec/features/read_only_spec.rb4
-rw-r--r--spec/features/runners_spec.rb6
-rw-r--r--spec/features/signed_commits_spec.rb10
-rw-r--r--spec/features/snippets/notes_on_personal_snippets_spec.rb8
-rw-r--r--spec/features/snippets/user_creates_snippet_spec.rb10
-rw-r--r--spec/features/tags/master_views_tags_spec.rb4
-rw-r--r--spec/features/triggers_spec.rb12
-rw-r--r--spec/features/u2f_spec.rb6
-rw-r--r--spec/features/unsubscribe_links_spec.rb2
-rw-r--r--spec/features/uploads/user_uploads_file_to_note_spec.rb2
-rw-r--r--spec/features/usage_stats_consent_spec.rb2
-rw-r--r--spec/features/users/add_email_to_existing_account.rb2
-rw-r--r--spec/features/users/login_spec.rb22
-rw-r--r--spec/features/users/show_spec.rb4
-rw-r--r--spec/features/users/signup_spec.rb2
-rw-r--r--spec/features/users/terms_spec.rb4
-rw-r--r--spec/helpers/auto_devops_helper_spec.rb2
-rw-r--r--spec/helpers/button_helper_spec.rb8
-rw-r--r--spec/helpers/markup_helper_spec.rb2
-rw-r--r--spec/helpers/visibility_level_helper_spec.rb10
-rw-r--r--spec/initializers/fog_google_https_private_urls_spec.rb2
-rw-r--r--spec/lib/banzai/filter/emoji_filter_spec.rb4
-rw-r--r--spec/lib/banzai/filter/label_reference_filter_spec.rb2
-rw-r--r--spec/lib/gitlab/auth/ldap/adapter_spec.rb2
-rw-r--r--spec/lib/gitlab/bitbucket_server_import/importer_spec.rb2
-rw-r--r--spec/lib/gitlab/checks/branch_check_spec.rb12
-rw-r--r--spec/lib/gitlab/checks/push_check_spec.rb2
-rw-r--r--spec/lib/gitlab/checks/tag_check_spec.rb2
-rw-r--r--spec/lib/gitlab/checks/timed_logger_spec.rb2
-rw-r--r--spec/lib/gitlab/ci/config/entry/global_spec.rb4
-rw-r--r--spec/lib/gitlab/ci/config/extendable/entry_spec.rb2
-rw-r--r--spec/lib/gitlab/ci/config/external/file/project_spec.rb2
-rw-r--r--spec/lib/gitlab/ci/config/external/file/template_spec.rb4
-rw-r--r--spec/lib/gitlab/ci/config/external/processor_spec.rb4
-rw-r--r--spec/lib/gitlab/ci/config_spec.rb4
-rw-r--r--spec/lib/gitlab/ci/pipeline/chain/populate_spec.rb4
-rw-r--r--spec/lib/gitlab/cleanup/project_uploads_spec.rb4
-rw-r--r--spec/lib/gitlab/config/entry/attributable_spec.rb2
-rw-r--r--spec/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_base_spec.rb2
-rw-r--r--spec/lib/gitlab/email/handler/create_note_handler_spec.rb4
-rw-r--r--spec/lib/gitlab/email/reply_parser_spec.rb2
-rw-r--r--spec/lib/gitlab/encoding_helper_spec.rb4
-rw-r--r--spec/lib/gitlab/git/repository_spec.rb2
-rw-r--r--spec/lib/gitlab/git/wraps_gitaly_errors_spec.rb2
-rw-r--r--spec/lib/gitlab/git_access_spec.rb14
-rw-r--r--spec/lib/gitlab/git_access_wiki_spec.rb6
-rw-r--r--spec/lib/gitlab/google_code_import/importer_spec.rb2
-rw-r--r--spec/lib/gitlab/highlight_spec.rb2
-rw-r--r--spec/lib/gitlab/i18n/po_linter_spec.rb10
-rw-r--r--spec/lib/gitlab/import_export/project_tree_restorer_spec.rb4
-rw-r--r--spec/lib/gitlab/legacy_github_import/importer_spec.rb2
-rw-r--r--spec/lib/gitlab/manifest_import/manifest_spec.rb4
-rw-r--r--spec/lib/gitlab/quick_actions/dsl_spec.rb6
-rw-r--r--spec/lib/gitlab/shell_spec.rb4
-rw-r--r--spec/lib/gitlab/sidekiq_logging/structured_logger_spec.rb2
-rw-r--r--spec/lib/mattermost/command_spec.rb4
-rw-r--r--spec/lib/mattermost/team_spec.rb4
-rw-r--r--spec/lib/system_check/simple_executor_spec.rb10
-rw-r--r--spec/mailers/notify_spec.rb2
-rw-r--r--spec/models/commit_spec.rb8
-rw-r--r--spec/models/concerns/prometheus_adapter_spec.rb2
-rw-r--r--spec/models/concerns/reactive_caching_spec.rb2
-rw-r--r--spec/models/concerns/spammable_spec.rb2
-rw-r--r--spec/models/milestone_spec.rb2
-rw-r--r--spec/models/project_label_spec.rb2
-rw-r--r--spec/models/project_services/bamboo_service_spec.rb8
-rw-r--r--spec/models/project_services/jira_service_spec.rb4
-rw-r--r--spec/models/project_services/mattermost_slash_commands_service_spec.rb8
-rw-r--r--spec/models/project_services/teamcity_service_spec.rb8
-rw-r--r--spec/models/project_spec.rb2
-rw-r--r--spec/models/repository_spec.rb6
-rw-r--r--spec/requests/api/files_spec.rb2
-rw-r--r--spec/requests/api/helpers_spec.rb4
-rw-r--r--spec/requests/api/issues_spec.rb4
-rw-r--r--spec/requests/api/markdown_spec.rb10
-rw-r--r--spec/requests/api/releases_spec.rb4
-rw-r--r--spec/requests/api/settings_spec.rb4
-rw-r--r--spec/requests/api/tags_spec.rb8
-rw-r--r--spec/requests/git_http_spec.rb2
-rw-r--r--spec/requests/lfs_http_spec.rb10
-rw-r--r--spec/serializers/analytics_issue_entity_spec.rb2
-rw-r--r--spec/serializers/analytics_issue_serializer_spec.rb2
-rw-r--r--spec/serializers/analytics_merge_request_serializer_spec.rb2
-rw-r--r--spec/services/application_settings/update_service_spec.rb6
-rw-r--r--spec/services/ci/create_pipeline_service_spec.rb12
-rw-r--r--spec/services/clusters/applications/check_installation_progress_service_spec.rb4
-rw-r--r--spec/services/files/delete_service_spec.rb2
-rw-r--r--spec/services/files/update_service_spec.rb2
-rw-r--r--spec/services/groups/create_service_spec.rb4
-rw-r--r--spec/services/groups/transfer_service_spec.rb14
-rw-r--r--spec/services/labels/find_or_create_service_spec.rb2
-rw-r--r--spec/services/merge_requests/build_service_spec.rb2
-rw-r--r--spec/services/merge_requests/conflicts/resolve_service_spec.rb10
-rw-r--r--spec/services/preview_markdown_service_spec.rb4
-rw-r--r--spec/services/projects/lfs_pointers/lfs_download_link_list_service_spec.rb2
-rw-r--r--spec/services/projects/transfer_service_spec.rb4
-rw-r--r--spec/services/projects/update_service_spec.rb6
-rw-r--r--spec/services/quick_actions/interpret_service_spec.rb34
-rw-r--r--spec/services/releases/create_service_spec.rb2
-rw-r--r--spec/services/releases/update_service_spec.rb2
-rw-r--r--spec/services/test_hooks/project_service_spec.rb20
-rw-r--r--spec/services/test_hooks/system_service_spec.rb2
-rw-r--r--spec/support/features/issuable_quick_actions_shared_examples.rb2
-rw-r--r--spec/support/helpers/filtered_search_helpers.rb2
-rw-r--r--spec/support/helpers/live_debugger.rb6
-rw-r--r--spec/support/helpers/select2_helper.rb2
-rw-r--r--spec/support/helpers/terms_helper.rb2
-rw-r--r--spec/support/helpers/test_env.rb6
-rw-r--r--spec/support/shared_examples/uploaders/gitlab_uploader_shared_examples.rb4
-rw-r--r--spec/support/shared_examples/uploaders/object_storage_shared_examples.rb10
-rw-r--r--spec/tasks/gitlab/cleanup_rake_spec.rb4
-rw-r--r--spec/tasks/gitlab/uploads/migrate_rake_spec.rb2
-rw-r--r--spec/uploaders/workers/object_storage/migrate_uploads_worker_spec.rb2
-rw-r--r--spec/validators/namespace_path_validator_spec.rb2
-rw-r--r--spec/validators/project_path_validator_spec.rb2
-rw-r--r--spec/views/projects/services/_form.haml_spec.rb4
-rw-r--r--spec/views/projects/settings/ci_cd/_autodevops_form.html.haml_spec.rb2
-rw-r--r--spec/workers/repository_remove_remote_worker_spec.rb2
232 files changed, 517 insertions, 517 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
diff --git a/spec/factories/groups.rb b/spec/factories/groups.rb
index 3b354c0d96b..753003a1572 100644
--- a/spec/factories/groups.rb
+++ b/spec/factories/groups.rb
@@ -9,7 +9,7 @@ FactoryBot.define do
if group.owner
# We could remove this after we have proper constraint:
# https://gitlab.com/gitlab-org/gitlab-ce/issues/43292
- raise "Don't set owner for groups, use `group.add_owner(user)` instead"
+ raise _("Don't set owner for groups, use `group.add_owner(user)` instead")
end
end
diff --git a/spec/factories/projects.rb b/spec/factories/projects.rb
index 1906c06a211..98a8994b7df 100644
--- a/spec/factories/projects.rb
+++ b/spec/factories/projects.rb
@@ -146,7 +146,7 @@ FactoryBot.define do
end
after :create do |project, evaluator|
- raise "Failed to create repository!" unless project.create_repository
+ raise _("Failed to create repository!") unless project.create_repository
evaluator.files.each do |filename, content|
project.repository.create_file(
@@ -196,7 +196,7 @@ FactoryBot.define do
trait :empty_repo do
after(:create) do |project|
- raise "Failed to create repository!" unless project.create_repository
+ raise _("Failed to create repository!") unless project.create_repository
end
end
@@ -220,7 +220,7 @@ FactoryBot.define do
trait :wiki_repo do
after(:create) do |project|
- raise 'Failed to create wiki repository!' unless project.create_wiki
+ raise _('Failed to create wiki repository!') unless project.create_wiki
end
end
@@ -230,7 +230,7 @@ FactoryBot.define do
trait :broken_repo do
after(:create) do |project|
- raise "Failed to create repository!" unless project.create_repository
+ raise _("Failed to create repository!") unless project.create_repository
project.gitlab_shell.rm_directory(project.repository_storage,
File.join("#{project.disk_path}.git", 'refs'))
diff --git a/spec/factories/terms.rb b/spec/factories/terms.rb
index 5ffca365a5f..45307cbb34e 100644
--- a/spec/factories/terms.rb
+++ b/spec/factories/terms.rb
@@ -1,5 +1,5 @@
FactoryBot.define do
factory :term, class: ApplicationSetting::Term do
- terms "Lorem ipsum dolor sit amet, consectetur adipiscing elit."
+ terms _("Lorem ipsum dolor sit amet, consectetur adipiscing elit.")
end
end
diff --git a/spec/features/admin/admin_health_check_spec.rb b/spec/features/admin/admin_health_check_spec.rb
index 790051dd933..253065bafda 100644
--- a/spec/features/admin/admin_health_check_spec.rb
+++ b/spec/features/admin/admin_health_check_spec.rb
@@ -29,7 +29,7 @@ describe "Admin Health Check", :feature do
orig_token = Gitlab::CurrentSettings.health_check_access_token
click_button 'Reset health check access token'
- expect(page).to have_content('New health check access token has been generated!')
+ expect(page).to have_content(_('New health check access token has been generated!'))
expect(find('#health-check-token').text).not_to eq orig_token
end
end
diff --git a/spec/features/admin/admin_settings_spec.rb b/spec/features/admin/admin_settings_spec.rb
index 04f39b807d7..99a3eff8212 100644
--- a/spec/features/admin/admin_settings_spec.rb
+++ b/spec/features/admin/admin_settings_spec.rb
@@ -128,13 +128,13 @@ describe 'Admin updates settings' do
accept_terms(admin)
page.within('.as-terms') do
- check 'Require all users to accept Terms of Service and Privacy Policy when they access GitLab.'
- fill_in 'Terms of Service Agreement', with: 'Be nice!'
+ check _('Require all users to accept Terms of Service and Privacy Policy when they access GitLab.')
+ fill_in 'Terms of Service Agreement', with: _('Be nice!')
click_button 'Save changes'
end
expect(Gitlab::CurrentSettings.enforce_terms).to be(true)
- expect(Gitlab::CurrentSettings.terms).to eq 'Be nice!'
+ expect(Gitlab::CurrentSettings.terms).to eq _('Be nice!')
expect(page).to have_content 'Application settings saved successfully'
end
diff --git a/spec/features/admin/admin_users_impersonation_tokens_spec.rb b/spec/features/admin/admin_users_impersonation_tokens_spec.rb
index c7860bebb06..af346ad35b9 100644
--- a/spec/features/admin/admin_users_impersonation_tokens_spec.rb
+++ b/spec/features/admin/admin_users_impersonation_tokens_spec.rb
@@ -68,7 +68,7 @@ describe 'Admin > Users > Impersonation Tokens', :js do
accept_confirm { click_on "Revoke" }
expect(page).to have_selector(".settings-message")
- expect(no_personal_access_tokens_message).to have_text("This user has no active Impersonation Tokens.")
+ expect(no_personal_access_tokens_message).to have_text(_("This user has no active Impersonation Tokens."))
end
it "removes expired tokens from 'active' section" do
@@ -77,7 +77,7 @@ describe 'Admin > Users > Impersonation Tokens', :js do
visit admin_user_impersonation_tokens_path(user_id: user.username)
expect(page).to have_selector(".settings-message")
- expect(no_personal_access_tokens_message).to have_text("This user has no active Impersonation Tokens.")
+ expect(no_personal_access_tokens_message).to have_text(_("This user has no active Impersonation Tokens."))
end
end
end
diff --git a/spec/features/admin/admin_uses_repository_checks_spec.rb b/spec/features/admin/admin_uses_repository_checks_spec.rb
index d04bb9acd9e..c368b2ee1a7 100644
--- a/spec/features/admin/admin_uses_repository_checks_spec.rb
+++ b/spec/features/admin/admin_uses_repository_checks_spec.rb
@@ -39,7 +39,7 @@ describe 'Admin uses repository checks' do
accept_confirm { find(:link, 'Clear all repository checks').send_keys(:return) }
- expect(page).to have_content('Started asynchronous removal of all repository check states.')
+ expect(page).to have_content(_('Started asynchronous removal of all repository check states.'))
end
def visit_admin_project_page(project)
diff --git a/spec/features/atom/users_spec.rb b/spec/features/atom/users_spec.rb
index 8d7df346abb..3316726b4c8 100644
--- a/spec/features/atom/users_spec.rb
+++ b/spec/features/atom/users_spec.rb
@@ -26,7 +26,7 @@ describe "User Feed" do
create(:issue,
project: project,
author: user,
- description: "Houston, we have a bug!\n\n***\n\nI guess.")
+ description: _("Houston, we have a bug!\n\n***\n\nI guess."))
end
let(:note) do
create(:note,
diff --git a/spec/features/boards/add_issues_modal_spec.rb b/spec/features/boards/add_issues_modal_spec.rb
index 030993462b5..19362d6cd39 100644
--- a/spec/features/boards/add_issues_modal_spec.rb
+++ b/spec/features/boards/add_issues_modal_spec.rb
@@ -30,7 +30,7 @@ describe 'Issue Boards add issue modal', :js do
page.within('.add-issues-modal') do
expect(find('.form-control').value).to eq('')
expect(page).to have_selector('.clear-search', visible: false)
- expect(find('.form-control')[:placeholder]).to eq('Search or filter results...')
+ expect(find('.form-control')[:placeholder]).to eq(_('Search or filter results...'))
end
end
diff --git a/spec/features/boards/boards_spec.rb b/spec/features/boards/boards_spec.rb
index 08c27354bd2..f14aab5de84 100644
--- a/spec/features/boards/boards_spec.rb
+++ b/spec/features/boards/boards_spec.rb
@@ -27,7 +27,7 @@ describe 'Issue Boards', :js do
end
it 'shows blank state' do
- expect(page).to have_content('Welcome to your Issue Board!')
+ expect(page).to have_content(_('Welcome to your Issue Board!'))
end
it 'shows tooltip on add issues button' do
diff --git a/spec/features/boards/modal_filter_spec.rb b/spec/features/boards/modal_filter_spec.rb
index d96707e55fd..037dd9b96db 100644
--- a/spec/features/boards/modal_filter_spec.rb
+++ b/spec/features/boards/modal_filter_spec.rb
@@ -24,7 +24,7 @@ describe 'Issue Boards add issue modal filtering', :js do
wait_for_requests
- expect(page).to have_content('There are no issues to show.')
+ expect(page).to have_content(_('There are no issues to show.'))
end
end
diff --git a/spec/features/cycle_analytics_spec.rb b/spec/features/cycle_analytics_spec.rb
index 32c75cae0a1..9524f59d3bd 100644
--- a/spec/features/cycle_analytics_spec.rb
+++ b/spec/features/cycle_analytics_spec.rb
@@ -32,7 +32,7 @@ describe 'Cycle Analytics', :js do
it 'shows active stage with empty message' do
expect(page).to have_selector('.stage-nav-item.active', text: 'Issue')
- expect(page).to have_content("We don't have enough data to show this stage.")
+ expect(page).to have_content(_("We don't have enough data to show this stage."))
end
end
@@ -129,10 +129,10 @@ describe 'Cycle Analytics', :js do
expect(find('.stage-events')).to have_content(issue.title)
click_stage('Code')
- expect(find('.stage-events')).to have_content('You need permission.')
+ expect(find('.stage-events')).to have_content(_('You need permission.'))
click_stage('Review')
- expect(find('.stage-events')).to have_content('You need permission.')
+ expect(find('.stage-events')).to have_content(_('You need permission.'))
end
end
diff --git a/spec/features/expand_collapse_diffs_spec.rb b/spec/features/expand_collapse_diffs_spec.rb
index 8d801161148..17e33e04cb1 100644
--- a/spec/features/expand_collapse_diffs_spec.rb
+++ b/spec/features/expand_collapse_diffs_spec.rb
@@ -257,7 +257,7 @@ describe 'Expand and collapse diffs', :js do
# Wait for elements to appear to ensure full page reload
expect(page).to have_content('This diff was suppressed by a .gitattributes entry')
- expect(page).to have_content('This source diff could not be displayed because it is too large.')
+ expect(page).to have_content(_('This source diff could not be displayed because it is too large.'))
expect(page).to have_content('too_large_image.jpg')
find('.note-textarea')
diff --git a/spec/features/explore/groups_list_spec.rb b/spec/features/explore/groups_list_spec.rb
index 8ed4051856e..9f4b6c6ce3f 100644
--- a/spec/features/explore/groups_list_spec.rb
+++ b/spec/features/explore/groups_list_spec.rb
@@ -69,13 +69,13 @@ describe 'Explore Groups page', :js do
describe 'landing component' do
it 'should show a landing component' do
- expect(page).to have_content('Below you will find all the groups that are public.')
+ expect(page).to have_content(_('Below you will find all the groups that are public.'))
end
it 'should be dismissable' do
find('.dismiss-button').click
- expect(page).not_to have_content('Below you will find all the groups that are public.')
+ expect(page).not_to have_content(_('Below you will find all the groups that are public.'))
end
it 'should persistently not show once dismissed' do
@@ -83,7 +83,7 @@ describe 'Explore Groups page', :js do
visit explore_groups_path
- expect(page).not_to have_content('Below you will find all the groups that are public.')
+ expect(page).not_to have_content(_('Below you will find all the groups that are public.'))
end
end
end
diff --git a/spec/features/groups/clusters/user_spec.rb b/spec/features/groups/clusters/user_spec.rb
index 2410cd92e3f..77a5d76ea08 100644
--- a/spec/features/groups/clusters/user_spec.rb
+++ b/spec/features/groups/clusters/user_spec.rb
@@ -92,7 +92,7 @@ describe 'User Cluster', :js do
end
it 'user sees the successful message' do
- expect(page).to have_content('Kubernetes cluster was successfully updated.')
+ expect(page).to have_content(_('Kubernetes cluster was successfully updated.'))
end
end
@@ -104,7 +104,7 @@ describe 'User Cluster', :js do
end
it 'user sees the successful message' do
- expect(page).to have_content('Kubernetes cluster was successfully updated.')
+ expect(page).to have_content(_('Kubernetes cluster was successfully updated.'))
expect(cluster.reload.name).to eq('my-dev-cluster')
expect(cluster.reload.platform_kubernetes.token).to eq('new-token')
end
@@ -118,7 +118,7 @@ describe 'User Cluster', :js do
end
it 'user sees creation form with the successful message' do
- expect(page).to have_content('Kubernetes cluster integration was successfully removed.')
+ expect(page).to have_content(_('Kubernetes cluster integration was successfully removed.'))
expect(page).to have_link('Add Kubernetes cluster')
end
end
diff --git a/spec/features/groups/members/request_access_spec.rb b/spec/features/groups/members/request_access_spec.rb
index 94510f917a3..9aa70df8222 100644
--- a/spec/features/groups/members/request_access_spec.rb
+++ b/spec/features/groups/members/request_access_spec.rb
@@ -26,7 +26,7 @@ describe 'Groups > Members > Request access' do
expect(ActionMailer::Base.deliveries.last.subject).to match "Request to join the #{group.name} group"
expect(group.requesters.exists?(user_id: user)).to be_truthy
- expect(page).to have_content 'Your request for access has been queued for review.'
+ expect(page).to have_content _('Your request for access has been queued for review.')
expect(page).to have_content 'Withdraw Access Request'
expect(page).not_to have_content 'Leave group'
@@ -66,7 +66,7 @@ describe 'Groups > Members > Request access' do
click_link 'Withdraw Access Request'
expect(group.requesters.exists?(user_id: user)).to be_falsey
- expect(page).to have_content 'Your access request to the group has been withdrawn.'
+ expect(page).to have_content _('Your access request to the group has been withdrawn.')
end
it 'member does not see the request access button' do
diff --git a/spec/features/groups/milestone_spec.rb b/spec/features/groups/milestone_spec.rb
index d57eb87ca77..45665d32a5f 100644
--- a/spec/features/groups/milestone_spec.rb
+++ b/spec/features/groups/milestone_spec.rb
@@ -27,7 +27,7 @@ describe 'Group milestones' do
preview = find('.js-md-preview')
- expect(preview).to have_content('Nothing to preview.')
+ expect(preview).to have_content(_('Nothing to preview.'))
click_button('Write')
diff --git a/spec/features/groups/settings/group_badges_spec.rb b/spec/features/groups/settings/group_badges_spec.rb
index a5c8dbf18d0..fb717076e52 100644
--- a/spec/features/groups/settings/group_badges_spec.rb
+++ b/spec/features/groups/settings/group_badges_spec.rb
@@ -104,7 +104,7 @@ describe 'Group Badges' do
click_delete_button(rows[1])
- expect(find('.modal .modal-title')).to have_content 'Delete badge?'
+ expect(find('.modal .modal-title')).to have_content _('Delete badge?')
end
it 'deletes a badge when confirming the modal' do
diff --git a/spec/features/groups_spec.rb b/spec/features/groups_spec.rb
index 00d81b26ce2..187daeb18e6 100644
--- a/spec/features/groups_spec.rb
+++ b/spec/features/groups_spec.rb
@@ -9,7 +9,7 @@ describe 'Group' do
matcher :have_namespace_error_message do
match do |page|
- page.has_content?("Group URL can contain only letters, digits, '_', '-' and '.'. Cannot start with '-' or end in '.', '.git' or '.atom'.")
+ page.has_content?(_("Group URL can contain only letters, digits, '_', '-' and '.'. Cannot start with '-' or end in '.', '.git' or '.atom'."))
end
end
@@ -119,7 +119,7 @@ describe 'Group' do
click_button 'Create group'
expect(current_path).to eq(group_path('foo/bar'))
- expect(page).to have_content("Group 'bar' was successfully created.")
+ expect(page).to have_content(_("Group 'bar' was successfully created."))
end
end
@@ -138,7 +138,7 @@ describe 'Group' do
click_button 'Create group'
expect(current_path).to eq(group_path('foo/bar'))
- expect(page).to have_content("Group 'bar' was successfully created.")
+ expect(page).to have_content(_("Group 'bar' was successfully created."))
end
end
end
diff --git a/spec/features/import/manifest_import_spec.rb b/spec/features/import/manifest_import_spec.rb
index a90cdd8d920..55989fcdb7b 100644
--- a/spec/features/import/manifest_import_spec.rb
+++ b/spec/features/import/manifest_import_spec.rb
@@ -42,7 +42,7 @@ describe 'Import multiple repositories by uploading a manifest file', :js, :post
attach_file('manifest', Rails.root.join('spec/fixtures/banana_sample.gif'))
click_on 'List available repositories'
- expect(page).to have_content 'The uploaded file is not a valid XML file.'
+ expect(page).to have_content _('The uploaded file is not a valid XML file.')
end
def first_row
diff --git a/spec/features/invites_spec.rb b/spec/features/invites_spec.rb
index 9e1a12a9c2a..2d3be4986ff 100644
--- a/spec/features/invites_spec.rb
+++ b/spec/features/invites_spec.rb
@@ -52,7 +52,7 @@ describe 'Invites' do
expect(current_path).to eq(invite_path(group_invite.raw_invite_token))
expect(page).to have_content(
- 'You have been invited by John Doe to join group Owned as Developer.'
+ _('You have been invited by John Doe to join group Owned as Developer.')
)
expect(page).to have_link('Accept invitation')
expect(page).to have_link('Decline')
@@ -80,7 +80,7 @@ describe 'Invites' do
page.click_link 'Accept invitation'
expect(current_path).to eq(group_path(group))
expect(page).to have_content(
- 'You have been granted Developer access to group Owned.'
+ _('You have been granted Developer access to group Owned.')
)
end
end
@@ -96,7 +96,7 @@ describe 'Invites' do
page.click_link 'Decline'
expect(current_path).to eq(dashboard_projects_path)
expect(page).to have_content(
- 'You have declined the invitation to join group Owned.'
+ _('You have declined the invitation to join group Owned.')
)
end
end
@@ -109,7 +109,7 @@ describe 'Invites' do
it 'declines application and redirects to sign in page' do
expect(current_path).to eq(new_user_session_path)
expect(page).to have_content(
- 'You have declined the invitation to join group Owned.'
+ _('You have declined the invitation to join group Owned.')
)
end
end
diff --git a/spec/features/issuables/discussion_lock_spec.rb b/spec/features/issuables/discussion_lock_spec.rb
index 7ea29ff252b..3582f153df0 100644
--- a/spec/features/issuables/discussion_lock_spec.rb
+++ b/spec/features/issuables/discussion_lock_spec.rb
@@ -98,7 +98,7 @@ describe 'Discussion Lock', :js do
page.within('#notes') do
expect(page).not_to have_selector('js-main-target-form')
expect(page.find('.disabled-comment'))
- .to have_content('This issue is locked. Only project members can comment.')
+ .to have_content(_('This issue is locked. Only project members can comment.'))
end
end
end
diff --git a/spec/features/issuables/shortcuts_issuable_spec.rb b/spec/features/issuables/shortcuts_issuable_spec.rb
index a0ae6720a9f..e1e2b53704b 100644
--- a/spec/features/issuables/shortcuts_issuable_spec.rb
+++ b/spec/features/issuables/shortcuts_issuable_spec.rb
@@ -5,7 +5,7 @@ describe 'Blob shortcuts', :js do
let(:project) { create(:project, :public, :repository) }
let(:issue) { create(:issue, project: project, author: user) }
let(:merge_request) { create(:merge_request, source_project: project) }
- let(:note_text) { 'I got this!' }
+ let(:note_text) { _('I got this!') }
before do
project.add_developer(user)
diff --git a/spec/features/issues/create_issue_for_discussions_in_merge_request_spec.rb b/spec/features/issues/create_issue_for_discussions_in_merge_request_spec.rb
index ada57285abf..600bdd9d16b 100644
--- a/spec/features/issues/create_issue_for_discussions_in_merge_request_spec.rb
+++ b/spec/features/issues/create_issue_for_discussions_in_merge_request_spec.rb
@@ -65,7 +65,7 @@ describe 'Resolving all open discussions in a merge request from an issue', :js
end
it 'shows a warning that the merge request contains unresolved discussions' do
- expect(page).to have_content 'There are unresolved discussions.'
+ expect(page).to have_content _('There are unresolved discussions.')
end
it 'has a link to resolve all discussions by creating an issue' do
diff --git a/spec/features/issues/note_polling_spec.rb b/spec/features/issues/note_polling_spec.rb
index 3cd7ce6dada..342760c85f6 100644
--- a/spec/features/issues/note_polling_spec.rb
+++ b/spec/features/issues/note_polling_spec.rb
@@ -12,10 +12,10 @@ describe 'Issue notes polling', :js do
end
it 'displays the new comment' do
- note = create(:note, noteable: issue, project: project, note: 'Looks good!')
+ note = create(:note, noteable: issue, project: project, note: _('Looks good!'))
wait_for_requests
- expect(page).to have_selector("#note_#{note.id}", text: 'Looks good!')
+ expect(page).to have_selector("#note_#{note.id}", text: _('Looks good!'))
end
end
diff --git a/spec/features/issues/user_creates_issue_spec.rb b/spec/features/issues/user_creates_issue_spec.rb
index e60486f6dcb..1b028b8933e 100644
--- a/spec/features/issues/user_creates_issue_spec.rb
+++ b/spec/features/issues/user_creates_issue_spec.rb
@@ -57,7 +57,7 @@ describe "User creates issue" do
preview = find(".js-md-preview") # this element is findable only when the "Preview" link is clicked.
- expect(preview).to have_content("Nothing to preview.")
+ expect(preview).to have_content(_("Nothing to preview."))
click_button("Write")
fill_in("Description", with: "Bug fixed :smile:")
diff --git a/spec/features/issues_spec.rb b/spec/features/issues_spec.rb
index 406e80e91aa..38f5d9358d1 100644
--- a/spec/features/issues_spec.rb
+++ b/spec/features/issues_spec.rb
@@ -25,8 +25,8 @@ describe 'Issues' do
visit project_issues_path(project)
expect(page).to have_content('Register / Sign In')
- expect(page).to have_content('The Issue Tracker is the place to add things that need to be improved or solved in a project.')
- expect(page).to have_content('You can register or sign in to create issues for this project.')
+ expect(page).to have_content(_('The Issue Tracker is the place to add things that need to be improved or solved in a project.'))
+ expect(page).to have_content(_('You can register or sign in to create issues for this project.'))
end
it_behaves_like 'empty state with filters'
@@ -47,7 +47,7 @@ describe 'Issues' do
visit project_issues_path(project)
expect(page).to have_content('The Issue Tracker is the place to add things that need to be improved or solved in a project')
- expect(page).to have_content('Issues can be bugs, tasks or ideas to be discussed. Also, issues are searchable and filterable.')
+ expect(page).to have_content(_('Issues can be bugs, tasks or ideas to be discussed. Also, issues are searchable and filterable.'))
expect(page).to have_content('New issue')
end
diff --git a/spec/features/merge_request/maintainer_edits_fork_spec.rb b/spec/features/merge_request/maintainer_edits_fork_spec.rb
index 7839b97122c..0195d37c515 100644
--- a/spec/features/merge_request/maintainer_edits_fork_spec.rb
+++ b/spec/features/merge_request/maintainer_edits_fork_spec.rb
@@ -29,7 +29,7 @@ describe 'a maintainer edits files on a source-branch of an MR from a fork', :js
end
it 'mentions commits will go to the source branch' do
- expect(page).to have_content('Your changes can be committed to fix because a merge request is open.')
+ expect(page).to have_content(_('Your changes can be committed to fix because a merge request is open.'))
end
it 'allows committing to the source branch' do
diff --git a/spec/features/merge_request/user_expands_diff_spec.rb b/spec/features/merge_request/user_expands_diff_spec.rb
index 3560b8d90bb..9d1188d2324 100644
--- a/spec/features/merge_request/user_expands_diff_spec.rb
+++ b/spec/features/merge_request/user_expands_diff_spec.rb
@@ -15,11 +15,11 @@ describe 'User expands diff', :js do
it 'allows user to expand diff' do
page.within find('[id="2f6fcd96b88b36ce98c38da085c795a27d92a3dd"]') do
- click_link 'Click to expand it.'
+ click_link _('Click to expand it.')
wait_for_requests
- expect(page).not_to have_content('Click to expand it.')
+ expect(page).not_to have_content(_('Click to expand it.'))
expect(page).to have_selector('.code')
end
end
diff --git a/spec/features/merge_request/user_locks_discussion_spec.rb b/spec/features/merge_request/user_locks_discussion_spec.rb
index 76c759ab8d3..4cc3194a3a7 100644
--- a/spec/features/merge_request/user_locks_discussion_spec.rb
+++ b/spec/features/merge_request/user_locks_discussion_spec.rb
@@ -41,7 +41,7 @@ describe 'Merge request > User locks discussion', :js do
page.within('.js-vue-notes-event') do
expect(page).not_to have_selector('js-main-target-form')
expect(page.find('.issuable-note-warning'))
- .to have_content('This merge request is locked. Only project members can comment.')
+ .to have_content(_('This merge request is locked. Only project members can comment.'))
end
end
end
diff --git a/spec/features/merge_request/user_posts_notes_spec.rb b/spec/features/merge_request/user_posts_notes_spec.rb
index ee5f5377ca6..7ee4f017495 100644
--- a/spec/features/merge_request/user_posts_notes_spec.rb
+++ b/spec/features/merge_request/user_posts_notes_spec.rb
@@ -49,16 +49,16 @@ describe 'Merge request > User posts notes', :js do
describe 'when posting a note' do
before do
page.within('.js-main-target-form') do
- fill_in 'note[note]', with: 'This is awesome!'
+ fill_in 'note[note]', with: _('This is awesome!')
find('.js-md-preview-button').click
click_button 'Comment'
end
end
it 'is added and form reset' do
- is_expected.to have_content('This is awesome!')
+ is_expected.to have_content(_('This is awesome!'))
page.within('.js-main-target-form') do
- expect(page).to have_no_field('note[note]', with: 'This is awesome!')
+ expect(page).to have_no_field('note[note]', with: _('This is awesome!'))
expect(page).to have_css('.js-vue-md-preview', visible: :hidden)
end
wait_for_requests
diff --git a/spec/features/merge_request/user_resolves_conflicts_spec.rb b/spec/features/merge_request/user_resolves_conflicts_spec.rb
index 50c723776a3..fb4220addaf 100644
--- a/spec/features/merge_request/user_resolves_conflicts_spec.rb
+++ b/spec/features/merge_request/user_resolves_conflicts_spec.rb
@@ -189,7 +189,7 @@ describe 'Merge request > User resolves conflicts', :js do
visit current_url + '/conflicts'
wait_for_requests
- expect(find('#conflicts')).to have_content('Please try to resolve them locally.')
+ expect(find('#conflicts')).to have_content(_('Please try to resolve them locally.'))
end
end
end
diff --git a/spec/features/merge_request/user_reverts_merge_request_spec.rb b/spec/features/merge_request/user_reverts_merge_request_spec.rb
index 67b6aefb2d8..b11b9708a2e 100644
--- a/spec/features/merge_request/user_reverts_merge_request_spec.rb
+++ b/spec/features/merge_request/user_reverts_merge_request_spec.rb
@@ -26,7 +26,7 @@ describe 'User reverts a merge request', :js do
click_button('Revert')
end
- expect(page).to have_content('The merge request has been successfully reverted.')
+ expect(page).to have_content(_('The merge request has been successfully reverted.'))
wait_for_requests
end
@@ -56,7 +56,7 @@ describe 'User reverts a merge request', :js do
click_button('Revert')
end
- expect(page).to have_content('The merge request has been successfully reverted. You can now submit a merge request to get this change into the original branch.')
+ expect(page).to have_content(_('The merge request has been successfully reverted. You can now submit a merge request to get this change into the original branch.'))
end
it 'cannot revert a merge requests for an archived project' do
diff --git a/spec/features/merge_request/user_sees_merge_button_depending_on_unresolved_discussions_spec.rb b/spec/features/merge_request/user_sees_merge_button_depending_on_unresolved_discussions_spec.rb
index f6b771facf8..24de4517528 100644
--- a/spec/features/merge_request/user_sees_merge_button_depending_on_unresolved_discussions_spec.rb
+++ b/spec/features/merge_request/user_sees_merge_button_depending_on_unresolved_discussions_spec.rb
@@ -19,7 +19,7 @@ describe 'Merge request > User sees merge button depending on unresolved discuss
context 'with unresolved discussions' do
it 'does not allow to merge' do
expect(page).not_to have_button 'Merge'
- expect(page).to have_content('There are unresolved discussions.')
+ expect(page).to have_content(_('There are unresolved discussions.'))
end
end
diff --git a/spec/features/merge_request/user_sees_merge_widget_spec.rb b/spec/features/merge_request/user_sees_merge_widget_spec.rb
index afb978d7c45..4729b7a3b8e 100644
--- a/spec/features/merge_request/user_sees_merge_widget_spec.rb
+++ b/spec/features/merge_request/user_sees_merge_widget_spec.rb
@@ -180,7 +180,7 @@ describe 'Merge request > User sees merge widget', :js do
# Wait for the `ci_status` and `merge_check` requests
wait_for_requests
- expect(page).to have_text("Could not retrieve the pipeline status. For troubleshooting steps, read the documentation.")
+ expect(page).to have_text(_("Could not retrieve the pipeline status. For troubleshooting steps, read the documentation."))
end
end
diff --git a/spec/features/merge_request/user_sees_mr_with_deleted_source_branch_spec.rb b/spec/features/merge_request/user_sees_mr_with_deleted_source_branch_spec.rb
index fd4175d5227..313d0bfbf86 100644
--- a/spec/features/merge_request/user_sees_mr_with_deleted_source_branch_spec.rb
+++ b/spec/features/merge_request/user_sees_mr_with_deleted_source_branch_spec.rb
@@ -15,7 +15,7 @@ describe 'Merge request > User sees MR with deleted source branch', :js do
end
it 'shows a message about missing source branch' do
- expect(page).to have_content('Source branch does not exist.')
+ expect(page).to have_content(_('Source branch does not exist.'))
end
it 'still contains Discussion, Commits and Changes tabs' do
@@ -29,6 +29,6 @@ describe 'Merge request > User sees MR with deleted source branch', :js do
wait_for_requests
expect(page).to have_selector('.diffs.tab-pane .file-holder')
- expect(page).to have_content('Source branch does not exist.')
+ expect(page).to have_content(_('Source branch does not exist.'))
end
end
diff --git a/spec/features/merge_request/user_sees_pipelines_spec.rb b/spec/features/merge_request/user_sees_pipelines_spec.rb
index 8faddee4daa..a450f658c57 100644
--- a/spec/features/merge_request/user_sees_pipelines_spec.rb
+++ b/spec/features/merge_request/user_sees_pipelines_spec.rb
@@ -41,7 +41,7 @@ describe 'Merge request > User sees pipelines', :js do
visit project_merge_request_path(project, merge_request)
wait_for_requests
- expect(page.find('.ci-widget')).to have_text("Could not retrieve the pipeline status. For troubleshooting steps, read the documentation.")
+ expect(page.find('.ci-widget')).to have_text(_("Could not retrieve the pipeline status. For troubleshooting steps, read the documentation."))
end
end
diff --git a/spec/features/merge_request/user_uses_quick_actions_spec.rb b/spec/features/merge_request/user_uses_quick_actions_spec.rb
index b81478a481f..3289ade4ea1 100644
--- a/spec/features/merge_request/user_uses_quick_actions_spec.rb
+++ b/spec/features/merge_request/user_uses_quick_actions_spec.rb
@@ -106,7 +106,7 @@ describe 'Merge request > User uses quick actions', :js do
it 'does not merge the MR' do
add_note("/merge")
- expect(page).not_to have_content 'Your commands have been executed!'
+ expect(page).not_to have_content _('Your commands have been executed!')
expect(merge_request.reload).not_to be_merged
end
@@ -122,7 +122,7 @@ describe 'Merge request > User uses quick actions', :js do
it 'does not merge the MR' do
add_note("/merge")
- expect(page).not_to have_content 'Your commands have been executed!'
+ expect(page).not_to have_content _('Your commands have been executed!')
expect(merge_request.reload).not_to be_merged
end
diff --git a/spec/features/merge_request/user_views_open_merge_request_spec.rb b/spec/features/merge_request/user_views_open_merge_request_spec.rb
index 71022c6bb08..0176469b101 100644
--- a/spec/features/merge_request/user_views_open_merge_request_spec.rb
+++ b/spec/features/merge_request/user_views_open_merge_request_spec.rb
@@ -43,7 +43,7 @@ describe 'User views an open merge request' do
page.within('.gfm-form') do
click_button('Preview')
- expect(find('.js-md-preview')).to have_content('Nothing to preview.')
+ expect(find('.js-md-preview')).to have_content(_('Nothing to preview.'))
end
end
diff --git a/spec/features/milestone_spec.rb b/spec/features/milestone_spec.rb
index a0673b12738..c5144669a14 100644
--- a/spec/features/milestone_spec.rb
+++ b/spec/features/milestone_spec.rb
@@ -23,7 +23,7 @@ describe 'Milestone' do
find('input[name="commit"]').click
- expect(find('.alert-success')).to have_content('Assign some issues to this milestone.')
+ expect(find('.alert-success')).to have_content(_('Assign some issues to this milestone.'))
expect(page).to have_content('Nov 16, 2016–Dec 16, 2016')
end
end
@@ -35,7 +35,7 @@ describe 'Milestone' do
create(:issue, title: "Bugfix1", project: project, milestone: milestone, state: "closed")
visit project_milestone_path(project, milestone)
- expect(find('.alert-success')).to have_content('All issues for this milestone are closed. You may close this milestone now.')
+ expect(find('.alert-success')).to have_content(_('All issues for this milestone are closed. You may close this milestone now.'))
end
end
diff --git a/spec/features/password_reset_spec.rb b/spec/features/password_reset_spec.rb
index dcc63dff9f5..c9e2e871a95 100644
--- a/spec/features/password_reset_spec.rb
+++ b/spec/features/password_reset_spec.rb
@@ -54,7 +54,7 @@ describe 'Password reset' do
def forgot_password(user)
visit root_path
- click_on 'Forgot your password?'
+ click_on _('Forgot your password?')
fill_in 'Email', with: user.email
click_button 'Reset password'
user.reload
diff --git a/spec/features/profiles/active_sessions_spec.rb b/spec/features/profiles/active_sessions_spec.rb
index d3050760c06..a971c58ab2d 100644
--- a/spec/features/profiles/active_sessions_spec.rb
+++ b/spec/features/profiles/active_sessions_spec.rb
@@ -83,7 +83,7 @@ describe 'Profile > Active Sessions', :clean_gitlab_redis_shared_state do
using_session :session2 do
visit profile_active_sessions_path
- expect(page).to have_content('You need to sign in or sign up before continuing.')
+ expect(page).to have_content(_('You need to sign in or sign up before continuing.'))
end
end
end
diff --git a/spec/features/profiles/chat_names_spec.rb b/spec/features/profiles/chat_names_spec.rb
index c72069f6262..c5aeb0f29b6 100644
--- a/spec/features/profiles/chat_names_spec.rb
+++ b/spec/features/profiles/chat_names_spec.rb
@@ -71,7 +71,7 @@ describe 'Profile > Chat' do
it 'removes chat account' do
click_link 'Remove'
- expect(page).to have_content("You don't have any active chat names.")
+ expect(page).to have_content(_("You don't have any active chat names."))
end
end
end
diff --git a/spec/features/profiles/oauth_applications_spec.rb b/spec/features/profiles/oauth_applications_spec.rb
index 7d204f89fba..7f59f2e8714 100644
--- a/spec/features/profiles/oauth_applications_spec.rb
+++ b/spec/features/profiles/oauth_applications_spec.rb
@@ -39,7 +39,7 @@ describe 'Profile > Applications' do
accept_confirm { click_button 'Revoke' }
end
- expect(page).to have_content('The application was revoked access.')
+ expect(page).to have_content(_('The application was revoked access.'))
expect(page).to have_content('Your applications (0)')
expect(page).to have_content('Authorized applications (0)')
end
diff --git a/spec/features/profiles/personal_access_tokens_spec.rb b/spec/features/profiles/personal_access_tokens_spec.rb
index dee213a11d4..0ded974f353 100644
--- a/spec/features/profiles/personal_access_tokens_spec.rb
+++ b/spec/features/profiles/personal_access_tokens_spec.rb
@@ -84,7 +84,7 @@ describe 'Profile > Personal Access Tokens', :js do
accept_confirm { click_on "Revoke" }
expect(page).to have_selector(".settings-message")
- expect(no_personal_access_tokens_message).to have_text("This user has no active Personal Access Tokens.")
+ expect(no_personal_access_tokens_message).to have_text(_("This user has no active Personal Access Tokens."))
end
it "removes expired tokens from 'active' section" do
@@ -92,7 +92,7 @@ describe 'Profile > Personal Access Tokens', :js do
visit profile_personal_access_tokens_path
expect(page).to have_selector(".settings-message")
- expect(no_personal_access_tokens_message).to have_text("This user has no active Personal Access Tokens.")
+ expect(no_personal_access_tokens_message).to have_text(_("This user has no active Personal Access Tokens."))
end
context "when revocation fails" do
diff --git a/spec/features/profiles/user_visits_profile_preferences_page_spec.rb b/spec/features/profiles/user_visits_profile_preferences_page_spec.rb
index 90d6841af0e..32fecf24c07 100644
--- a/spec/features/profiles/user_visits_profile_preferences_page_spec.rb
+++ b/spec/features/profiles/user_visits_profile_preferences_page_spec.rb
@@ -62,7 +62,7 @@ describe 'User visits the profile preferences page' do
def expect_preferences_saved_message
page.within('.flash-container') do
- expect(page).to have_content('Preferences saved.')
+ expect(page).to have_content(_('Preferences saved.'))
end
end
end
diff --git a/spec/features/projects/artifacts/file_spec.rb b/spec/features/projects/artifacts/file_spec.rb
index 993d0040434..8970116eea7 100644
--- a/spec/features/projects/artifacts/file_spec.rb
+++ b/spec/features/projects/artifacts/file_spec.rb
@@ -23,7 +23,7 @@ describe 'Artifact file', :js do
it 'displays an error' do
aggregate_failures do
# shows an error message
- expect(page).to have_content('The source could not be displayed because it is stored as a job artifact. You can download it instead.')
+ expect(page).to have_content(_('The source could not be displayed because it is stored as a job artifact. You can download it instead.'))
# does not show a viewer switcher
expect(page).not_to have_selector('.js-blob-viewer-switcher')
diff --git a/spec/features/projects/blobs/blob_show_spec.rb b/spec/features/projects/blobs/blob_show_spec.rb
index e2f9e7e9cc5..dd68d01e88b 100644
--- a/spec/features/projects/blobs/blob_show_spec.rb
+++ b/spec/features/projects/blobs/blob_show_spec.rb
@@ -220,7 +220,7 @@ describe 'File blob', :js do
expect(page).to have_selector('.blob-viewer[data-type="rich"]')
# shows an error message
- expect(page).to have_content('The rendered file could not be displayed because it is stored in LFS. You can download it instead.')
+ expect(page).to have_content(_('The rendered file could not be displayed because it is stored in LFS. You can download it instead.'))
# shows a viewer switcher
expect(page).to have_selector('.js-blob-viewer-switcher')
@@ -247,7 +247,7 @@ describe 'File blob', :js do
expect(page).to have_selector('.blob-viewer[data-type="rich"]', visible: false)
# shows an error message
- expect(page).to have_content('The source could not be displayed because it is stored in LFS. You can download it instead.')
+ expect(page).to have_content(_('The source could not be displayed because it is stored in LFS. You can download it instead.'))
# does not show a copy button
expect(page).not_to have_selector('.js-copy-blob-source-btn')
@@ -482,7 +482,7 @@ describe 'File blob', :js do
it 'displays an auxiliary viewer' do
aggregate_failures do
# shows that configuration is valid
- expect(page).to have_content('This GitLab CI configuration is valid.')
+ expect(page).to have_content(_('This GitLab CI configuration is valid.'))
# shows a learn more link
expect(page).to have_link('Learn more')
@@ -514,7 +514,7 @@ describe 'File blob', :js do
it 'displays an auxiliary viewer' do
aggregate_failures do
# shows that map is valid
- expect(page).to have_content('This Route Map is valid.')
+ expect(page).to have_content(_('This Route Map is valid.'))
# shows a learn more link
expect(page).to have_link('Learn more')
@@ -530,7 +530,7 @@ describe 'File blob', :js do
it 'displays an auxiliary viewer' do
aggregate_failures do
# shows license
- expect(page).to have_content('This project is licensed under the MIT License.')
+ expect(page).to have_content(_('This project is licensed under the MIT License.'))
# shows a learn more link
expect(page).to have_link('Learn more', href: 'http://choosealicense.com/licenses/mit/')
@@ -563,7 +563,7 @@ describe 'File blob', :js do
it 'displays an auxiliary viewer' do
aggregate_failures do
# shows names of dependency manager and package
- expect(page).to have_content('This project manages its dependencies using RubyGems and defines a gem named activerecord.')
+ expect(page).to have_content(_('This project manages its dependencies using RubyGems and defines a gem named activerecord.'))
# shows a link to the gem
expect(page).to have_link('activerecord', href: 'https://rubygems.org/gems/activerecord')
diff --git a/spec/features/projects/clusters/applications_spec.rb b/spec/features/projects/clusters/applications_spec.rb
index fab9e035d53..5b14457318b 100644
--- a/spec/features/projects/clusters/applications_spec.rb
+++ b/spec/features/projects/clusters/applications_spec.rb
@@ -189,7 +189,7 @@ describe 'Clusters Applications', :js do
retries = 0
while Clusters::Cluster.last.application_helm.nil?
- raise "Timed out waiting for helm application to be created in DB" if (retries += 1) > 3
+ raise _("Timed out waiting for helm application to be created in DB") if (retries += 1) > 3
sleep(1)
end
diff --git a/spec/features/projects/clusters/gcp_spec.rb b/spec/features/projects/clusters/gcp_spec.rb
index 9322e29d744..3343ed319b8 100644
--- a/spec/features/projects/clusters/gcp_spec.rb
+++ b/spec/features/projects/clusters/gcp_spec.rb
@@ -63,7 +63,7 @@ describe 'Gcp Cluster', :js do
it 'user sees a cluster details page and creation status' do
subject
- expect(page).to have_content('Kubernetes cluster is being created on Google Kubernetes Engine...')
+ expect(page).to have_content(_('Kubernetes cluster is being created on Google Kubernetes Engine...'))
Clusters::Cluster.last.provider.make_created!
@@ -73,11 +73,11 @@ describe 'Gcp Cluster', :js do
it 'user sees a error if something wrong during creation' do
subject
- expect(page).to have_content('Kubernetes cluster is being created on Google Kubernetes Engine...')
+ expect(page).to have_content(_('Kubernetes cluster is being created on Google Kubernetes Engine...'))
- Clusters::Cluster.last.provider.make_errored!('Something wrong!')
+ Clusters::Cluster.last.provider.make_errored!(_('Something wrong!'))
- expect(page).to have_content('Something wrong!')
+ expect(page).to have_content(_('Something wrong!'))
end
it 'user sees RBAC is enabled by default' do
@@ -116,7 +116,7 @@ describe 'Gcp Cluster', :js do
end
it 'user sees the successful message' do
- expect(page).to have_content('Kubernetes cluster was successfully updated.')
+ expect(page).to have_content(_('Kubernetes cluster was successfully updated.'))
end
end
@@ -128,7 +128,7 @@ describe 'Gcp Cluster', :js do
end
it 'user sees the successful message' do
- expect(page).to have_content('Kubernetes cluster was successfully updated.')
+ expect(page).to have_content(_('Kubernetes cluster was successfully updated.'))
expect(cluster.reload.platform_kubernetes.namespace).to eq('my-namespace')
end
end
@@ -141,7 +141,7 @@ describe 'Gcp Cluster', :js do
end
it 'user sees creation form with the successful message' do
- expect(page).to have_content('Kubernetes cluster integration was successfully removed.')
+ expect(page).to have_content(_('Kubernetes cluster integration was successfully removed.'))
expect(page).to have_link('Add Kubernetes cluster')
end
end
diff --git a/spec/features/projects/clusters/user_spec.rb b/spec/features/projects/clusters/user_spec.rb
index 1f2f7592d8b..a57b99ea23a 100644
--- a/spec/features/projects/clusters/user_spec.rb
+++ b/spec/features/projects/clusters/user_spec.rb
@@ -76,7 +76,7 @@ describe 'User Cluster', :js do
end
it 'user sees the successful message' do
- expect(page).to have_content('Kubernetes cluster was successfully updated.')
+ expect(page).to have_content(_('Kubernetes cluster was successfully updated.'))
end
end
@@ -88,7 +88,7 @@ describe 'User Cluster', :js do
end
it 'user sees the successful message' do
- expect(page).to have_content('Kubernetes cluster was successfully updated.')
+ expect(page).to have_content(_('Kubernetes cluster was successfully updated.'))
expect(cluster.reload.name).to eq('my-dev-cluster')
expect(cluster.reload.platform_kubernetes.namespace).to eq('my-namespace')
end
@@ -102,7 +102,7 @@ describe 'User Cluster', :js do
end
it 'user sees creation form with the successful message' do
- expect(page).to have_content('Kubernetes cluster integration was successfully removed.')
+ expect(page).to have_content(_('Kubernetes cluster integration was successfully removed.'))
expect(page).to have_link('Add Kubernetes cluster')
end
end
diff --git a/spec/features/projects/commit/cherry_pick_spec.rb b/spec/features/projects/commit/cherry_pick_spec.rb
index a61b614dbc8..5790c3c30f0 100644
--- a/spec/features/projects/commit/cherry_pick_spec.rb
+++ b/spec/features/projects/commit/cherry_pick_spec.rb
@@ -21,7 +21,7 @@ describe 'Cherry-pick Commits' do
uncheck 'create_merge_request'
click_button 'Cherry-pick'
end
- expect(page).to have_content('The commit has been successfully cherry-picked into master.')
+ expect(page).to have_content(_('The commit has been successfully cherry-picked into master.'))
end
end
@@ -32,7 +32,7 @@ describe 'Cherry-pick Commits' do
uncheck 'create_merge_request'
click_button 'Cherry-pick'
end
- expect(page).to have_content('The commit has been successfully cherry-picked into master.')
+ expect(page).to have_content(_('The commit has been successfully cherry-picked into master.'))
end
end
@@ -86,7 +86,7 @@ describe 'Cherry-pick Commits' do
click_button 'Cherry-pick'
end
- expect(page).to have_content('The commit has been successfully cherry-picked into feature.')
+ expect(page).to have_content(_('The commit has been successfully cherry-picked into feature.'))
end
end
diff --git a/spec/features/projects/commit/user_reverts_commit_spec.rb b/spec/features/projects/commit/user_reverts_commit_spec.rb
index 42844a03ea6..0a99de1990b 100644
--- a/spec/features/projects/commit/user_reverts_commit_spec.rb
+++ b/spec/features/projects/commit/user_reverts_commit_spec.rb
@@ -27,7 +27,7 @@ describe 'User reverts a commit', :js do
end
it 'reverts a commit' do
- expect(page).to have_content('The commit has been successfully reverted.')
+ expect(page).to have_content(_('The commit has been successfully reverted.'))
end
it 'does not revert a previously reverted commit' do
@@ -56,7 +56,7 @@ describe 'User reverts a commit', :js do
click_button('Revert')
end
- expect(page).to have_content('The commit has been successfully reverted. You can now submit a merge request to get this change into the original branch.')
+ expect(page).to have_content(_('The commit has been successfully reverted. You can now submit a merge request to get this change into the original branch.'))
expect(page).to have_content("From revert-#{Commit.truncate_sha(sample_commit.id)} into master")
end
end
diff --git a/spec/features/projects/commits/user_browses_commits_spec.rb b/spec/features/projects/commits/user_browses_commits_spec.rb
index 574a8aefd63..d8f70bb5cf7 100644
--- a/spec/features/projects/commits/user_browses_commits_spec.rb
+++ b/spec/features/projects/commits/user_browses_commits_spec.rb
@@ -127,7 +127,7 @@ describe 'User browses commits' do
end
context 'when a commit links to a confidential issue' do
- let(:confidential_issue) { create(:issue, confidential: true, title: 'Secret issue!', project: project) }
+ let(:confidential_issue) { create(:issue, confidential: true, title: _('Secret issue!'), project: project) }
before do
project.repository.create_file(user, 'dummy-file', 'dummy content',
diff --git a/spec/features/projects/compare_spec.rb b/spec/features/projects/compare_spec.rb
index 5f7cf68987e..51f3d5265d6 100644
--- a/spec/features/projects/compare_spec.rb
+++ b/spec/features/projects/compare_spec.rb
@@ -98,7 +98,7 @@ describe "Compare", :js do
click_button('Compare')
page.within('.alert') do
- expect(page).to have_text("Too many changes to show. To preserve performance only 3 of 3+ files are displayed.")
+ expect(page).to have_text(_("Too many changes to show. To preserve performance only 3 of 3+ files are displayed."))
end
end
end
diff --git a/spec/features/projects/diffs/diff_show_spec.rb b/spec/features/projects/diffs/diff_show_spec.rb
index df05625d105..99b35945741 100644
--- a/spec/features/projects/diffs/diff_show_spec.rb
+++ b/spec/features/projects/diffs/diff_show_spec.rb
@@ -46,7 +46,7 @@ describe 'Diff file viewer', :js do
end
it 'shows an error message' do
- expect(page).to have_content('This source diff could not be displayed because it is stored in LFS. You can view the blob instead.')
+ expect(page).to have_content(_('This source diff could not be displayed because it is stored in LFS. You can view the blob instead.'))
end
end
@@ -161,12 +161,12 @@ describe 'Diff file viewer', :js do
end
it 'shows the diff is collapsed' do
- expect(page).to have_content('This diff is collapsed. Click to expand it.')
+ expect(page).to have_content(_('This diff is collapsed. Click to expand it.'))
end
context 'expanding the diff' do
before do
- click_button 'Click to expand it.'
+ click_button _('Click to expand it.')
wait_for_requests
end
diff --git a/spec/features/projects/environments/environment_spec.rb b/spec/features/projects/environments/environment_spec.rb
index a8a3b6910fb..3e057cf307f 100644
--- a/spec/features/projects/environments/environment_spec.rb
+++ b/spec/features/projects/environments/environment_spec.rb
@@ -26,7 +26,7 @@ describe 'Environment' do
context 'without deployments' do
it 'does not show deployments' do
- expect(page).to have_content('You don\'t have any deployments right now.')
+ expect(page).to have_content(_('You don\'t have any deployments right now.'))
end
end
@@ -65,7 +65,7 @@ describe 'Environment' do
end
it 'does not show deployments' do
- expect(page).to have_content('You don\'t have any deployments right now.')
+ expect(page).to have_content(_('You don\'t have any deployments right now.'))
end
end
@@ -78,7 +78,7 @@ describe 'Environment' do
end
it 'does not show deployments' do
- expect(page).to have_content('You don\'t have any deployments right now.')
+ expect(page).to have_content(_('You don\'t have any deployments right now.'))
end
end
diff --git a/spec/features/projects/features_visibility_spec.rb b/spec/features/projects/features_visibility_spec.rb
index ab16fdee883..a9f612cbd7c 100644
--- a/spec/features/projects/features_visibility_spec.rb
+++ b/spec/features/projects/features_visibility_spec.rb
@@ -192,7 +192,7 @@ describe 'Edit Project Settings' do
visit project_path(project)
- expect(page).to have_content "Customize your workflow!"
+ expect(page).to have_content _("Customize your workflow!")
end
it "hides project activity tabs" do
diff --git a/spec/features/projects/files/editing_a_file_spec.rb b/spec/features/projects/files/editing_a_file_spec.rb
index 4074e67e2d2..3285111b46d 100644
--- a/spec/features/projects/files/editing_a_file_spec.rb
+++ b/spec/features/projects/files/editing_a_file_spec.rb
@@ -26,6 +26,6 @@ describe 'Projects > Files > User wants to edit a file' do
click_button 'Commit changes'
- expect(page).to have_content 'Someone edited the file the same time you did.'
+ expect(page).to have_content _('Someone edited the file the same time you did.')
end
end
diff --git a/spec/features/projects/files/user_browses_files_spec.rb b/spec/features/projects/files/user_browses_files_spec.rb
index 66268355345..c12f835c567 100644
--- a/spec/features/projects/files/user_browses_files_spec.rb
+++ b/spec/features/projects/files/user_browses_files_spec.rb
@@ -113,7 +113,7 @@ describe "User browses files" do
click_link("Users")
expect(current_path).to eq(project_blob_path(project, "markdown/doc/api/users.md"))
- expect(page).to have_content("Get a list of users.")
+ expect(page).to have_content(_("Get a list of users."))
page.go_back
@@ -161,7 +161,7 @@ describe "User browses files" do
click_link("Users")
expect(current_path).to eq(project_blob_path(project, "markdown/doc/api/users.md"))
- expect(page).to have_content("List users").and have_content("Get a list of users.")
+ expect(page).to have_content("List users").and have_content(_("Get a list of users."))
end
end
end
@@ -189,7 +189,7 @@ describe "User browses files" do
visit(project_tree_path(project, "'test'"))
- expect(page).to have_css(".tree-commit-link").and have_no_content("Loading commit data...")
+ expect(page).to have_css(".tree-commit-link").and have_no_content(_("Loading commit data..."))
end
it "shows the code with a leading dot in the directory", :js do
@@ -201,7 +201,7 @@ describe "User browses files" do
visit(project_tree_path(project, "fix/.testdir"))
- expect(page).to have_css(".tree-commit-link").and have_no_content("Loading commit data...")
+ expect(page).to have_css(".tree-commit-link").and have_no_content(_("Loading commit data..."))
end
it "does not show the permalink link" do
diff --git a/spec/features/projects/files/user_creates_files_spec.rb b/spec/features/projects/files/user_creates_files_spec.rb
index a4f94b7a76d..2dd3593b520 100644
--- a/spec/features/projects/files/user_creates_files_spec.rb
+++ b/spec/features/projects/files/user_creates_files_spec.rb
@@ -71,7 +71,7 @@ describe 'Projects > Files > User creates files' do
it 'allows Chinese characters in file name' do
submit_new_file(file_name: '测试.md')
- expect(page).to have_content 'The file has been successfully created.'
+ expect(page).to have_content _('The file has been successfully created.')
end
it 'allows Chinese characters in directory name' do
@@ -164,7 +164,7 @@ describe 'Projects > Files > User creates files' do
end
it 'shows a message saying the file will be committed in a fork' do
- message = "A new branch will be created in your fork and a new merge request will be started."
+ message = _("A new branch will be created in your fork and a new merge request will be started.")
expect(page).to have_content(message)
end
diff --git a/spec/features/projects/jobs_spec.rb b/spec/features/projects/jobs_spec.rb
index 8230396a4cc..18d788643ab 100644
--- a/spec/features/projects/jobs_spec.rb
+++ b/spec/features/projects/jobs_spec.rb
@@ -507,7 +507,7 @@ describe 'Jobs', :clean_gitlab_redis_shared_state do
let!(:environment) { create(:environment, name: 'staging', project: project) }
it 'shows deployment message' do
- expected_text = 'The deployment of this job to staging did not succeed.'
+ expected_text = _('The deployment of this job to staging did not succeed.')
expect(page).to have_css('.environment-information', text: expected_text)
end
@@ -616,7 +616,7 @@ describe 'Jobs', :clean_gitlab_redis_shared_state do
it 'shows delayed job', :js do
expect(page).to have_content('This is a delayed job to run in')
- expect(page).to have_content("This job will automatically run after its timer finishes.")
+ expect(page).to have_content(_("This job will automatically run after its timer finishes."))
expect(page).to have_link('Unschedule job')
end
@@ -708,7 +708,7 @@ describe 'Jobs', :clean_gitlab_redis_shared_state do
visit project_job_path(project, job)
expect(job).not_to have_trace
- expect(page).to have_content('This job does not have a trace.')
+ expect(page).to have_content(_('This job does not have a trace.'))
end
end
@@ -774,7 +774,7 @@ describe 'Jobs', :clean_gitlab_redis_shared_state do
it 'renders message about job being stuck because no runners are active' do
expect(page).to have_css('.js-stuck-no-active-runner')
- expect(page).to have_content("This job is stuck because you don't have any active runners that can run this job.")
+ expect(page).to have_content(_("This job is stuck because you don't have any active runners that can run this job."))
end
end
@@ -803,7 +803,7 @@ describe 'Jobs', :clean_gitlab_redis_shared_state do
it 'renders message about job being stuck because not runners are available' do
expect(page).to have_css('.js-stuck-no-active-runner')
- expect(page).to have_content("This job is stuck because you don't have any active runners that can run this job.")
+ expect(page).to have_content(_("This job is stuck because you don't have any active runners that can run this job."))
end
end
@@ -813,7 +813,7 @@ describe 'Jobs', :clean_gitlab_redis_shared_state do
it 'renders message about job being stuck because runners are offline' do
expect(page).to have_css('.js-stuck-no-runners')
- expect(page).to have_content("This job is stuck because the project doesn't have any runners online assigned to it.")
+ expect(page).to have_content(_("This job is stuck because the project doesn't have any runners online assigned to it."))
end
end
end
diff --git a/spec/features/projects/members/user_requests_access_spec.rb b/spec/features/projects/members/user_requests_access_spec.rb
index 50ba67f0ffc..27b3e102cca 100644
--- a/spec/features/projects/members/user_requests_access_spec.rb
+++ b/spec/features/projects/members/user_requests_access_spec.rb
@@ -24,7 +24,7 @@ describe 'Projects > Members > User requests access', :js do
expect(ActionMailer::Base.deliveries.last.subject).to eq "Request to join the #{project.full_name} project"
expect(project.requesters.exists?(user_id: user)).to be_truthy
- expect(page).to have_content 'Your request for access has been queued for review.'
+ expect(page).to have_content _('Your request for access has been queued for review.')
expect(page).to have_content 'Withdraw Access Request'
expect(page).not_to have_content 'Leave Project'
@@ -63,7 +63,7 @@ describe 'Projects > Members > User requests access', :js do
accept_confirm { click_link 'Withdraw Access Request' }
expect(project.requesters.exists?(user_id: user)).to be_falsey
- expect(page).to have_content 'Your access request to the project has been withdrawn.'
+ expect(page).to have_content _('Your access request to the project has been withdrawn.')
end
def open_project_settings_menu
diff --git a/spec/features/projects/milestones/milestone_spec.rb b/spec/features/projects/milestones/milestone_spec.rb
index ff31092b910..67920bf2c26 100644
--- a/spec/features/projects/milestones/milestone_spec.rb
+++ b/spec/features/projects/milestones/milestone_spec.rb
@@ -60,7 +60,7 @@ describe 'Project milestone' do
end
it 'does not show an informative message' do
- expect(page).not_to have_content('Assign some issues to this milestone.')
+ expect(page).not_to have_content(_('Assign some issues to this milestone.'))
end
end
diff --git a/spec/features/projects/network_graph_spec.rb b/spec/features/projects/network_graph_spec.rb
index 9f9a7787093..3e6166aa528 100644
--- a/spec/features/projects/network_graph_spec.rb
+++ b/spec/features/projects/network_graph_spec.rb
@@ -94,7 +94,7 @@ describe 'Project Network Graph', :js do
find('button').click
end
- expect(page).to have_selector '.flash-alert', text: "Git revision ';' does not exist."
+ expect(page).to have_selector '.flash-alert', text: _("Git revision ';' does not exist.")
end
end
diff --git a/spec/features/projects/pipelines/pipelines_spec.rb b/spec/features/projects/pipelines/pipelines_spec.rb
index b75dee66592..574aaea1418 100644
--- a/spec/features/projects/pipelines/pipelines_spec.rb
+++ b/spec/features/projects/pipelines/pipelines_spec.rb
@@ -87,7 +87,7 @@ describe 'Pipelines', :js do
it 'updates content when tab is clicked' do
page.find('.js-pipelines-tab-pending').click
wait_for_requests
- expect(page).to have_content('There are currently no pending pipelines.')
+ expect(page).to have_content(_('There are currently no pending pipelines.'))
end
end
@@ -662,7 +662,7 @@ describe 'Pipelines', :js do
it 'increments jobs_cache_index' do
click_button 'Clear Runner Caches'
wait_for_requests
- expect(page.find('.flash-notice')).to have_content 'Project cache successfully reset.'
+ expect(page.find('.flash-notice')).to have_content _('Project cache successfully reset.')
end
end
@@ -670,7 +670,7 @@ describe 'Pipelines', :js do
it 'sets jobs_cache_index to 1' do
click_button 'Clear Runner Caches'
wait_for_requests
- expect(page.find('.flash-notice')).to have_content 'Project cache successfully reset.'
+ expect(page.find('.flash-notice')).to have_content _('Project cache successfully reset.')
end
end
end
@@ -699,7 +699,7 @@ describe 'Pipelines', :js do
let(:project) { create(:project, :public, :repository) }
context 'without pipelines' do
- it { expect(page).to have_content 'This project is not currently set up to run pipelines.' }
+ it { expect(page).to have_content _('This project is not currently set up to run pipelines.') }
end
end
diff --git a/spec/features/projects/services/user_activates_asana_spec.rb b/spec/features/projects/services/user_activates_asana_spec.rb
index c44e07dd3b4..948c930707c 100644
--- a/spec/features/projects/services/user_activates_asana_spec.rb
+++ b/spec/features/projects/services/user_activates_asana_spec.rb
@@ -19,6 +19,6 @@ describe 'User activates Asana' do
fill_in('Restrict to branch', with: 'verySecret')
click_button('Save')
- expect(page).to have_content('Asana activated.')
+ expect(page).to have_content(_('Asana activated.'))
end
end
diff --git a/spec/features/projects/services/user_activates_assembla_spec.rb b/spec/features/projects/services/user_activates_assembla_spec.rb
index 9c3884a7c74..23032e0de6d 100644
--- a/spec/features/projects/services/user_activates_assembla_spec.rb
+++ b/spec/features/projects/services/user_activates_assembla_spec.rb
@@ -18,6 +18,6 @@ describe 'User activates Assembla' do
fill_in('Token', with: 'verySecret')
click_button('Save')
- expect(page).to have_content('Assembla activated.')
+ expect(page).to have_content(_('Assembla activated.'))
end
end
diff --git a/spec/features/projects/services/user_activates_atlassian_bamboo_ci_spec.rb b/spec/features/projects/services/user_activates_atlassian_bamboo_ci_spec.rb
index 19573565265..d7b932597ab 100644
--- a/spec/features/projects/services/user_activates_atlassian_bamboo_ci_spec.rb
+++ b/spec/features/projects/services/user_activates_atlassian_bamboo_ci_spec.rb
@@ -21,7 +21,7 @@ describe 'User activates Atlassian Bamboo CI' do
fill_in('Password', with: 'verySecret')
click_button('Save')
- expect(page).to have_content('Atlassian Bamboo CI activated.')
+ expect(page).to have_content(_('Atlassian Bamboo CI activated.'))
# Password field should not be filled in.
click_link('Atlassian Bamboo CI')
diff --git a/spec/features/projects/services/user_activates_emails_on_push_spec.rb b/spec/features/projects/services/user_activates_emails_on_push_spec.rb
index cc55f7b2060..de4cb99bc52 100644
--- a/spec/features/projects/services/user_activates_emails_on_push_spec.rb
+++ b/spec/features/projects/services/user_activates_emails_on_push_spec.rb
@@ -18,6 +18,6 @@ describe 'User activates Emails on push' do
fill_in('Recipients', with: 'qa@company.name')
click_button('Save')
- expect(page).to have_content('Emails on push activated.')
+ expect(page).to have_content(_('Emails on push activated.'))
end
end
diff --git a/spec/features/projects/services/user_activates_flowdock_spec.rb b/spec/features/projects/services/user_activates_flowdock_spec.rb
index f981b7e9da9..9ad4dbfb4f3 100644
--- a/spec/features/projects/services/user_activates_flowdock_spec.rb
+++ b/spec/features/projects/services/user_activates_flowdock_spec.rb
@@ -18,6 +18,6 @@ describe 'User activates Flowdock' do
fill_in('Token', with: 'verySecret')
click_button('Save')
- expect(page).to have_content('Flowdock activated.')
+ expect(page).to have_content(_('Flowdock activated.'))
end
end
diff --git a/spec/features/projects/services/user_activates_hipchat_spec.rb b/spec/features/projects/services/user_activates_hipchat_spec.rb
index 2f5313c91f9..c9481316940 100644
--- a/spec/features/projects/services/user_activates_hipchat_spec.rb
+++ b/spec/features/projects/services/user_activates_hipchat_spec.rb
@@ -20,7 +20,7 @@ describe 'User activates HipChat' do
fill_in('Token', with: 'verySecret')
click_button('Save')
- expect(page).to have_content('HipChat activated.')
+ expect(page).to have_content(_('HipChat activated.'))
end
end
@@ -32,7 +32,7 @@ describe 'User activates HipChat' do
fill_in('Server', with: 'https://chat.example.com')
click_button('Save')
- expect(page).to have_content('HipChat activated.')
+ expect(page).to have_content(_('HipChat activated.'))
end
end
end
diff --git a/spec/features/projects/services/user_activates_irker_spec.rb b/spec/features/projects/services/user_activates_irker_spec.rb
index 4c8e321b411..0dd75deed0c 100644
--- a/spec/features/projects/services/user_activates_irker_spec.rb
+++ b/spec/features/projects/services/user_activates_irker_spec.rb
@@ -19,6 +19,6 @@ describe 'User activates Irker (IRC gateway)' do
fill_in('Recipients', with: 'irc://chat.freenode.net/#commits')
click_button('Save')
- expect(page).to have_content('Irker (IRC gateway) activated.')
+ expect(page).to have_content(_('Irker (IRC gateway) activated.'))
end
end
diff --git a/spec/features/projects/services/user_activates_issue_tracker_spec.rb b/spec/features/projects/services/user_activates_issue_tracker_spec.rb
index 7cd5b12802b..6fe1c640e58 100644
--- a/spec/features/projects/services/user_activates_issue_tracker_spec.rb
+++ b/spec/features/projects/services/user_activates_issue_tracker_spec.rb
@@ -54,7 +54,7 @@ describe 'User activates issue tracker', :js do
click_button('Test settings and save changes')
wait_for_requests
- expect(find('.flash-container-page')).to have_content 'Test failed.'
+ expect(find('.flash-container-page')).to have_content _('Test failed.')
expect(find('.flash-container-page')).to have_content 'Save anyway'
find('.flash-alert .flash-action').click
diff --git a/spec/features/projects/services/user_activates_jetbrains_teamcity_ci_spec.rb b/spec/features/projects/services/user_activates_jetbrains_teamcity_ci_spec.rb
index 28d83a8b961..1c40f6f7e0e 100644
--- a/spec/features/projects/services/user_activates_jetbrains_teamcity_ci_spec.rb
+++ b/spec/features/projects/services/user_activates_jetbrains_teamcity_ci_spec.rb
@@ -21,6 +21,6 @@ describe 'User activates JetBrains TeamCity CI' do
fill_in('Password', with: 'verySecret')
click_button('Save')
- expect(page).to have_content('JetBrains TeamCity CI activated.')
+ expect(page).to have_content(_('JetBrains TeamCity CI activated.'))
end
end
diff --git a/spec/features/projects/services/user_activates_jira_spec.rb b/spec/features/projects/services/user_activates_jira_spec.rb
index 08e1855d034..8b5a85ccf24 100644
--- a/spec/features/projects/services/user_activates_jira_spec.rb
+++ b/spec/features/projects/services/user_activates_jira_spec.rb
@@ -36,7 +36,7 @@ describe 'User activates Jira', :js do
end
it 'activates the JIRA service' do
- expect(page).to have_content('JIRA activated.')
+ expect(page).to have_content(_('JIRA activated.'))
expect(current_path).to eq(project_settings_integrations_path(project))
end
@@ -56,7 +56,7 @@ describe 'User activates Jira', :js do
click_button('Test settings and save changes')
page.within('.service-settings') do
- expect(page).to have_content('This field is required.')
+ expect(page).to have_content(_('This field is required.'))
end
end
@@ -75,7 +75,7 @@ describe 'User activates Jira', :js do
find('.flash-alert .flash-action').click
wait_for_requests
- expect(page).to have_content('JIRA activated.')
+ expect(page).to have_content(_('JIRA activated.'))
expect(current_path).to eq(project_settings_integrations_path(project))
end
end
@@ -89,7 +89,7 @@ describe 'User activates Jira', :js do
end
it 'saves but does not activate the JIRA service' do
- expect(page).to have_content('JIRA settings saved, but not activated.')
+ expect(page).to have_content(_('JIRA settings saved, but not activated.'))
expect(current_path).to eq(project_settings_integrations_path(project))
end
diff --git a/spec/features/projects/services/user_activates_mattermost_slash_command_spec.rb b/spec/features/projects/services/user_activates_mattermost_slash_command_spec.rb
index 70f3a812ee9..d1d450f2a22 100644
--- a/spec/features/projects/services/user_activates_mattermost_slash_command_spec.rb
+++ b/spec/features/projects/services/user_activates_mattermost_slash_command_spec.rb
@@ -31,7 +31,7 @@ describe 'Set up Mattermost slash commands', :js do
click_on 'Save changes'
expect(current_path).to eq(project_settings_integrations_path(project))
- expect(page).to have_content('Mattermost slash commands settings saved, but not activated.')
+ expect(page).to have_content(_('Mattermost slash commands settings saved, but not activated.'))
end
it 'redirects to the integrations page after activating' do
@@ -42,7 +42,7 @@ describe 'Set up Mattermost slash commands', :js do
click_on 'Save changes'
expect(current_path).to eq(project_settings_integrations_path(project))
- expect(page).to have_content('Mattermost slash commands activated.')
+ expect(page).to have_content(_('Mattermost slash commands activated.'))
end
it 'shows the add to mattermost button' do
@@ -64,7 +64,7 @@ describe 'Set up Mattermost slash commands', :js do
click_link 'Add to Mattermost'
expect(page).to have_content('The team where the slash commands will be used in')
- expect(page).to have_content('This is the only available team that you are a member of.')
+ expect(page).to have_content(_('This is the only available team that you are a member of.'))
end
it 'shows a disabled prefilled select if user is a member of 1 team' do
@@ -94,7 +94,7 @@ describe 'Set up Mattermost slash commands', :js do
click_link 'Add to Mattermost'
expect(page).to have_content('Select the team where the slash commands will be used in')
- expect(page).to have_content('The list shows all available teams that you are a member of.')
+ expect(page).to have_content(_('The list shows all available teams that you are a member of.'))
end
it 'shows a select with team options user is a member of multiple teams' do
diff --git a/spec/features/projects/services/user_activates_packagist_spec.rb b/spec/features/projects/services/user_activates_packagist_spec.rb
index 756e9b33c07..11032b24767 100644
--- a/spec/features/projects/services/user_activates_packagist_spec.rb
+++ b/spec/features/projects/services/user_activates_packagist_spec.rb
@@ -19,6 +19,6 @@ describe 'User activates Packagist' do
fill_in('Token', with: 'verySecret')
click_button('Save')
- expect(page).to have_content('Packagist activated.')
+ expect(page).to have_content(_('Packagist activated.'))
end
end
diff --git a/spec/features/projects/services/user_activates_pivotaltracker_spec.rb b/spec/features/projects/services/user_activates_pivotaltracker_spec.rb
index 1d6b19e0b0c..bf2c95ed60b 100644
--- a/spec/features/projects/services/user_activates_pivotaltracker_spec.rb
+++ b/spec/features/projects/services/user_activates_pivotaltracker_spec.rb
@@ -18,6 +18,6 @@ describe 'User activates PivotalTracker' do
fill_in('Token', with: 'verySecret')
click_button('Save')
- expect(page).to have_content('PivotalTracker activated.')
+ expect(page).to have_content(_('PivotalTracker activated.'))
end
end
diff --git a/spec/features/projects/services/user_activates_prometheus_spec.rb b/spec/features/projects/services/user_activates_prometheus_spec.rb
index 61361c8a2e3..b7a18613247 100644
--- a/spec/features/projects/services/user_activates_prometheus_spec.rb
+++ b/spec/features/projects/services/user_activates_prometheus_spec.rb
@@ -18,6 +18,6 @@ describe 'User activates Prometheus' do
fill_in('API URL', with: 'http://prometheus.example.com')
click_button('Save changes')
- expect(page).to have_content('Prometheus activated.')
+ expect(page).to have_content(_('Prometheus activated.'))
end
end
diff --git a/spec/features/projects/services/user_activates_pushover_spec.rb b/spec/features/projects/services/user_activates_pushover_spec.rb
index 24612ee1457..a54f7b43402 100644
--- a/spec/features/projects/services/user_activates_pushover_spec.rb
+++ b/spec/features/projects/services/user_activates_pushover_spec.rb
@@ -22,6 +22,6 @@ describe 'User activates Pushover' do
select('Bike', from: 'Sound')
click_button('Save')
- expect(page).to have_content('Pushover activated.')
+ expect(page).to have_content(_('Pushover activated.'))
end
end
diff --git a/spec/features/projects/services/user_activates_slack_notifications_spec.rb b/spec/features/projects/services/user_activates_slack_notifications_spec.rb
index 24b5d5259db..af8895ed82a 100644
--- a/spec/features/projects/services/user_activates_slack_notifications_spec.rb
+++ b/spec/features/projects/services/user_activates_slack_notifications_spec.rb
@@ -22,7 +22,7 @@ describe 'User activates Slack notifications' do
fill_in('Webhook', with: 'https://hooks.slack.com/services/SVRWFV0VVAR97N/B02R25XN3/ZBqu7xMupaEEICInN685')
click_button('Save')
- expect(page).to have_content('Slack notifications activated.')
+ expect(page).to have_content(_('Slack notifications activated.'))
end
end
diff --git a/spec/features/projects/services/user_activates_slack_slash_command_spec.rb b/spec/features/projects/services/user_activates_slack_slash_command_spec.rb
index 08cfddf7993..1ed41298c1a 100644
--- a/spec/features/projects/services/user_activates_slack_slash_command_spec.rb
+++ b/spec/features/projects/services/user_activates_slack_slash_command_spec.rb
@@ -26,7 +26,7 @@ describe 'Slack slash commands' do
click_on 'Save'
expect(current_path).to eq(project_settings_integrations_path(project))
- expect(page).to have_content('Slack slash commands settings saved, but not activated.')
+ expect(page).to have_content(_('Slack slash commands settings saved, but not activated.'))
end
it 'redirects to the integrations page after activating' do
@@ -35,7 +35,7 @@ describe 'Slack slash commands' do
click_on 'Save'
expect(current_path).to eq(project_settings_integrations_path(project))
- expect(page).to have_content('Slack slash commands activated.')
+ expect(page).to have_content(_('Slack slash commands activated.'))
end
it 'shows the correct trigger url' do
diff --git a/spec/features/projects/settings/forked_project_settings_spec.rb b/spec/features/projects/settings/forked_project_settings_spec.rb
index df33d215602..be3122999f7 100644
--- a/spec/features/projects/settings/forked_project_settings_spec.rb
+++ b/spec/features/projects/settings/forked_project_settings_spec.rb
@@ -23,7 +23,7 @@ describe 'Projects > Settings > For a forked project', :js do
fill_in('confirm_name_input', with: forked_project.name)
click_button('Confirm')
- expect(page).to have_content('The fork relationship has been removed.')
+ expect(page).to have_content(_('The fork relationship has been removed.'))
expect(forked_project.reload.forked?).to be_falsy
end
end
diff --git a/spec/features/projects/settings/project_badges_spec.rb b/spec/features/projects/settings/project_badges_spec.rb
index 42b5547d43b..39637ce8eda 100644
--- a/spec/features/projects/settings/project_badges_spec.rb
+++ b/spec/features/projects/settings/project_badges_spec.rb
@@ -105,7 +105,7 @@ describe 'Project Badges' do
click_delete_button(rows[1])
- expect(find('.modal .modal-title')).to have_content 'Delete badge?'
+ expect(find('.modal .modal-title')).to have_content _('Delete badge?')
end
it 'deletes a badge when confirming the modal' do
diff --git a/spec/features/projects/settings/user_renames_a_project_spec.rb b/spec/features/projects/settings/user_renames_a_project_spec.rb
index 64c9af4b706..746043b2bee 100644
--- a/spec/features/projects/settings/user_renames_a_project_spec.rb
+++ b/spec/features/projects/settings/user_renames_a_project_spec.rb
@@ -26,7 +26,7 @@ describe 'Projects > Settings > User renames a project' do
rename_project(project, name: 'foo&bar', path: 'foo&bar')
expect(page).to have_field 'Project name', with: 'foo&bar'
expect(page).to have_field 'Path', with: 'foo&bar'
- expect(page).to have_content "Name can contain only letters, digits, emojis, '_', '.', dash, space. It must start with letter, digit, emoji or '_'."
+ expect(page).to have_content _("Name can contain only letters, digits, emojis, '_', '.', dash, space. It must start with letter, digit, emoji or '_'.")
expect(page).to have_content "Path can contain only letters, digits, '_', '-' and '.'. Cannot start with '-', end in '.git' or end in '.atom'"
end
end
@@ -37,7 +37,7 @@ describe 'Projects > Settings > User renames a project' do
click_button 'Save changes'
end
- expect(page).to have_content "Project 'hello world' was successfully updated."
+ expect(page).to have_content _("Project 'hello world' was successfully updated.")
end
context 'when changing project name' do
@@ -50,7 +50,7 @@ describe 'Projects > Settings > User renames a project' do
it 'shows error for invalid project name' do
rename_project(project, name: '🚀 foo bar ☁️')
expect(page).to have_field 'Project name', with: '🚀 foo bar ☁️'
- expect(page).not_to have_content "Name can contain only letters, digits, emojis '_', '.', dash and space. It must start with letter, digit, emoji or '_'."
+ expect(page).not_to have_content _("Name can contain only letters, digits, emojis '_', '.', dash and space. It must start with letter, digit, emoji or '_'.")
end
end
end
diff --git a/spec/features/projects/settings/visibility_settings_spec.rb b/spec/features/projects/settings/visibility_settings_spec.rb
index 1fbc108697f..a4af9b23ecc 100644
--- a/spec/features/projects/settings/visibility_settings_spec.rb
+++ b/spec/features/projects/settings/visibility_settings_spec.rb
@@ -14,7 +14,7 @@ describe 'Projects > Settings > Visibility settings', :js do
visibility_select_container = find('.project-visibility-setting')
expect(visibility_select_container.find('select').value).to eq project.visibility_level.to_s
- expect(visibility_select_container).to have_content 'The project can be accessed by anyone, regardless of authentication.'
+ expect(visibility_select_container).to have_content _('The project can be accessed by anyone, regardless of authentication.')
end
it 'project visibility description updates on change' do
@@ -23,7 +23,7 @@ describe 'Projects > Settings > Visibility settings', :js do
visibility_select.select('Private')
expect(visibility_select.value).to eq '0'
- expect(visibility_select_container).to have_content 'Access must be granted explicitly to each user.'
+ expect(visibility_select_container).to have_content _('Access must be granted explicitly to each user.')
end
context 'merge requests select' do
@@ -72,7 +72,7 @@ describe 'Projects > Settings > Visibility settings', :js do
visibility_select_container = find('.project-visibility-setting')
expect(visibility_select_container).to have_selector 'select[name="project[visibility_level]"]:disabled'
- expect(visibility_select_container).to have_content 'The project can be accessed by anyone, regardless of authentication.'
+ expect(visibility_select_container).to have_content _('The project can be accessed by anyone, regardless of authentication.')
end
end
end
diff --git a/spec/features/projects/snippets/create_snippet_spec.rb b/spec/features/projects/snippets/create_snippet_spec.rb
index 6d8a72dd6a3..1fbc04d55a5 100644
--- a/spec/features/projects/snippets/create_snippet_spec.rb
+++ b/spec/features/projects/snippets/create_snippet_spec.rb
@@ -10,7 +10,7 @@ describe 'Projects > Snippets > Create Snippet', :js do
fill_in 'project_snippet_title', with: 'My Snippet Title'
fill_in 'project_snippet_description', with: 'My Snippet **Description**'
page.within('.file-editor') do
- find('.ace_text-input', visible: false).send_keys('Hello World!')
+ find('.ace_text-input', visible: false).send_keys(_('Hello World!'))
end
end
@@ -30,7 +30,7 @@ describe 'Projects > Snippets > Create Snippet', :js do
wait_for_requests
expect(page).to have_content('My Snippet Title')
- expect(page).to have_content('Hello World!')
+ expect(page).to have_content(_('Hello World!'))
page.within('.snippet-header .description') do
expect(page).to have_content('My Snippet Description')
expect(page).to have_selector('strong')
@@ -63,7 +63,7 @@ describe 'Projects > Snippets > Create Snippet', :js do
wait_for_requests
expect(page).to have_content('My Snippet Title')
- expect(page).to have_content('Hello World!')
+ expect(page).to have_content(_('Hello World!'))
page.within('.snippet-header .description') do
expect(page).to have_content('My Snippet Description')
expect(page).to have_selector('strong')
diff --git a/spec/features/projects/snippets/user_comments_on_snippet_spec.rb b/spec/features/projects/snippets/user_comments_on_snippet_spec.rb
index d82e350e0f7..9c770b1db4c 100644
--- a/spec/features/projects/snippets/user_comments_on_snippet_spec.rb
+++ b/spec/features/projects/snippets/user_comments_on_snippet_spec.rb
@@ -14,13 +14,13 @@ describe 'Projects > Snippets > User comments on a snippet', :js do
it 'leaves a comment on a snippet' do
page.within('.js-main-target-form') do
- fill_in('note_note', with: 'Good snippet!')
+ fill_in('note_note', with: _('Good snippet!'))
click_button('Comment')
end
wait_for_requests
- expect(page).to have_content('Good snippet!')
+ expect(page).to have_content(_('Good snippet!'))
end
it 'should have autocomplete' do
diff --git a/spec/features/projects/wiki/user_creates_wiki_page_spec.rb b/spec/features/projects/wiki/user_creates_wiki_page_spec.rb
index 48a0d675f2d..83b9f894382 100644
--- a/spec/features/projects/wiki/user_creates_wiki_page_spec.rb
+++ b/spec/features/projects/wiki/user_creates_wiki_page_spec.rb
@@ -159,14 +159,14 @@ describe "User creates wiki page" do
it "creates a page from the home page" do
page.within(".wiki-form") do
- fill_in(:wiki_content, with: "My awesome wiki!")
+ fill_in(:wiki_content, with: _("My awesome wiki!"))
click_button("Create page")
end
expect(page).to have_content("Home")
.and have_content("Last edited by #{user.name}")
- .and have_content("My awesome wiki!")
+ .and have_content(_("My awesome wiki!"))
end
end
end
@@ -195,14 +195,14 @@ describe "User creates wiki page" do
expect(page).to have_field("wiki[message]", with: "Create foo")
page.within(".wiki-form") do
- fill_in(:wiki_content, with: "My awesome wiki!")
+ fill_in(:wiki_content, with: _("My awesome wiki!"))
click_button("Create page")
end
expect(page).to have_content("foo")
.and have_content("Last edited by #{user.name}")
- .and have_content("My awesome wiki!")
+ .and have_content(_("My awesome wiki!"))
end
it "creates a page with spaces in the name" do
@@ -218,14 +218,14 @@ describe "User creates wiki page" do
expect(page).to have_field("wiki[message]", with: "Create Spaces in the name")
page.within(".wiki-form") do
- fill_in(:wiki_content, with: "My awesome wiki!")
+ fill_in(:wiki_content, with: _("My awesome wiki!"))
click_button("Create page")
end
expect(page).to have_content("Spaces in the name")
.and have_content("Last edited by #{user.name}")
- .and have_content("My awesome wiki!")
+ .and have_content(_("My awesome wiki!"))
end
it "creates a page with hyphens in the name" do
@@ -241,14 +241,14 @@ describe "User creates wiki page" do
expect(page).to have_field("wiki[message]", with: "Create hyphens in the name")
page.within(".wiki-form") do
- fill_in(:wiki_content, with: "My awesome wiki!")
+ fill_in(:wiki_content, with: _("My awesome wiki!"))
click_button("Create page")
end
expect(page).to have_content("hyphens in the name")
.and have_content("Last edited by #{user.name}")
- .and have_content("My awesome wiki!")
+ .and have_content(_("My awesome wiki!"))
end
end
@@ -288,14 +288,14 @@ describe "User creates wiki page" do
expect(page).to have_field("wiki[message]", with: "Create foo")
page.within(".wiki-form") do
- fill_in(:wiki_content, with: "My awesome wiki!")
+ fill_in(:wiki_content, with: _("My awesome wiki!"))
click_button("Create page")
end
expect(page).to have_content("foo")
.and have_content("Last edited by #{user.name}")
- .and have_content("My awesome wiki!")
+ .and have_content(_("My awesome wiki!"))
end
end
end
diff --git a/spec/features/projects/wiki/user_updates_wiki_page_spec.rb b/spec/features/projects/wiki/user_updates_wiki_page_spec.rb
index f76e577b0d6..6920f6fd845 100644
--- a/spec/features/projects/wiki/user_updates_wiki_page_spec.rb
+++ b/spec/features/projects/wiki/user_updates_wiki_page_spec.rb
@@ -77,12 +77,12 @@ describe 'User updates wiki page' do
# Commit message field should have correct value.
expect(page).to have_field('wiki[message]', with: 'Update home')
- fill_in(:wiki_content, with: 'My awesome wiki!')
+ fill_in(:wiki_content, with: _('My awesome wiki!'))
click_button('Save changes')
expect(page).to have_content('Home')
expect(page).to have_content("Last edited by #{user.name}")
- expect(page).to have_content('My awesome wiki!')
+ expect(page).to have_content(_('My awesome wiki!'))
end
it 'shows a validation error message' do
@@ -108,7 +108,7 @@ describe 'User updates wiki page' do
click_button('Save changes')
- expect(page).to have_content('Someone edited the page the same time you did.')
+ expect(page).to have_content(_('Someone edited the page the same time you did.'))
end
it 'updates a page' do
@@ -136,13 +136,13 @@ describe 'User updates wiki page' do
# Commit message field should have correct value.
expect(page).to have_field('wiki[message]', with: 'Update home')
- fill_in(:wiki_content, with: 'My awesome wiki!')
+ fill_in(:wiki_content, with: _('My awesome wiki!'))
click_button('Save changes')
expect(page).to have_content('Home')
expect(page).to have_content("Last edited by #{user.name}")
- expect(page).to have_content('My awesome wiki!')
+ expect(page).to have_content(_('My awesome wiki!'))
end
it_behaves_like 'wiki file attachments'
diff --git a/spec/features/projects/wiki/user_views_wiki_page_spec.rb b/spec/features/projects/wiki/user_views_wiki_page_spec.rb
index d4691b669c1..2e49f4b23a8 100644
--- a/spec/features/projects/wiki/user_views_wiki_page_spec.rb
+++ b/spec/features/projects/wiki/user_views_wiki_page_spec.rb
@@ -148,7 +148,7 @@ describe 'User views a wiki page' do
it 'shows error' do
page.within(:css, '.flash-notice') do
- expect(page).to have_content('The content of this page is not encoded in UTF-8. Edits can only be made via the Git repository.')
+ expect(page).to have_content(_('The content of this page is not encoded in UTF-8. Edits can only be made via the Git repository.'))
end
end
end
diff --git a/spec/features/projects_spec.rb b/spec/features/projects_spec.rb
index eb70a3c41c1..c9d246de536 100644
--- a/spec/features/projects_spec.rb
+++ b/spec/features/projects_spec.rb
@@ -162,7 +162,7 @@ describe 'Project' do
remove_with_confirm('Remove fork relationship', project.path)
- expect(page).to have_content 'The fork relationship has been removed.'
+ expect(page).to have_content _('The fork relationship has been removed.')
expect(project.reload.forked?).to be_falsey
expect(page).not_to have_content 'Remove fork relationship'
end
diff --git a/spec/features/read_only_spec.rb b/spec/features/read_only_spec.rb
index 8bfaf558466..1e6f8c885d3 100644
--- a/spec/features/read_only_spec.rb
+++ b/spec/features/read_only_spec.rb
@@ -12,7 +12,7 @@ describe 'read-only message' do
visit root_dashboard_path
- expect(page).to have_content('You are on a read-only GitLab instance.')
+ expect(page).to have_content(_('You are on a read-only GitLab instance.'))
end
it 'does not show read-only banner when database is able to read-write' do
@@ -20,6 +20,6 @@ describe 'read-only message' do
visit root_dashboard_path
- expect(page).not_to have_content('You are on a read-only GitLab instance.')
+ expect(page).not_to have_content(_('You are on a read-only GitLab instance.'))
end
end
diff --git a/spec/features/runners_spec.rb b/spec/features/runners_spec.rb
index 6eae0be4b9f..9d0dd670175 100644
--- a/spec/features/runners_spec.rb
+++ b/spec/features/runners_spec.rb
@@ -210,7 +210,7 @@ describe 'Runners' do
it 'group runners are not available' do
visit project_runners_path(project)
- expect(page).to have_content 'This project does not belong to a group and can therefore not make use of group Runners.'
+ expect(page).to have_content _('This project does not belong to a group and can therefore not make use of group Runners.')
end
end
@@ -221,10 +221,10 @@ describe 'Runners' do
it 'group runners are not available' do
visit project_runners_path(project)
- expect(page).to have_content 'This group does not provide any group Runners yet.'
+ expect(page).to have_content _('This group does not provide any group Runners yet.')
expect(page).not_to have_content 'Group maintainers can register group runners in the Group CI/CD settings'
- expect(page).to have_content 'Ask your group maintainer to set up a group Runner.'
+ expect(page).to have_content _('Ask your group maintainer to set up a group Runner.')
end
end
diff --git a/spec/features/signed_commits_spec.rb b/spec/features/signed_commits_spec.rb
index e2b3444272e..0de4957bad0 100644
--- a/spec/features/signed_commits_spec.rb
+++ b/spec/features/signed_commits_spec.rb
@@ -80,7 +80,7 @@ describe 'GPG signed commits' do
click_on 'Unverified'
within '.popover' do
- expect(page).to have_content 'This commit was signed with an unverified signature.'
+ expect(page).to have_content _('This commit was signed with an unverified signature.')
expect(page).to have_content "GPG Key ID: #{GpgHelpers::User2.primary_keyid}"
end
end
@@ -93,7 +93,7 @@ describe 'GPG signed commits' do
click_on 'Unverified'
within '.popover' do
- expect(page).to have_content 'This commit was signed with a verified signature, but the committer email is not verified to belong to the same user.'
+ expect(page).to have_content _('This commit was signed with a verified signature, but the committer email is not verified to belong to the same user.')
expect(page).to have_content 'Bette Cartwright'
expect(page).to have_content '@bette.cartwright'
expect(page).to have_content "GPG Key ID: #{GpgHelpers::User2.primary_keyid}"
@@ -108,7 +108,7 @@ describe 'GPG signed commits' do
click_on 'Unverified'
within '.popover' do
- expect(page).to have_content "This commit was signed with a different user's verified signature."
+ expect(page).to have_content _("This commit was signed with a different user's verified signature.")
expect(page).to have_content 'Bette Cartwright'
expect(page).to have_content '@bette.cartwright'
expect(page).to have_content "GPG Key ID: #{GpgHelpers::User2.primary_keyid}"
@@ -123,7 +123,7 @@ describe 'GPG signed commits' do
click_on 'Verified'
within '.popover' do
- expect(page).to have_content 'This commit was signed with a verified signature and the committer email is verified to belong to the same user.'
+ expect(page).to have_content _('This commit was signed with a verified signature and the committer email is verified to belong to the same user.')
expect(page).to have_content 'Nannie Bernhard'
expect(page).to have_content '@nannie.bernhard'
expect(page).to have_content "GPG Key ID: #{GpgHelpers::User1.primary_keyid}"
@@ -145,7 +145,7 @@ describe 'GPG signed commits' do
click_on 'Verified'
within '.popover' do
- expect(page).to have_content 'This commit was signed with a verified signature and the committer email is verified to belong to the same user.'
+ expect(page).to have_content _('This commit was signed with a verified signature and the committer email is verified to belong to the same user.')
expect(page).to have_content 'Nannie Bernhard'
expect(page).to have_content 'nannie.bernhard@example.com'
expect(page).to have_content "GPG Key ID: #{GpgHelpers::User1.primary_keyid}"
diff --git a/spec/features/snippets/notes_on_personal_snippets_spec.rb b/spec/features/snippets/notes_on_personal_snippets_spec.rb
index eeacaf5f72a..308c605b0b1 100644
--- a/spec/features/snippets/notes_on_personal_snippets_spec.rb
+++ b/spec/features/snippets/notes_on_personal_snippets_spec.rb
@@ -67,20 +67,20 @@ describe 'Comments on personal snippets', :js do
end
it 'previews a note' do
- fill_in 'note[note]', with: 'This is **awesome**!'
+ fill_in 'note[note]', with: _('This is **awesome**!')
find('.js-md-preview-button').click
page.within('.new-note .md-preview') do
- expect(page).to have_content('This is awesome!')
+ expect(page).to have_content(_('This is awesome!'))
expect(page).to have_selector('strong')
end
end
it 'creates a note' do
- fill_in 'note[note]', with: 'This is **awesome**!'
+ fill_in 'note[note]', with: _('This is **awesome**!')
click_button 'Comment'
- expect(find('div#notes')).to have_content('This is awesome!')
+ expect(find('div#notes')).to have_content(_('This is awesome!'))
end
it 'should not have autocomplete' do
diff --git a/spec/features/snippets/user_creates_snippet_spec.rb b/spec/features/snippets/user_creates_snippet_spec.rb
index 879c46d7c4e..c2157b54e43 100644
--- a/spec/features/snippets/user_creates_snippet_spec.rb
+++ b/spec/features/snippets/user_creates_snippet_spec.rb
@@ -14,7 +14,7 @@ describe 'User creates snippet', :js do
fill_in 'personal_snippet_title', with: 'My Snippet Title'
fill_in 'personal_snippet_description', with: 'My Snippet **Description**'
page.within('.file-editor') do
- find('.ace_text-input', visible: false).send_keys 'Hello World!'
+ find('.ace_text-input', visible: false).send_keys _('Hello World!')
end
end
@@ -29,7 +29,7 @@ describe 'User creates snippet', :js do
expect(page).to have_content('My Snippet Description')
expect(page).to have_selector('strong')
end
- expect(page).to have_content('Hello World!')
+ expect(page).to have_content(_('Hello World!'))
end
it 'previews a snippet with file' do
@@ -82,7 +82,7 @@ describe 'User creates snippet', :js do
expect(page).to have_content('My Snippet Description')
expect(page).to have_selector('strong')
end
- expect(page).to have_content('Hello World!')
+ expect(page).to have_content(_('Hello World!'))
link = find('a.no-attachment-icon img[alt="banana_sample"]')['src']
expect(link).to match(%r{/uploads/-/system/personal_snippet/#{Snippet.last.id}/\h{32}/banana_sample\.gif\z})
@@ -94,7 +94,7 @@ describe 'User creates snippet', :js do
fill_in 'personal_snippet_title', with: 'My Snippet Title'
page.within('.file-editor') do
find(:xpath, "//input[@id='personal_snippet_file_name']").set 'snippet+file+name'
- find('.ace_text-input', visible: false).send_keys 'Hello World!'
+ find('.ace_text-input', visible: false).send_keys _('Hello World!')
end
click_button 'Create snippet'
@@ -102,6 +102,6 @@ describe 'User creates snippet', :js do
expect(page).to have_content('My Snippet Title')
expect(page).to have_content('snippet+file+name')
- expect(page).to have_content('Hello World!')
+ expect(page).to have_content(_('Hello World!'))
end
end
diff --git a/spec/features/tags/master_views_tags_spec.rb b/spec/features/tags/master_views_tags_spec.rb
index 36cfeb5ed84..af5d7d25ff3 100644
--- a/spec/features/tags/master_views_tags_spec.rb
+++ b/spec/features/tags/master_views_tags_spec.rb
@@ -20,7 +20,7 @@ describe 'Maintainer views tags' do
end
it 'displays a specific message' do
- expect(page).to have_content 'Repository has no tags yet.'
+ expect(page).to have_content _('Repository has no tags yet.')
end
end
@@ -50,7 +50,7 @@ describe 'Maintainer views tags' do
expect(current_path).to eq(
project_tag_path(project, 'v1.0.0'))
expect(page).to have_content 'v1.0.0'
- expect(page).to have_content 'This tag has no release notes.'
+ expect(page).to have_content _('This tag has no release notes.')
end
describe 'links on the tag page' do
diff --git a/spec/features/triggers_spec.rb b/spec/features/triggers_spec.rb
index 919859c145a..18f0541e169 100644
--- a/spec/features/triggers_spec.rb
+++ b/spec/features/triggers_spec.rb
@@ -31,7 +31,7 @@ describe 'Triggers', :js do
click_button 'Add trigger'
# See if "trigger creation successful" message displayed and description and owner are correct
- expect(page.find('.flash-notice')).to have_content 'Trigger was created successfully.'
+ expect(page.find('.flash-notice')).to have_content _('Trigger was created successfully.')
expect(page.find('.triggers-list')).to have_content 'trigger desc'
expect(page.find('.triggers-list .trigger-owner')).to have_content user.name
end
@@ -59,7 +59,7 @@ describe 'Triggers', :js do
click_button 'Save trigger'
# See if "trigger updated successfully" message displayed and description and owner are correct
- expect(page.find('.flash-notice')).to have_content 'Trigger was successfully updated.'
+ expect(page.find('.flash-notice')).to have_content _('Trigger was successfully updated.')
expect(page.find('.triggers-list')).to have_content new_trigger_title
expect(page.find('.triggers-list .trigger-owner')).to have_content user.name
end
@@ -76,7 +76,7 @@ describe 'Triggers', :js do
# See if trigger can be updated with description and saved successfully
fill_in 'trigger_description', with: new_trigger_title
click_button 'Save trigger'
- expect(page.find('.flash-notice')).to have_content 'Trigger was successfully updated.'
+ expect(page.find('.flash-notice')).to have_content _('Trigger was successfully updated.')
expect(page.find('.triggers-list')).to have_content new_trigger_title
end
end
@@ -88,7 +88,7 @@ describe 'Triggers', :js do
end
it 'button "Take ownership" has correct alert' do
- expected_alert = 'By taking ownership you will bind this trigger to your user account. With this the trigger will have access to all your projects as if it was you. Are you sure?'
+ expected_alert = _('By taking ownership you will bind this trigger to your user account. With this the trigger will have access to all your projects as if it was you. Are you sure?')
expect(page.find('a.btn-trigger-take-ownership')['data-confirm']).to eq expected_alert
end
@@ -98,7 +98,7 @@ describe 'Triggers', :js do
first(:link, "Take ownership").send_keys(:return)
end
- expect(page.find('.flash-notice')).to have_content 'Trigger was re-assigned.'
+ expect(page.find('.flash-notice')).to have_content _('Trigger was re-assigned.')
expect(page.find('.triggers-list')).to have_content trigger_title
expect(page.find('.triggers-list .trigger-owner')).to have_content user.name
end
@@ -111,7 +111,7 @@ describe 'Triggers', :js do
end
it 'button "Revoke" has correct alert' do
- expected_alert = 'By revoking a trigger you will break any processes making use of it. Are you sure?'
+ expected_alert = _('By revoking a trigger you will break any processes making use of it. Are you sure?')
expect(page.find('a.btn-trigger-revoke')['data-confirm']).to eq expected_alert
end
diff --git a/spec/features/u2f_spec.rb b/spec/features/u2f_spec.rb
index ae9b65d1a39..8628e9ea2fb 100644
--- a/spec/features/u2f_spec.rb
+++ b/spec/features/u2f_spec.rb
@@ -226,12 +226,12 @@ describe 'Using U2F (Universal 2nd Factor) Devices for Authentication', :js do
user = gitlab_sign_in(:user)
user.update_attribute(:otp_required_for_login, true)
visit profile_two_factor_auth_path
- expect(page).to have_content("Your U2F device needs to be set up.")
+ expect(page).to have_content(_("Your U2F device needs to be set up."))
first_device = register_u2f_device
# Register second device
visit profile_two_factor_auth_path
- expect(page).to have_content("Your U2F device needs to be set up.")
+ expect(page).to have_content(_("Your U2F device needs to be set up."))
second_device = register_u2f_device(name: 'My other device')
gitlab_sign_out
@@ -255,7 +255,7 @@ describe 'Using U2F (Universal 2nd Factor) Devices for Authentication', :js do
user.update_attribute(:otp_required_for_login, true)
visit profile_account_path
manage_two_factor_authentication
- expect(page).to have_content("Your U2F device needs to be set up.")
+ expect(page).to have_content(_("Your U2F device needs to be set up."))
register_u2f_device
end
diff --git a/spec/features/unsubscribe_links_spec.rb b/spec/features/unsubscribe_links_spec.rb
index 392d8e3e1c1..61cabe6cda1 100644
--- a/spec/features/unsubscribe_links_spec.rb
+++ b/spec/features/unsubscribe_links_spec.rb
@@ -6,7 +6,7 @@ describe 'Unsubscribe links' do
let(:recipient) { create(:user) }
let(:author) { create(:user) }
let(:project) { create(:project, :public) }
- let(:params) { { title: 'A bug!', description: 'Fix it!', assignees: [recipient] } }
+ let(:params) { { title: _('A bug!'), description: _('Fix it!'), assignees: [recipient] } }
let(:issue) { Issues::CreateService.new(project, author, params).execute }
let(:mail) { ActionMailer::Base.deliveries.last }
diff --git a/spec/features/uploads/user_uploads_file_to_note_spec.rb b/spec/features/uploads/user_uploads_file_to_note_spec.rb
index 24a00c86b0a..d0ad435297e 100644
--- a/spec/features/uploads/user_uploads_file_to_note_spec.rb
+++ b/spec/features/uploads/user_uploads_file_to_note_spec.rb
@@ -53,7 +53,7 @@ describe 'User uploads file to note' do
it 'shows error message, "retry" and "attach a new file" link a if file is too big', :js do
dropzone_file([Rails.root.join('spec', 'fixtures', 'video_sample.mp4')], 0.01)
- error_text = 'File is too big (0.06MiB). Max filesize: 0.01MiB.'
+ error_text = _('File is too big (0.06MiB). Max filesize: 0.01MiB.')
expect(page).to have_selector('.uploading-error-message', visible: true, text: error_text)
expect(page).to have_selector('.retry-uploading-link', visible: true, text: 'Try again')
diff --git a/spec/features/usage_stats_consent_spec.rb b/spec/features/usage_stats_consent_spec.rb
index dd8f3179895..14322465983 100644
--- a/spec/features/usage_stats_consent_spec.rb
+++ b/spec/features/usage_stats_consent_spec.rb
@@ -5,7 +5,7 @@ require 'spec_helper'
describe 'Usage stats consent' do
context 'when signed in' do
let(:user) { create(:admin, created_at: 8.days.ago) }
- let(:message) { 'To help improve GitLab, we would like to periodically collect usage information.' }
+ let(:message) { _('To help improve GitLab, we would like to periodically collect usage information.') }
before do
allow(user).to receive(:has_current_license?).and_return false
diff --git a/spec/features/users/add_email_to_existing_account.rb b/spec/features/users/add_email_to_existing_account.rb
index 4355f769429..a2cbb4c4803 100644
--- a/spec/features/users/add_email_to_existing_account.rb
+++ b/spec/features/users/add_email_to_existing_account.rb
@@ -9,7 +9,7 @@ describe 'AdditionalEmailToExistingAccount' do
email = create(:email, user: user)
visit email_confirmation_path(confirmation_token: email.confirmation_token)
- expect(page).to have_content 'Your email address has been successfully confirmed.'
+ expect(page).to have_content _('Your email address has been successfully confirmed.')
end
end
end
diff --git a/spec/features/users/login_spec.rb b/spec/features/users/login_spec.rb
index ad856bd062e..d51e579480c 100644
--- a/spec/features/users/login_spec.rb
+++ b/spec/features/users/login_spec.rb
@@ -45,7 +45,7 @@ describe 'Login' do
visit root_path
expect(current_path).to eq edit_user_password_path
- expect(page).to have_content('Please create a password for your new account.')
+ expect(page).to have_content(_('Please create a password for your new account.'))
fill_in 'user_password', with: 'password'
fill_in 'user_password_confirmation', with: 'password'
@@ -63,7 +63,7 @@ describe 'Login' do
it 'does not show flash messages when login page' do
visit root_path
- expect(page).not_to have_content('You need to sign in or sign up before continuing.')
+ expect(page).not_to have_content(_('You need to sign in or sign up before continuing.'))
end
end
@@ -78,7 +78,7 @@ describe 'Login' do
gitlab_sign_in(user)
- expect(page).to have_content('Your account has been blocked.')
+ expect(page).to have_content(_('Your account has been blocked.'))
end
it 'does not update Devise trackable attributes', :clean_gitlab_redis_shared_state do
@@ -101,7 +101,7 @@ describe 'Login' do
gitlab_sign_in(User.ghost)
- expect(page).to have_content('Invalid Login or password.')
+ expect(page).to have_content(_('Invalid Login or password.'))
end
it 'does not update Devise trackable attributes', :clean_gitlab_redis_shared_state do
@@ -137,7 +137,7 @@ describe 'Login' do
enter_code(user.current_otp)
- expect(page).not_to have_content('You are already signed in.')
+ expect(page).not_to have_content(_('You are already signed in.'))
end
context 'using one-time code' do
@@ -244,7 +244,7 @@ describe 'Login' do
expect(user.reload.otp_backup_codes.size).to eq 9
enter_code(code)
- expect(page).to have_content('Invalid two-factor code.')
+ expect(page).to have_content(_('Invalid two-factor code.'))
end
end
end
@@ -317,7 +317,7 @@ describe 'Login' do
gitlab_sign_in(user)
expect(current_path).to eq root_path
- expect(page).not_to have_content('You are already signed in.')
+ expect(page).not_to have_content(_('You are already signed in.'))
end
end
@@ -331,7 +331,7 @@ describe 'Login' do
gitlab_sign_in(user)
- expect(page).to have_content('Invalid Login or password.')
+ expect(page).to have_content(_('Invalid Login or password.'))
end
end
end
@@ -384,7 +384,7 @@ describe 'Login' do
expect(current_path).to eq profile_two_factor_auth_path
expect(page).to have_content(
- 'The global settings require you to enable Two-Factor Authentication for your account.'
+ _('The global settings require you to enable Two-Factor Authentication for your account.')
)
end
@@ -413,7 +413,7 @@ describe 'Login' do
expect(current_path).to eq profile_two_factor_auth_path
expect(page).to have_content(
- 'The global settings require you to enable Two-Factor Authentication for your account.'
+ _('The global settings require you to enable Two-Factor Authentication for your account.')
)
end
end
@@ -572,7 +572,7 @@ describe 'Login' do
click_button 'Accept terms'
expect(current_path).to eq(root_path)
- expect(page).not_to have_content('You are already signed in.')
+ expect(page).not_to have_content(_('You are already signed in.'))
end
it 'does not ask for terms when the user already accepted them' do
diff --git a/spec/features/users/show_spec.rb b/spec/features/users/show_spec.rb
index 86379164cf0..fed57666c0d 100644
--- a/spec/features/users/show_spec.rb
+++ b/spec/features/users/show_spec.rb
@@ -56,11 +56,11 @@ describe 'User page' do
end
it 'shows the status if there was one' do
- create(:user_status, user: user, message: "Working hard!")
+ create(:user_status, user: user, message: _("Working hard!"))
visit(user_path(user))
- expect(page).to have_content("Working hard!")
+ expect(page).to have_content(_("Working hard!"))
end
context 'signup disabled' do
diff --git a/spec/features/users/signup_spec.rb b/spec/features/users/signup_spec.rb
index bfe11ddf673..92a2693e171 100644
--- a/spec/features/users/signup_spec.rb
+++ b/spec/features/users/signup_spec.rb
@@ -47,7 +47,7 @@ describe 'Signup' do
click_button "Register"
- expect(page).to have_content("Please create a username with only alphanumeric characters.")
+ expect(page).to have_content(_("Please create a username with only alphanumeric characters."))
end
end
diff --git a/spec/features/users/terms_spec.rb b/spec/features/users/terms_spec.rb
index 5b2e7605c4d..876a6a2e1ec 100644
--- a/spec/features/users/terms_spec.rb
+++ b/spec/features/users/terms_spec.rb
@@ -3,7 +3,7 @@ require 'spec_helper'
describe 'Users > Terms' do
include TermsHelper
- let!(:term) { create(:term, terms: 'By accepting, you promise to be nice!') }
+ let!(:term) { create(:term, terms: _('By accepting, you promise to be nice!')) }
before do
stub_env('IN_MEMORY_APPLICATION_SETTINGS', 'false')
@@ -12,7 +12,7 @@ describe 'Users > Terms' do
it 'shows the terms' do
visit terms_path
- expect(page).to have_content('By accepting, you promise to be nice!')
+ expect(page).to have_content(_('By accepting, you promise to be nice!'))
end
it 'does not show buttons to accept, decline or sign out', :aggregate_failures do
diff --git a/spec/helpers/auto_devops_helper_spec.rb b/spec/helpers/auto_devops_helper_spec.rb
index 75c30dbfe48..90ed0eaaa81 100644
--- a/spec/helpers/auto_devops_helper_spec.rb
+++ b/spec/helpers/auto_devops_helper_spec.rb
@@ -122,7 +122,7 @@ describe AutoDevopsHelper do
allow(helper).to receive(:missing_auto_devops_domain?).and_return(true)
end
- it { is_expected.to eq('Auto Review Apps and Auto Deploy need a domain name to work correctly.') }
+ it { is_expected.to eq(_('Auto Review Apps and Auto Deploy need a domain name to work correctly.')) }
end
end
end
diff --git a/spec/helpers/button_helper_spec.rb b/spec/helpers/button_helper_spec.rb
index eebae1d7290..a2c2fba676c 100644
--- a/spec/helpers/button_helper_spec.rb
+++ b/spec/helpers/button_helper_spec.rb
@@ -29,7 +29,7 @@ describe ButtonHelper do
it 'shows the password text on the dropdown' do
description = element.search('.dropdown-menu-inner-content').first
- expect(description.inner_text).to eq 'Set a password on your account to pull or push via HTTP.'
+ expect(description.inner_text).to eq _('Set a password on your account to pull or push via HTTP.')
end
end
end
@@ -43,7 +43,7 @@ describe ButtonHelper do
it 'has a personal access token text on the dropdown description' do
description = element.search('.dropdown-menu-inner-content').first
- expect(description.inner_text).to eq 'Create a personal access token on your account to pull or push via HTTP.'
+ expect(description.inner_text).to eq _('Create a personal access token on your account to pull or push via HTTP.')
end
end
@@ -177,13 +177,13 @@ describe ButtonHelper do
context 'when `text` attribute is provided' do
it 'shows copy to clipboard button with provided `text` to copy' do
- expect(element(text: 'Hello World!').attr('data-clipboard-text')).to eq('Hello World!')
+ expect(element(text: _('Hello World!')).attr('data-clipboard-text')).to eq(_('Hello World!'))
end
end
context 'when `title` attribute is provided' do
it 'shows copy to clipboard button with provided `title` as tooltip' do
- expect(element(title: 'Copy to my clipboard!').attr('aria-label')).to eq('Copy to my clipboard!')
+ expect(element(title: _('Copy to my clipboard!')).attr('aria-label')).to eq(_('Copy to my clipboard!'))
end
end
end
diff --git a/spec/helpers/markup_helper_spec.rb b/spec/helpers/markup_helper_spec.rb
index a0c0af94fa5..18efb5225b4 100644
--- a/spec/helpers/markup_helper_spec.rb
+++ b/spec/helpers/markup_helper_spec.rb
@@ -298,7 +298,7 @@ describe MarkupHelper do
it 'truncates the text with multiple paragraphs' do
object = create_object("Paragraph 1\n\nParagraph 2")
- expected = 'Paragraph 1...'
+ expected = _('Paragraph 1...')
expect(first_line_in_markdown(object, attribute, 100, project: project)).to match(expected)
end
diff --git a/spec/helpers/visibility_level_helper_spec.rb b/spec/helpers/visibility_level_helper_spec.rb
index e565ac8c530..158c4d624f6 100644
--- a/spec/helpers/visibility_level_helper_spec.rb
+++ b/spec/helpers/visibility_level_helper_spec.rb
@@ -57,29 +57,29 @@ describe VisibilityLevelHelper do
describe "#project_visibility_level_description" do
it "describes private projects" do
expect(project_visibility_level_description(Gitlab::VisibilityLevel::PRIVATE))
- .to eq "Project access must be granted explicitly to each user."
+ .to eq _("Project access must be granted explicitly to each user.")
end
it "describes public projects" do
expect(project_visibility_level_description(Gitlab::VisibilityLevel::PUBLIC))
- .to eq "The project can be accessed without any authentication."
+ .to eq _("The project can be accessed without any authentication.")
end
end
describe "#snippet_visibility_level_description" do
it 'describes visibility only for me' do
expect(snippet_visibility_level_description(Gitlab::VisibilityLevel::PRIVATE, personal_snippet))
- .to eq "The snippet is visible only to me."
+ .to eq _("The snippet is visible only to me.")
end
it 'describes visibility for project members' do
expect(snippet_visibility_level_description(Gitlab::VisibilityLevel::PRIVATE, project_snippet))
- .to eq "The snippet is visible only to project members."
+ .to eq _("The snippet is visible only to project members.")
end
it 'defaults to personal snippet' do
expect(snippet_visibility_level_description(Gitlab::VisibilityLevel::PRIVATE))
- .to eq "The snippet is visible only to me."
+ .to eq _("The snippet is visible only to me.")
end
end
diff --git a/spec/initializers/fog_google_https_private_urls_spec.rb b/spec/initializers/fog_google_https_private_urls_spec.rb
index 08346b71fee..d6b794a7610 100644
--- a/spec/initializers/fog_google_https_private_urls_spec.rb
+++ b/spec/initializers/fog_google_https_private_urls_spec.rb
@@ -13,7 +13,7 @@ describe 'Fog::Storage::GoogleXML::File', :fog_requests do
let(:file) do
directory = storage.directories.create(key: 'data')
directory.files.create(
- body: 'Hello World!',
+ body: _('Hello World!'),
key: 'hello_world.txt'
)
end
diff --git a/spec/lib/banzai/filter/emoji_filter_spec.rb b/spec/lib/banzai/filter/emoji_filter_spec.rb
index 85a4619e33d..856a0005a85 100644
--- a/spec/lib/banzai/filter/emoji_filter_spec.rb
+++ b/spec/lib/banzai/filter/emoji_filter_spec.rb
@@ -91,13 +91,13 @@ describe Banzai::Filter::EmojiFilter do
end
it 'keeps whitespace intact' do
- doc = filter('This deserves a :+1:, big time.')
+ doc = filter(_('This deserves a :+1:, big time.'))
expect(doc.to_html).to match(/^This deserves a <gl-emoji.+>, big time\.\z/)
end
it 'unicode keeps whitespace intact' do
- doc = filter('This deserves a 🎱, big time.')
+ doc = filter(_('This deserves a 🎱, big time.'))
expect(doc.to_html).to match(/^This deserves a <gl-emoji.+>, big time\.\z/)
end
diff --git a/spec/lib/banzai/filter/label_reference_filter_spec.rb b/spec/lib/banzai/filter/label_reference_filter_spec.rb
index 9cfdb9e53a2..36785bf7a67 100644
--- a/spec/lib/banzai/filter/label_reference_filter_spec.rb
+++ b/spec/lib/banzai/filter/label_reference_filter_spec.rb
@@ -220,7 +220,7 @@ describe Banzai::Filter::LabelReferenceFilter do
expect(doc.css('a').first.attr('href')).to eq urls
.project_issues_url(project, label_name: label.name)
- expect(doc.text).to eq 'See g.fm & references?'
+ expect(doc.text).to eq _('See g.fm & references?')
end
it 'links with adjacent text' do
diff --git a/spec/lib/gitlab/auth/ldap/adapter_spec.rb b/spec/lib/gitlab/auth/ldap/adapter_spec.rb
index 3eeaf3862f6..18d43bb563d 100644
--- a/spec/lib/gitlab/auth/ldap/adapter_spec.rb
+++ b/spec/lib/gitlab/auth/ldap/adapter_spec.rb
@@ -125,7 +125,7 @@ describe Gitlab::Auth::LDAP::Adapter do
context "when the search raises an LDAP exception" do
before do
allow(adapter).to receive(:renew_connection_adapter).and_return(ldap)
- allow(ldap).to receive(:search) { raise Net::LDAP::Error, "some error" }
+ allow(ldap).to receive(:search) { raise Net::LDAP::Error, _("some error") }
allow(Rails.logger).to receive(:warn)
end
diff --git a/spec/lib/gitlab/bitbucket_server_import/importer_spec.rb b/spec/lib/gitlab/bitbucket_server_import/importer_spec.rb
index 70423823b89..a073dab49c3 100644
--- a/spec/lib/gitlab/bitbucket_server_import/importer_spec.rb
+++ b/spec/lib/gitlab/bitbucket_server_import/importer_spec.rb
@@ -199,7 +199,7 @@ describe Gitlab::BitbucketServerImport::Importer do
file_path: '.gitmodules',
old_pos: 8,
new_pos: 9,
- note: 'This is a note with an invalid line position.',
+ note: _('This is a note with an invalid line position.'),
author_email: project.owner.email,
author_username: 'Owner',
comments: [reply],
diff --git a/spec/lib/gitlab/checks/branch_check_spec.rb b/spec/lib/gitlab/checks/branch_check_spec.rb
index 77366e91dca..65b1094f47c 100644
--- a/spec/lib/gitlab/checks/branch_check_spec.rb
+++ b/spec/lib/gitlab/checks/branch_check_spec.rb
@@ -15,7 +15,7 @@ describe Gitlab::Checks::BranchCheck do
let(:ref) { 'refs/heads/master' }
it 'raises an error' do
- expect { subject.validate! }.to raise_error(Gitlab::GitAccess::UnauthorizedError, 'The default branch of a project cannot be deleted.')
+ expect { subject.validate! }.to raise_error(Gitlab::GitAccess::UnauthorizedError, _('The default branch of a project cannot be deleted.'))
end
end
@@ -28,7 +28,7 @@ describe Gitlab::Checks::BranchCheck do
it 'raises an error if the user is not allowed to do forced pushes to protected branches' do
expect(Gitlab::Checks::ForcePush).to receive(:force_push?).and_return(true)
- expect { subject.validate! }.to raise_error(Gitlab::GitAccess::UnauthorizedError, 'You are not allowed to force push code to a protected branch on this project.')
+ expect { subject.validate! }.to raise_error(Gitlab::GitAccess::UnauthorizedError, _('You are not allowed to force push code to a protected branch on this project.'))
end
it 'raises an error if the user is not allowed to merge to protected branches' do
@@ -36,13 +36,13 @@ describe Gitlab::Checks::BranchCheck do
expect(user_access).to receive(:can_merge_to_branch?).and_return(false)
expect(user_access).to receive(:can_push_to_branch?).and_return(false)
- expect { subject.validate! }.to raise_error(Gitlab::GitAccess::UnauthorizedError, 'You are not allowed to merge code into protected branches on this project.')
+ expect { subject.validate! }.to raise_error(Gitlab::GitAccess::UnauthorizedError, _('You are not allowed to merge code into protected branches on this project.'))
end
it 'raises an error if the user is not allowed to push to protected branches' do
expect(user_access).to receive(:can_push_to_branch?).and_return(false)
- expect { subject.validate! }.to raise_error(Gitlab::GitAccess::UnauthorizedError, 'You are not allowed to push code to protected branches on this project.')
+ expect { subject.validate! }.to raise_error(Gitlab::GitAccess::UnauthorizedError, _('You are not allowed to push code to protected branches on this project.'))
end
context 'when project repository is empty' do
@@ -61,7 +61,7 @@ describe Gitlab::Checks::BranchCheck do
context 'if the user is not allowed to delete protected branches' do
it 'raises an error' do
- expect { subject.validate! }.to raise_error(Gitlab::GitAccess::UnauthorizedError, 'You are not allowed to delete protected branches from this project. Only a project maintainer or owner can delete a protected branch.')
+ expect { subject.validate! }.to raise_error(Gitlab::GitAccess::UnauthorizedError, _('You are not allowed to delete protected branches from this project. Only a project maintainer or owner can delete a protected branch.'))
end
end
@@ -80,7 +80,7 @@ describe Gitlab::Checks::BranchCheck do
context 'over SSH or HTTP' do
it 'raises an error' do
- expect { subject.validate! }.to raise_error(Gitlab::GitAccess::UnauthorizedError, 'You can only delete protected branches using the web interface.')
+ expect { subject.validate! }.to raise_error(Gitlab::GitAccess::UnauthorizedError, _('You can only delete protected branches using the web interface.'))
end
end
end
diff --git a/spec/lib/gitlab/checks/push_check_spec.rb b/spec/lib/gitlab/checks/push_check_spec.rb
index e1bd52d6c0b..b8f0daa43c1 100644
--- a/spec/lib/gitlab/checks/push_check_spec.rb
+++ b/spec/lib/gitlab/checks/push_check_spec.rb
@@ -15,7 +15,7 @@ describe Gitlab::Checks::PushCheck do
expect(user_access).to receive(:can_do_action?).with(:push_code).and_return(false)
expect(project).to receive(:branch_allows_collaboration?).with(user_access.user, 'master').and_return(false)
- expect { subject.validate! }.to raise_error(Gitlab::GitAccess::UnauthorizedError, 'You are not allowed to push code to this project.')
+ expect { subject.validate! }.to raise_error(Gitlab::GitAccess::UnauthorizedError, _('You are not allowed to push code to this project.'))
end
end
end
diff --git a/spec/lib/gitlab/checks/tag_check_spec.rb b/spec/lib/gitlab/checks/tag_check_spec.rb
index b1258270611..52d3bc8544e 100644
--- a/spec/lib/gitlab/checks/tag_check_spec.rb
+++ b/spec/lib/gitlab/checks/tag_check_spec.rb
@@ -12,7 +12,7 @@ describe Gitlab::Checks::TagCheck do
allow(user_access).to receive(:can_do_action?).with(:push_code).and_return(true)
expect(user_access).to receive(:can_do_action?).with(:admin_project).and_return(false)
- expect { subject.validate! }.to raise_error(Gitlab::GitAccess::UnauthorizedError, 'You are not allowed to change existing tags on this project.')
+ expect { subject.validate! }.to raise_error(Gitlab::GitAccess::UnauthorizedError, _('You are not allowed to change existing tags on this project.'))
end
context 'with protected tag' do
diff --git a/spec/lib/gitlab/checks/timed_logger_spec.rb b/spec/lib/gitlab/checks/timed_logger_spec.rb
index 0ed3940c038..8ff2f36cabb 100644
--- a/spec/lib/gitlab/checks/timed_logger_spec.rb
+++ b/spec/lib/gitlab/checks/timed_logger_spec.rb
@@ -9,7 +9,7 @@ describe Gitlab::Checks::TimedLogger do
let!(:logger) { described_class.new(start_time: start, timeout: timeout) }
let!(:log_messages) do
{
- foo: "Foo message..."
+ foo: _("Foo message...")
}
end
diff --git a/spec/lib/gitlab/ci/config/entry/global_spec.rb b/spec/lib/gitlab/ci/config/entry/global_spec.rb
index 7651f594a4c..c2a46f9f713 100644
--- a/spec/lib/gitlab/ci/config/entry/global_spec.rb
+++ b/spec/lib/gitlab/ci/config/entry/global_spec.rb
@@ -54,9 +54,9 @@ describe Gitlab::Ci::Config::Entry::Global do
it 'sets correct description for nodes' do
expect(global.descendants.first.description)
- .to eq 'Script that will be executed before each job.'
+ .to eq _('Script that will be executed before each job.')
expect(global.descendants.second.description)
- .to eq 'Docker image that will be used to execute jobs.'
+ .to eq _('Docker image that will be used to execute jobs.')
end
describe '#leaf?' do
diff --git a/spec/lib/gitlab/ci/config/extendable/entry_spec.rb b/spec/lib/gitlab/ci/config/extendable/entry_spec.rb
index 0a148375d11..4a66622d15f 100644
--- a/spec/lib/gitlab/ci/config/extendable/entry_spec.rb
+++ b/spec/lib/gitlab/ci/config/extendable/entry_spec.rb
@@ -5,7 +5,7 @@ describe Gitlab::Ci::Config::Extendable::Entry do
context 'when entry key is not included in the context hash' do
it 'raises error' do
expect { described_class.new(:test, something: 'something') }
- .to raise_error StandardError, 'Invalid entry key!'
+ .to raise_error StandardError, _('Invalid entry key!')
end
end
end
diff --git a/spec/lib/gitlab/ci/config/external/file/project_spec.rb b/spec/lib/gitlab/ci/config/external/file/project_spec.rb
index 11809adcaf6..9cfc196fae2 100644
--- a/spec/lib/gitlab/ci/config/external/file/project_spec.rb
+++ b/spec/lib/gitlab/ci/config/external/file/project_spec.rb
@@ -136,7 +136,7 @@ describe Gitlab::Ci::Config::External::File::Project do
it 'should return false' do
expect(subject).not_to be_valid
- expect(subject.error_message).to include('Included file `/invalid-file` does not have YAML extension!')
+ expect(subject.error_message).to include(_('Included file `/invalid-file` does not have YAML extension!'))
end
end
end
diff --git a/spec/lib/gitlab/ci/config/external/file/template_spec.rb b/spec/lib/gitlab/ci/config/external/file/template_spec.rb
index 1fb5655309a..8583f676b46 100644
--- a/spec/lib/gitlab/ci/config/external/file/template_spec.rb
+++ b/spec/lib/gitlab/ci/config/external/file/template_spec.rb
@@ -49,7 +49,7 @@ describe Gitlab::Ci::Config::External::File::Template do
it 'should return false' do
expect(subject).not_to be_valid
- expect(subject.error_message).to include('Template file `Template.yml` is not a valid location!')
+ expect(subject.error_message).to include(_('Template file `Template.yml` is not a valid location!'))
end
end
@@ -58,7 +58,7 @@ describe Gitlab::Ci::Config::External::File::Template do
it 'should return false' do
expect(subject).not_to be_valid
- expect(subject.error_message).to include('Included file `I-Do-Not-Have-This-Template.gitlab-ci.yml` is empty or does not exist!')
+ expect(subject.error_message).to include(_('Included file `I-Do-Not-Have-This-Template.gitlab-ci.yml` is empty or does not exist!'))
end
end
end
diff --git a/spec/lib/gitlab/ci/config/external/processor_spec.rb b/spec/lib/gitlab/ci/config/external/processor_spec.rb
index 1ac58139b25..343314390e9 100644
--- a/spec/lib/gitlab/ci/config/external/processor_spec.rb
+++ b/spec/lib/gitlab/ci/config/external/processor_spec.rb
@@ -27,7 +27,7 @@ describe Gitlab::Ci::Config::External::Processor do
it 'should raise an error' do
expect { processor.perform }.to raise_error(
described_class::IncludeError,
- "Local file `/lib/gitlab/ci/templates/non-existent-file.yml` does not exist!"
+ _("Local file `/lib/gitlab/ci/templates/non-existent-file.yml` does not exist!")
)
end
end
@@ -165,7 +165,7 @@ describe Gitlab::Ci::Config::External::Processor do
it 'should raise an error' do
expect { processor.perform }.to raise_error(
described_class::IncludeError,
- "Included file `/lib/gitlab/ci/templates/template.yml` does not have valid YAML syntax!"
+ _("Included file `/lib/gitlab/ci/templates/template.yml` does not have valid YAML syntax!")
)
end
end
diff --git a/spec/lib/gitlab/ci/config_spec.rb b/spec/lib/gitlab/ci/config_spec.rb
index cd6d2a2f343..405e3625a17 100644
--- a/spec/lib/gitlab/ci/config_spec.rb
+++ b/spec/lib/gitlab/ci/config_spec.rb
@@ -202,7 +202,7 @@ describe Gitlab::Ci::Config do
it 'raises error YamlProcessor validationError' do
expect { config }.to raise_error(
described_class::ConfigError,
- "Included file `invalid` does not have YAML extension!"
+ _("Included file `invalid` does not have YAML extension!")
)
end
end
@@ -219,7 +219,7 @@ describe Gitlab::Ci::Config do
it 'raises error YamlProcessor validationError' do
expect { config }.to raise_error(
described_class::ConfigError,
- 'Include `{"remote":"http://url","local":"/local/file.yml"}` needs to match exactly one accessor!'
+ _('Include `{"remote":"http://url","local":"/local/file.yml"}` needs to match exactly one accessor!')
)
end
end
diff --git a/spec/lib/gitlab/ci/pipeline/chain/populate_spec.rb b/spec/lib/gitlab/ci/pipeline/chain/populate_spec.rb
index 3459939267a..3ada64ef11a 100644
--- a/spec/lib/gitlab/ci/pipeline/chain/populate_spec.rb
+++ b/spec/lib/gitlab/ci/pipeline/chain/populate_spec.rb
@@ -71,7 +71,7 @@ describe Gitlab::Ci::Pipeline::Chain::Populate do
it 'appends an error about missing stages' do
expect(pipeline.errors.to_a)
- .to include 'No stages / jobs for this pipeline.'
+ .to include _('No stages / jobs for this pipeline.')
end
it 'wastes pipeline iid' do
@@ -119,7 +119,7 @@ describe Gitlab::Ci::Pipeline::Chain::Populate do
it 'appends validation error' do
expect(pipeline.errors.to_a)
- .to include 'Failed to build the pipeline!'
+ .to include _('Failed to build the pipeline!')
end
it 'wastes pipeline iid' do
diff --git a/spec/lib/gitlab/cleanup/project_uploads_spec.rb b/spec/lib/gitlab/cleanup/project_uploads_spec.rb
index bf130b8fabd..cb7d6cbb27d 100644
--- a/spec/lib/gitlab/cleanup/project_uploads_spec.rb
+++ b/spec/lib/gitlab/cleanup/project_uploads_spec.rb
@@ -24,7 +24,7 @@ describe Gitlab::Cleanup::ProjectUploads do
end
it 'logs action as done' do
- expect(logger).to receive(:info).with("Looking for orphaned project uploads to clean up...")
+ expect(logger).to receive(:info).with(_("Looking for orphaned project uploads to clean up..."))
expect(logger).to receive(:info).with("Did #{action}")
subject.run!(*args)
@@ -40,7 +40,7 @@ describe Gitlab::Cleanup::ProjectUploads do
end
it 'logs action as able to be done' do
- expect(logger).to receive(:info).with("Looking for orphaned project uploads to clean up. Dry run...")
+ expect(logger).to receive(:info).with(_("Looking for orphaned project uploads to clean up. Dry run..."))
expect(logger).to receive(:info).with("Can #{action}")
subject.run!(*args)
diff --git a/spec/lib/gitlab/config/entry/attributable_spec.rb b/spec/lib/gitlab/config/entry/attributable_spec.rb
index abb4fff3ad7..e27cc8420d7 100644
--- a/spec/lib/gitlab/config/entry/attributable_spec.rb
+++ b/spec/lib/gitlab/config/entry/attributable_spec.rb
@@ -54,7 +54,7 @@ describe Gitlab::Config::Entry::Attributable do
end
end
- expectation.to raise_error(ArgumentError, 'Method already defined!')
+ expectation.to raise_error(ArgumentError, _('Method already defined!'))
end
end
end
diff --git a/spec/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_base_spec.rb b/spec/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_base_spec.rb
index 248cca25a2c..5f736ab76c8 100644
--- a/spec/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_base_spec.rb
+++ b/spec/lib/gitlab/database/rename_reserved_paths_migration/v1/rename_base_spec.rb
@@ -262,7 +262,7 @@ describe Gitlab::Database::RenameReservedPathsMigration::V1::RenameBase, :delete
subject.track_rename('project', 'old_path', 'new_path')
subject.reverts_for_type('project') do
- raise 'whatever happens, keep going!'
+ raise _('whatever happens, keep going!')
end
key = 'rename:FakeRenameReservedPathMigrationV1:project'
diff --git a/spec/lib/gitlab/email/handler/create_note_handler_spec.rb b/spec/lib/gitlab/email/handler/create_note_handler_spec.rb
index b1f48c15c21..972731281aa 100644
--- a/spec/lib/gitlab/email/handler/create_note_handler_spec.rb
+++ b/spec/lib/gitlab/email/handler/create_note_handler_spec.rb
@@ -129,7 +129,7 @@ describe Gitlab::Email::Handler::CreateNoteHandler do
expect(new_note.author).to eq(sent_notification.recipient)
expect(new_note.position).to eq(note.position)
- expect(new_note.note).to include("I could not disagree more.")
+ expect(new_note.note).to include(_("I could not disagree more."))
expect(new_note.in_reply_to?(note)).to be_truthy
end
@@ -153,7 +153,7 @@ describe Gitlab::Email::Handler::CreateNoteHandler do
expect(new_note.author).to eq(sent_notification.recipient)
expect(new_note.position).to eq(note.position)
- expect(new_note.note).to include('I could not disagree more.')
+ expect(new_note.note).to include(_('I could not disagree more.'))
end
end
diff --git a/spec/lib/gitlab/email/reply_parser_spec.rb b/spec/lib/gitlab/email/reply_parser_spec.rb
index 376d3accd55..2264006a452 100644
--- a/spec/lib/gitlab/email/reply_parser_spec.rb
+++ b/spec/lib/gitlab/email/reply_parser_spec.rb
@@ -38,7 +38,7 @@ describe Gitlab::Email::ReplyParser do
end
it "supports a Dutch reply" do
- expect(test_parse_body(fixture_file("emails/dutch.eml"))).to eq("Dit is een antwoord in het Nederlands.")
+ expect(test_parse_body(fixture_file("emails/dutch.eml"))).to eq(_("Dit is een antwoord in het Nederlands."))
end
it "removes an 'on date wrote' quoting line" do
diff --git a/spec/lib/gitlab/encoding_helper_spec.rb b/spec/lib/gitlab/encoding_helper_spec.rb
index 429816efec3..4f2642fffb6 100644
--- a/spec/lib/gitlab/encoding_helper_spec.rb
+++ b/spec/lib/gitlab/encoding_helper_spec.rb
@@ -106,8 +106,8 @@ describe Gitlab::EncodingHelper do
],
[
"encodes valid ISO-8859-1 encoded string to utf8",
- "Rüby ist eine Programmiersprache. Wir verlängern den text damit ICU die Sprache erkennen kann.".encode("ISO-8859-1", "UTF-8"),
- "Rüby ist eine Programmiersprache. Wir verlängern den text damit ICU die Sprache erkennen kann.".encode("UTF-8")
+ _("Rüby ist eine Programmiersprache. Wir verlängern den text damit ICU die Sprache erkennen kann.").encode("ISO-8859-1", "UTF-8"),
+ _("Rüby ist eine Programmiersprache. Wir verlängern den text damit ICU die Sprache erkennen kann.").encode("UTF-8")
],
[
# Test case from https://gitlab.com/gitlab-org/gitlab-ce/issues/39227
diff --git a/spec/lib/gitlab/git/repository_spec.rb b/spec/lib/gitlab/git/repository_spec.rb
index a19e3e84f83..d814009c4ba 100644
--- a/spec/lib/gitlab/git/repository_spec.rb
+++ b/spec/lib/gitlab/git/repository_spec.rb
@@ -1835,7 +1835,7 @@ describe Gitlab::Git::Repository, :seed_helper do
it 'cleans up the files' do
create_worktree = %W[git -C #{repository_path} worktree add --detach #{worktree_path} master]
- raise 'preparation failed' unless system(*create_worktree, err: '/dev/null')
+ raise _('preparation failed') unless system(*create_worktree, err: '/dev/null')
FileUtils.touch(worktree_path, mtime: Time.now - 8.hours)
# git rev-list --all will fail in git 2.16 if HEAD is pointing to a non-existent object,
diff --git a/spec/lib/gitlab/git/wraps_gitaly_errors_spec.rb b/spec/lib/gitlab/git/wraps_gitaly_errors_spec.rb
index bcf4814edb6..6846a78ec8d 100644
--- a/spec/lib/gitlab/git/wraps_gitaly_errors_spec.rb
+++ b/spec/lib/gitlab/git/wraps_gitaly_errors_spec.rb
@@ -21,7 +21,7 @@ describe Gitlab::Git::WrapsGitalyErrors do
end
it 'does not swallow other errors' do
- expect { wrapper.wrapped_gitaly_errors { raise 'raised' } }
+ expect { wrapper.wrapped_gitaly_errors { raise _('raised') } }
.to raise_error(RuntimeError)
end
end
diff --git a/spec/lib/gitlab/git_access_spec.rb b/spec/lib/gitlab/git_access_spec.rb
index 3e34dd592f2..0f9dd469e0f 100644
--- a/spec/lib/gitlab/git_access_spec.rb
+++ b/spec/lib/gitlab/git_access_spec.rb
@@ -257,8 +257,8 @@ describe Gitlab::GitAccess do
it 'does not allow keys which are too small', :aggregate_failures do
expect(actor).not_to be_valid
- expect { pull_access_check }.to raise_unauthorized('Your SSH key must be at least 4096 bits.')
- expect { push_access_check }.to raise_unauthorized('Your SSH key must be at least 4096 bits.')
+ expect { pull_access_check }.to raise_unauthorized(_('Your SSH key must be at least 4096 bits.'))
+ expect { push_access_check }.to raise_unauthorized(_('Your SSH key must be at least 4096 bits.'))
end
end
@@ -386,7 +386,7 @@ describe Gitlab::GitAccess do
end
context 'when calling git-upload-pack' do
- it { expect { pull_access_check }.to raise_unauthorized('Pulling over HTTP is not allowed.') }
+ it { expect { pull_access_check }.to raise_unauthorized(_('Pulling over HTTP is not allowed.')) }
end
context 'when calling git-receive-pack' do
@@ -400,7 +400,7 @@ describe Gitlab::GitAccess do
end
context 'when calling git-receive-pack' do
- it { expect { push_access_check }.to raise_unauthorized('Pushing over HTTP is not allowed.') }
+ it { expect { push_access_check }.to raise_unauthorized(_('Pushing over HTTP is not allowed.')) }
end
context 'when calling git-upload-pack' do
@@ -538,7 +538,7 @@ describe Gitlab::GitAccess do
project.add_maintainer(user)
user.block
- expect { pull_access_check }.to raise_unauthorized('Your account has been blocked.')
+ expect { pull_access_check }.to raise_unauthorized(_('Your account has been blocked.'))
end
context 'when the project repository does not exist' do
@@ -550,7 +550,7 @@ describe Gitlab::GitAccess do
# Sanity check for rm_rf
expect(repo.exists?).to eq(false)
- expect { pull_access_check }.to raise_error(Gitlab::GitAccess::NotFoundError, 'A repository for this project does not exist yet.')
+ expect { pull_access_check }.to raise_error(Gitlab::GitAccess::NotFoundError, _('A repository for this project does not exist yet.'))
end
end
@@ -1003,7 +1003,7 @@ describe Gitlab::GitAccess do
it 'denies push access' do
project.add_maintainer(user)
- expect { push_access_check }.to raise_unauthorized('The repository is temporarily read-only. Please try again later.')
+ expect { push_access_check }.to raise_unauthorized(_('The repository is temporarily read-only. Please try again later.'))
end
end
diff --git a/spec/lib/gitlab/git_access_wiki_spec.rb b/spec/lib/gitlab/git_access_wiki_spec.rb
index 6ba65b56618..a44426a95d5 100644
--- a/spec/lib/gitlab/git_access_wiki_spec.rb
+++ b/spec/lib/gitlab/git_access_wiki_spec.rb
@@ -31,7 +31,7 @@ describe Gitlab::GitAccessWiki do
end
it 'does not give access to upload wiki code' do
- expect { subject }.to raise_error(Gitlab::GitAccess::UnauthorizedError, "You can't push code to a read-only GitLab instance.")
+ expect { subject }.to raise_error(Gitlab::GitAccess::UnauthorizedError, _("You can't push code to a read-only GitLab instance."))
end
end
end
@@ -59,7 +59,7 @@ describe Gitlab::GitAccessWiki do
# Sanity check for rm_rf
expect(wiki_repo.exists?).to eq(false)
- expect { subject }.to raise_error(Gitlab::GitAccess::NotFoundError, 'A repository for this project does not exist yet.')
+ expect { subject }.to raise_error(Gitlab::GitAccess::NotFoundError, _('A repository for this project does not exist yet.'))
end
end
end
@@ -68,7 +68,7 @@ describe Gitlab::GitAccessWiki do
it 'does not give access to download wiki code' do
project.project_feature.update_attribute(:wiki_access_level, ProjectFeature::DISABLED)
- expect { subject }.to raise_error(Gitlab::GitAccess::UnauthorizedError, 'You are not allowed to download code from this project.')
+ expect { subject }.to raise_error(Gitlab::GitAccess::UnauthorizedError, _('You are not allowed to download code from this project.'))
end
end
end
diff --git a/spec/lib/gitlab/google_code_import/importer_spec.rb b/spec/lib/gitlab/google_code_import/importer_spec.rb
index 031f57dbc65..6b287229e9f 100644
--- a/spec/lib/gitlab/google_code_import/importer_spec.rb
+++ b/spec/lib/gitlab/google_code_import/importer_spec.rb
@@ -59,7 +59,7 @@ describe Gitlab::GoogleCodeImport::Importer do
expect(issue.description).to include("schattenpr\\.\\.\\.")
expect(issue.description).to include("November 18, 2009 00:20")
expect(issue.description).to include("Google Code")
- expect(issue.description).to include('I like to scroll through the tasks with my scrollwheel (like in fluxbox).')
+ expect(issue.description).to include(_('I like to scroll through the tasks with my scrollwheel (like in fluxbox).'))
expect(issue.description).to include('Patch is attached that adds two new mouse-actions (next_task+prev_task)')
expect(issue.description).to include('that can be used for exactly that purpose.')
expect(issue.description).to include('all the best!')
diff --git a/spec/lib/gitlab/highlight_spec.rb b/spec/lib/gitlab/highlight_spec.rb
index fe0e9702f8a..16adc2a8c2b 100644
--- a/spec/lib/gitlab/highlight_spec.rb
+++ b/spec/lib/gitlab/highlight_spec.rb
@@ -57,7 +57,7 @@ describe Gitlab::Highlight do
expect(lines.count).to eq(3)
expect(lines[0].text).to eq('"""This is line 1 of a multi-line comment.')
- expect(lines[1].text).to eq(' This is line 2.')
+ expect(lines[1].text).to eq(_(' This is line 2.'))
expect(lines[2].text).to eq(' """')
end
diff --git a/spec/lib/gitlab/i18n/po_linter_spec.rb b/spec/lib/gitlab/i18n/po_linter_spec.rb
index 3dbc23d2aaf..de56ae10f7e 100644
--- a/spec/lib/gitlab/i18n/po_linter_spec.rb
+++ b/spec/lib/gitlab/i18n/po_linter_spec.rb
@@ -49,14 +49,14 @@ describe Gitlab::I18n::PoLinter do
let(:po_path) { 'spec/fixtures/newlines.po' }
it 'has an error for a normal string' do
- message_id = "You are going to remove %{group_name}.\\nRemoved groups CANNOT be restored!\\nAre you ABSOLUTELY sure?"
+ message_id = _("You are going to remove %{group_name}.\\nRemoved groups CANNOT be restored!\\nAre you ABSOLUTELY sure?")
expected_message = "is defined over multiple lines, this breaks some tooling."
expect(errors[message_id]).to include(expected_message)
end
it 'has an error when a translation is defined over multiple lines' do
- message_id = "You are going to remove %{group_name}.\\nRemoved groups CANNOT be restored!\\nAre you ABSOLUTELY sure?"
+ message_id = _("You are going to remove %{group_name}.\\nRemoved groups CANNOT be restored!\\nAre you ABSOLUTELY sure?")
expected_message = "has translations defined over multiple lines, this breaks some tooling."
expect(errors[message_id]).to include(expected_message)
@@ -137,7 +137,7 @@ describe Gitlab::I18n::PoLinter do
let(:po_path) { 'spec/fixtures/unescaped_chars.po' }
it 'contains an error' do
- message_id = 'You are going to transfer %{project_name_with_namespace} to another owner. Are you ABSOLUTELY sure?'
+ message_id = _('You are going to transfer %{project_name_with_namespace} to another owner. Are you ABSOLUTELY sure?')
expected_error = 'translation contains unescaped `%`, escape it using `%%`'
expect(errors[message_id]).to include(expected_error)
@@ -324,7 +324,7 @@ describe Gitlab::I18n::PoLinter do
it 'adds an error message when translating fails' do
errors = []
- expect(FastGettext::Translation).to receive(:_) { raise 'broken' }
+ expect(FastGettext::Translation).to receive(:_) { raise _('broken') }
linter.validate_translation(errors, entry)
@@ -335,7 +335,7 @@ describe Gitlab::I18n::PoLinter do
entry = fake_translation(msgid: 'Tests|Hello', translation: 'broken')
errors = []
- expect(FastGettext::Translation).to receive(:s_) { raise 'broken' }
+ expect(FastGettext::Translation).to receive(:s_) { raise _('broken') }
linter.validate_translation(errors, entry)
diff --git a/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb b/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb
index 242c16c4bdc..3bacc145ddc 100644
--- a/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb
+++ b/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb
@@ -47,7 +47,7 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do
end
it 'has the project description' do
- expect(Project.find_by_path('project').description).to eq('Nisi et repellendus ut enim quo accusamus vel magnam.')
+ expect(Project.find_by_path('project').description).to eq(_('Nisi et repellendus ut enim quo accusamus vel magnam.'))
end
it 'has the same label associated to two issues' do
@@ -71,7 +71,7 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do
end
it 'preserves updated_at on issues' do
- issue = Issue.where(description: 'Aliquam enim illo et possimus.').first
+ issue = Issue.where(description: _('Aliquam enim illo et possimus.')).first
expect(issue.reload.updated_at.to_s).to eq('2016-06-14 15:02:47 UTC')
end
diff --git a/spec/lib/gitlab/legacy_github_import/importer_spec.rb b/spec/lib/gitlab/legacy_github_import/importer_spec.rb
index 6bc3792eb22..8e8e5277d0b 100644
--- a/spec/lib/gitlab/legacy_github_import/importer_spec.rb
+++ b/spec/lib/gitlab/legacy_github_import/importer_spec.rb
@@ -160,7 +160,7 @@ describe Gitlab::LegacyGithubImport::Importer do
it 'stores error messages' do
error = {
- message: 'The remote data could not be fully imported.',
+ message: _('The remote data could not be fully imported.'),
errors: [
{ type: :label, url: "#{api_root}/repos/octocat/Hello-World/labels/bug", errors: "Validation failed: Title can't be blank, Title is invalid" },
{ type: :issue, url: "#{api_root}/repos/octocat/Hello-World/issues/1348", errors: "Validation failed: Title can't be blank" },
diff --git a/spec/lib/gitlab/manifest_import/manifest_spec.rb b/spec/lib/gitlab/manifest_import/manifest_spec.rb
index ab305fb2316..b939f3bc133 100644
--- a/spec/lib/gitlab/manifest_import/manifest_spec.rb
+++ b/spec/lib/gitlab/manifest_import/manifest_spec.rb
@@ -31,8 +31,8 @@ describe Gitlab::ManifestImport::Manifest, :postgresql do
manifest.valid?
end
- it { expect(manifest.errors).to include('Make sure a <remote> tag is present and is valid.') }
- it { expect(manifest.errors).to include('Make sure every <project> tag has name and path attributes.') }
+ it { expect(manifest.errors).to include(_('Make sure a <remote> tag is present and is valid.')) }
+ it { expect(manifest.errors).to include(_('Make sure every <project> tag has name and path attributes.')) }
end
end
end
diff --git a/spec/lib/gitlab/quick_actions/dsl_spec.rb b/spec/lib/gitlab/quick_actions/dsl_spec.rb
index fd4df8694ba..7a7ee08727f 100644
--- a/spec/lib/gitlab/quick_actions/dsl_spec.rb
+++ b/spec/lib/gitlab/quick_actions/dsl_spec.rb
@@ -7,12 +7,12 @@ describe Gitlab::QuickActions::Dsl do
desc 'A command with no args'
command :no_args, :none do
- "Hello World!"
+ _("Hello World!")
end
params 'The first argument'
explanation 'Static explanation'
- warning 'Possible problem!'
+ warning _('Possible problem!')
command :explanation_with_aliases, :once, :first do |arg|
arg
end
@@ -75,7 +75,7 @@ describe Gitlab::QuickActions::Dsl do
expect(explanation_with_aliases_def.condition_block).to be_nil
expect(explanation_with_aliases_def.action_block).to be_a_kind_of(Proc)
expect(explanation_with_aliases_def.parse_params_block).to be_nil
- expect(explanation_with_aliases_def.warning).to eq('Possible problem!')
+ expect(explanation_with_aliases_def.warning).to eq(_('Possible problem!'))
expect(dynamic_description_def.name).to eq(:dynamic_description)
expect(dynamic_description_def.aliases).to eq([])
diff --git a/spec/lib/gitlab/shell_spec.rb b/spec/lib/gitlab/shell_spec.rb
index 6ce9d515a0f..6de6e139146 100644
--- a/spec/lib/gitlab/shell_spec.rb
+++ b/spec/lib/gitlab/shell_spec.rb
@@ -492,7 +492,7 @@ describe Gitlab::Shell do
it 'return false when the command fails' do
expect_any_instance_of(Gitlab::GitalyClient::RepositoryService).to receive(:fork_repository)
- .with(repository.raw_repository) { raise GRPC::BadStatus, 'bla' }
+ .with(repository.raw_repository) { raise GRPC::BadStatus, _('bla') }
is_expected.to be_falsy
end
@@ -512,7 +512,7 @@ describe Gitlab::Shell do
it 'raises an exception when the command fails' do
expect_any_instance_of(Gitlab::GitalyClient::RepositoryService).to receive(:import_repository)
- .with(import_url) { raise GRPC::BadStatus, 'bla' }
+ .with(import_url) { raise GRPC::BadStatus, _('bla') }
expect_any_instance_of(Gitlab::Shell::GitalyGitlabProjects).to receive(:output) { 'error'}
expect do
diff --git a/spec/lib/gitlab/sidekiq_logging/structured_logger_spec.rb b/spec/lib/gitlab/sidekiq_logging/structured_logger_spec.rb
index a9d15f1d522..7c095213b30 100644
--- a/spec/lib/gitlab/sidekiq_logging/structured_logger_spec.rb
+++ b/spec/lib/gitlab/sidekiq_logging/structured_logger_spec.rb
@@ -77,7 +77,7 @@ describe Gitlab::SidekiqLogging::StructuredLogger do
expect do
subject.call(job, 'test_queue') do
- raise ArgumentError, 'some exception'
+ raise ArgumentError, _('some exception')
end
end.to raise_error(ArgumentError)
end
diff --git a/spec/lib/mattermost/command_spec.rb b/spec/lib/mattermost/command_spec.rb
index 7c194749dfb..d9e4f05b682 100644
--- a/spec/lib/mattermost/command_spec.rb
+++ b/spec/lib/mattermost/command_spec.rb
@@ -46,7 +46,7 @@ describe Mattermost::Command do
headers: { 'Content-Type' => 'application/json' },
body: {
id: 'api.command.duplicate_trigger.app_error',
- message: 'This trigger word is already in use. Please choose another word.',
+ message: _('This trigger word is already in use. Please choose another word.'),
detailed_error: '',
request_id: 'obc374man7bx5r3dbc1q5qhf3r',
status_code: 400
@@ -55,7 +55,7 @@ describe Mattermost::Command do
end
it 'raises an error with message' do
- expect { subject }.to raise_error(Mattermost::Error, 'This trigger word is already in use. Please choose another word.')
+ expect { subject }.to raise_error(Mattermost::Error, _('This trigger word is already in use. Please choose another word.'))
end
end
end
diff --git a/spec/lib/mattermost/team_spec.rb b/spec/lib/mattermost/team_spec.rb
index 030aa5d06a8..096b7df88a4 100644
--- a/spec/lib/mattermost/team_spec.rb
+++ b/spec/lib/mattermost/team_spec.rb
@@ -54,7 +54,7 @@ describe Mattermost::Team do
headers: { 'Content-Type' => 'application/json' },
body: {
id: 'api.team.list.app_error',
- message: 'Cannot list teams.',
+ message: _('Cannot list teams.'),
detailed_error: '',
request_id: 'obc374man7bx5r3dbc1q5qhf3r',
status_code: 500
@@ -63,7 +63,7 @@ describe Mattermost::Team do
end
it 'raises an error with message' do
- expect { subject }.to raise_error(Mattermost::Error, 'Cannot list teams.')
+ expect { subject }.to raise_error(Mattermost::Error, _('Cannot list teams.'))
end
end
end
diff --git a/spec/lib/system_check/simple_executor_spec.rb b/spec/lib/system_check/simple_executor_spec.rb
index e71e9da369d..403c6a4e0e4 100644
--- a/spec/lib/system_check/simple_executor_spec.rb
+++ b/spec/lib/system_check/simple_executor_spec.rb
@@ -31,7 +31,7 @@ describe SystemCheck::SimpleExecutor do
end
def check?
- raise 'should not execute this'
+ raise _('should not execute this')
end
end
@@ -45,7 +45,7 @@ describe SystemCheck::SimpleExecutor do
end
def check?
- raise 'should not execute this'
+ raise _('should not execute this')
end
end
@@ -57,7 +57,7 @@ describe SystemCheck::SimpleExecutor do
end
def check?
- raise 'should not execute this'
+ raise _('should not execute this')
end
end
@@ -69,7 +69,7 @@ describe SystemCheck::SimpleExecutor do
end
def multi_check
- raise 'should not execute this'
+ raise _('should not execute this')
end
end
@@ -94,7 +94,7 @@ describe SystemCheck::SimpleExecutor do
set_name 'my bugous check'
def check?
- raise CustomError, 'omg'
+ raise CustomError, _('omg')
end
end
diff --git a/spec/mailers/notify_spec.rb b/spec/mailers/notify_spec.rb
index f2d99872401..3480dc2bcf3 100644
--- a/spec/mailers/notify_spec.rb
+++ b/spec/mailers/notify_spec.rb
@@ -25,7 +25,7 @@ describe Notify do
create(:issue, author: current_user,
assignees: [assignee],
project: project,
- description: 'My awesome description!')
+ description: _('My awesome description!'))
end
context 'for a project' do
diff --git a/spec/models/commit_spec.rb b/spec/models/commit_spec.rb
index a2d2d77746d..02a5db46f6c 100644
--- a/spec/models/commit_spec.rb
+++ b/spec/models/commit_spec.rb
@@ -201,10 +201,10 @@ describe Commit do
end
it 'truncates a message without a newline at natural break to 80 characters' do
- message = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sodales id felis id blandit. Vivamus egestas lacinia lacus, sed rutrum mauris.'
+ message = _('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sodales id felis id blandit. Vivamus egestas lacinia lacus, sed rutrum mauris.')
allow(commit).to receive(:safe_message).and_return(message)
- expect(commit.title).to eq('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sodales id...')
+ expect(commit.title).to eq(_('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sodales id...'))
end
it "truncates a message with a newline before 80 characters at the newline" do
@@ -232,7 +232,7 @@ eos
end
it "returns entire message if there is no newline" do
- message = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sodales id felis id blandit. Vivamus egestas lacinia lacus, sed rutrum mauris.'
+ message = _('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sodales id felis id blandit. Vivamus egestas lacinia lacus, sed rutrum mauris.')
allow(commit).to receive(:safe_message).and_return(message)
expect(commit.full_title).to eq(message)
@@ -260,7 +260,7 @@ Vivamus egestas lacinia lacus, sed rutrum mauris.
eos
allow(commit).to receive(:safe_message).and_return(message)
- expect(commit.description).to eq('Vivamus egestas lacinia lacus, sed rutrum mauris.')
+ expect(commit.description).to eq(_('Vivamus egestas lacinia lacus, sed rutrum mauris.'))
end
it 'returns full commit message if commit title more than 100 characters' do
diff --git a/spec/models/concerns/prometheus_adapter_spec.rb b/spec/models/concerns/prometheus_adapter_spec.rb
index f4b9c57e71a..a84bbc0ed39 100644
--- a/spec/models/concerns/prometheus_adapter_spec.rb
+++ b/spec/models/concerns/prometheus_adapter_spec.rb
@@ -111,7 +111,7 @@ describe PrometheusAdapter, :use_clean_rails_memory_store_caching do
[404, 500].each do |status|
context "when Prometheus responds with #{status}" do
before do
- stub_all_prometheus_requests(environment.slug, status: status, body: "QUERY FAILED!")
+ stub_all_prometheus_requests(environment.slug, status: status, body: _("QUERY FAILED!"))
end
it { is_expected.to eq(success: false, result: %(#{status} - "QUERY FAILED!")) }
diff --git a/spec/models/concerns/reactive_caching_spec.rb b/spec/models/concerns/reactive_caching_spec.rb
index 97a4c212f1c..9b2736fd9a1 100644
--- a/spec/models/concerns/reactive_caching_spec.rb
+++ b/spec/models/concerns/reactive_caching_spec.rb
@@ -145,7 +145,7 @@ describe ReactiveCaching, :use_clean_rails_memory_store_caching do
stub_reactive_cache(instance, "preexisting")
end
- let(:calculation) { -> { raise "foo"} }
+ let(:calculation) { -> { raise _("foo")} }
it 'leaves the cache untouched' do
expect { go! }.to raise_error("foo")
diff --git a/spec/models/concerns/spammable_spec.rb b/spec/models/concerns/spammable_spec.rb
index e698207166c..c6d56413622 100644
--- a/spec/models/concerns/spammable_spec.rb
+++ b/spec/models/concerns/spammable_spec.rb
@@ -1,7 +1,7 @@
require 'spec_helper'
describe Spammable do
- let(:issue) { create(:issue, description: 'Test Desc.') }
+ let(:issue) { create(:issue, description: _('Test Desc.')) }
describe 'Associations' do
subject { build(:issue) }
diff --git a/spec/models/milestone_spec.rb b/spec/models/milestone_spec.rb
index 2e436f2cc8a..f42b27d1da3 100644
--- a/spec/models/milestone_spec.rb
+++ b/spec/models/milestone_spec.rb
@@ -396,7 +396,7 @@ describe Milestone do
it 'raises an error when using iid format' do
expect { milestone.to_reference(format: :iid) }
- .to raise_error(ArgumentError, 'Cannot refer to a group milestone by an internal id!')
+ .to raise_error(ArgumentError, _('Cannot refer to a group milestone by an internal id!'))
end
end
end
diff --git a/spec/models/project_label_spec.rb b/spec/models/project_label_spec.rb
index 689d4e505e5..4a93356701c 100644
--- a/spec/models/project_label_spec.rb
+++ b/spec/models/project_label_spec.rb
@@ -44,7 +44,7 @@ describe ProjectLabel do
it 'does not returns error when title does not change' do
project_label = create(:label, project: project, name: 'Security')
create(:group_label, group: group, name: 'Security')
- project_label.description = 'Security related stuff.'
+ project_label.description = _('Security related stuff.')
project_label.valid?
diff --git a/spec/models/project_services/bamboo_service_spec.rb b/spec/models/project_services/bamboo_service_spec.rb
index ee84fa95f0e..44432a662a9 100644
--- a/spec/models/project_services/bamboo_service_spec.rb
+++ b/spec/models/project_services/bamboo_service_spec.rb
@@ -199,25 +199,25 @@ describe BambooService, :use_clean_rails_memory_store_caching do
end
it 'sets commit status to "success" when build state contains Success' do
- stub_request(body: bamboo_response(build_state: 'YAY Success!'))
+ stub_request(body: bamboo_response(build_state: _('YAY Success!')))
is_expected.to eq('success')
end
it 'sets commit status to "failed" when build state contains Failed' do
- stub_request(body: bamboo_response(build_state: 'NO Failed!'))
+ stub_request(body: bamboo_response(build_state: _('NO Failed!')))
is_expected.to eq('failed')
end
it 'sets commit status to "pending" when build state contains Pending' do
- stub_request(body: bamboo_response(build_state: 'NO Pending!'))
+ stub_request(body: bamboo_response(build_state: _('NO Pending!')))
is_expected.to eq('pending')
end
it 'sets commit status to :error when build state is unknown' do
- stub_request(body: bamboo_response(build_state: 'FOO BAR!'))
+ stub_request(body: bamboo_response(build_state: _('FOO BAR!')))
is_expected.to eq(:error)
end
diff --git a/spec/models/project_services/jira_service_spec.rb b/spec/models/project_services/jira_service_spec.rb
index 788b3179b01..81f08190e0f 100644
--- a/spec/models/project_services/jira_service_spec.rb
+++ b/spec/models/project_services/jira_service_spec.rb
@@ -327,9 +327,9 @@ describe JiraService do
it 'returns result with the error' do
test_url = 'http://jira.example.com/rest/api/2/serverInfo'
WebMock.stub_request(:get, test_url).with(basic_auth: %w(jira_username jira_password))
- .to_raise(JIRA::HTTPError.new(double(message: 'Some specific failure.')))
+ .to_raise(JIRA::HTTPError.new(double(message: _('Some specific failure.'))))
- expect(jira_service.test(nil)).to eq( { success: false, result: 'Some specific failure.' })
+ expect(jira_service.test(nil)).to eq( { success: false, result: _('Some specific failure.') })
end
end
end
diff --git a/spec/models/project_services/mattermost_slash_commands_service_spec.rb b/spec/models/project_services/mattermost_slash_commands_service_spec.rb
index 1983e0cc967..ef2eff0c3e3 100644
--- a/spec/models/project_services/mattermost_slash_commands_service_spec.rb
+++ b/spec/models/project_services/mattermost_slash_commands_service_spec.rb
@@ -65,7 +65,7 @@ describe MattermostSlashCommandsService do
headers: { 'Content-Type' => 'application/json' },
body: {
id: 'api.command.duplicate_trigger.app_error',
- message: 'This trigger word is already in use. Please choose another word.',
+ message: _('This trigger word is already in use. Please choose another word.'),
detailed_error: '',
request_id: 'obc374man7bx5r3dbc1q5qhf3r',
status_code: 500
@@ -77,7 +77,7 @@ describe MattermostSlashCommandsService do
succeeded, message = subject
expect(succeeded).to be(false)
- expect(message).to eq('This trigger word is already in use. Please choose another word.')
+ expect(message).to eq(_('This trigger word is already in use. Please choose another word.'))
end
end
end
@@ -109,13 +109,13 @@ describe MattermostSlashCommandsService do
status: 500,
headers: { 'Content-Type' => 'application/json' },
body: {
- message: 'Failed to get team list.'
+ message: _('Failed to get team list.')
}.to_json
)
end
it 'shows error messages' do
- expect(subject).to eq([[], "Failed to get team list."])
+ expect(subject).to eq([[], _("Failed to get team list.")])
end
end
end
diff --git a/spec/models/project_services/teamcity_service_spec.rb b/spec/models/project_services/teamcity_service_spec.rb
index 64b4efca43a..c01608ab4f6 100644
--- a/spec/models/project_services/teamcity_service_spec.rb
+++ b/spec/models/project_services/teamcity_service_spec.rb
@@ -179,25 +179,25 @@ describe TeamcityService, :use_clean_rails_memory_store_caching do
end
it 'sets commit status to "success" when build status contains SUCCESS' do
- stub_request(build_status: 'YAY SUCCESS!')
+ stub_request(build_status: _('YAY SUCCESS!'))
is_expected.to eq('success')
end
it 'sets commit status to "failed" when build status contains FAILURE' do
- stub_request(build_status: 'NO FAILURE!')
+ stub_request(build_status: _('NO FAILURE!'))
is_expected.to eq('failed')
end
it 'sets commit status to "pending" when build status contains Pending' do
- stub_request(build_status: 'NO Pending!')
+ stub_request(build_status: _('NO Pending!'))
is_expected.to eq('pending')
end
it 'sets commit status to :error when build status is unknown' do
- stub_request(build_status: 'FOO BAR!')
+ stub_request(build_status: _('FOO BAR!'))
is_expected.to eq(:error)
end
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb
index 7a8dc59039e..a4664a714ec 100644
--- a/spec/models/project_spec.rb
+++ b/spec/models/project_spec.rb
@@ -366,7 +366,7 @@ describe Project do
end
it 'contains errors related to the project being deleted' do
- expect(new_project.errors.full_messages.first).to eq('The project is still being deleted. Please try again later.')
+ expect(new_project.errors.full_messages.first).to eq(_('The project is still being deleted. Please try again later.'))
end
end
diff --git a/spec/models/repository_spec.rb b/spec/models/repository_spec.rb
index ac5874fd0f7..6af5082019f 100644
--- a/spec/models/repository_spec.rb
+++ b/spec/models/repository_spec.rb
@@ -650,7 +650,7 @@ describe Repository do
context "when an author is specified" do
it "uses the given email/name to set the commit's author" do
expect do
- repository.update_file(user, 'README', 'Updated README!',
+ repository.update_file(user, 'README', _('Updated README!'),
branch_name: 'master',
previous_path: 'README',
message: 'Update README',
@@ -926,7 +926,7 @@ describe Repository do
end
it 'returns nil when the content is not recognizable' do
- repository.create_file(user, 'LICENSE', 'Gitlab B.V.',
+ repository.create_file(user, 'LICENSE', _('Gitlab B.V.'),
message: 'Add LICENSE', branch_name: 'master')
expect(repository.license_key).to be_nil
@@ -970,7 +970,7 @@ describe Repository do
end
it 'returns nil when the content is not recognizable' do
- repository.create_file(user, 'LICENSE', 'Gitlab B.V.',
+ repository.create_file(user, 'LICENSE', _('Gitlab B.V.'),
message: 'Add LICENSE', branch_name: 'master')
expect(repository.license).to be_nil
diff --git a/spec/requests/api/files_spec.rb b/spec/requests/api/files_spec.rb
index 9b32dc78274..616c3d87028 100644
--- a/spec/requests/api/files_spec.rb
+++ b/spec/requests/api/files_spec.rb
@@ -472,7 +472,7 @@ describe API::Files do
put api(route(file_path), user), params: params_with_stale_id
expect(response).to have_gitlab_http_status(400)
- expect(json_response['message']).to eq('You are attempting to update a file that has changed since you started editing it.')
+ expect(json_response['message']).to eq(_('You are attempting to update a file that has changed since you started editing it.'))
end
it "updates existing file in project repo with accepts correct last commit id" do
diff --git a/spec/requests/api/helpers_spec.rb b/spec/requests/api/helpers_spec.rb
index a0c64d295c0..0cf1e754d87 100644
--- a/spec/requests/api/helpers_spec.rb
+++ b/spec/requests/api/helpers_spec.rb
@@ -264,7 +264,7 @@ describe API::Helpers do
# We need to stub at a lower level than #sentry_enabled? otherwise
# Sentry is not enabled when the request below is made, and the test
# would pass even without the fix
- expect(ProjectsFinder).to receive(:new).and_raise('Runtime Error!')
+ expect(ProjectsFinder).to receive(:new).and_raise(_('Runtime Error!'))
get api('/projects', personal_access_token: token)
@@ -281,7 +281,7 @@ describe API::Helpers do
let(:event_data) { Raven.client.transport.events.first[1] }
it 'sends the params, excluding confidential values' do
- expect(ProjectsFinder).to receive(:new).and_raise('Runtime Error!')
+ expect(ProjectsFinder).to receive(:new).and_raise(_('Runtime Error!'))
get api('/projects', user), params: { password: 'dont_send_this', other_param: 'send_this' }
diff --git a/spec/requests/api/issues_spec.rb b/spec/requests/api/issues_spec.rb
index ba7930f6c9d..6b478451f7d 100644
--- a/spec/requests/api/issues_spec.rb
+++ b/spec/requests/api/issues_spec.rb
@@ -1588,7 +1588,7 @@ describe API::Issues do
params: { to_project_id: project.id }
expect(response).to have_gitlab_http_status(400)
- expect(json_response['message']).to eq('Cannot move issue to project it originates from!')
+ expect(json_response['message']).to eq(_('Cannot move issue to project it originates from!'))
end
end
@@ -1598,7 +1598,7 @@ describe API::Issues do
params: { to_project_id: target_project2.id }
expect(response).to have_gitlab_http_status(400)
- expect(json_response['message']).to eq('Cannot move issue due to insufficient permissions!')
+ expect(json_response['message']).to eq(_('Cannot move issue due to insufficient permissions!'))
end
end
diff --git a/spec/requests/api/markdown_spec.rb b/spec/requests/api/markdown_spec.rb
index e82ef002d32..3f73f0054e8 100644
--- a/spec/requests/api/markdown_spec.rb
+++ b/spec/requests/api/markdown_spec.rb
@@ -41,7 +41,7 @@ describe API::Markdown do
end
context "when project is not found" do
- let(:params) { { text: "Hello world!", gfm: true, project: "Dummy project" } }
+ let(:params) { { text: _("Hello world!"), gfm: true, project: "Dummy project" } }
it_behaves_like "404 Project Not Found"
end
@@ -82,7 +82,7 @@ describe API::Markdown do
expect(response).to have_http_status(201)
expect(response.headers["Content-Type"]).to eq("application/json")
expect(json_response).to be_a(Hash)
- expect(json_response["html"]).to include("Hello world!")
+ expect(json_response["html"]).to include(_("Hello world!"))
.and include('data-name="tada"')
.and include('data-name="100"')
.and include("#1")
@@ -99,7 +99,7 @@ describe API::Markdown do
expect(response).to have_http_status(201)
expect(response.headers["Content-Type"]).to eq("application/json")
expect(json_response).to be_a(Hash)
- expect(json_response["html"]).to include("Hello world!")
+ expect(json_response["html"]).to include(_("Hello world!"))
.and include('data-name="tada"')
.and include('data-name="100"')
.and include("<a href=\"#{IssuesHelper.url_for_issue(issue.iid, project)}\"")
@@ -119,7 +119,7 @@ describe API::Markdown do
expect(response).to have_http_status(201)
expect(json_response["html"]).not_to include('Confidential title')
expect(json_response["html"]).not_to include('<a href=')
- expect(json_response["html"]).to include('Hello world!')
+ expect(json_response["html"]).to include(_('Hello world!'))
.and include('data-name="tada"')
.and include('data-name="100"')
.and include('#1</p>')
@@ -144,7 +144,7 @@ describe API::Markdown do
it 'renders the title or link' do
expect(response).to have_http_status(201)
expect(json_response["html"]).to include('Confidential title')
- expect(json_response["html"]).to include('Hello world!')
+ expect(json_response["html"]).to include(_('Hello world!'))
.and include('data-name="tada"')
.and include('data-name="100"')
.and include("<a href=\"#{IssuesHelper.url_for_issue(confidential_issue.iid, public_project)}\"")
diff --git a/spec/requests/api/releases_spec.rb b/spec/requests/api/releases_spec.rb
index 811e23fb854..1b8d59feecf 100644
--- a/spec/requests/api/releases_spec.rb
+++ b/spec/requests/api/releases_spec.rb
@@ -437,7 +437,7 @@ describe API::Releases do
end
describe 'PUT /projects/:id/releases/:tag_name' do
- let(:params) { { description: 'Best release ever!' } }
+ let(:params) { { description: _('Best release ever!') } }
let!(:release) do
create(:release,
@@ -456,7 +456,7 @@ describe API::Releases do
it 'updates the description' do
put api("/projects/#{project.id}/releases/v0.1", maintainer), params: params
- expect(project.releases.last.description).to eq('Best release ever!')
+ expect(project.releases.last.description).to eq(_('Best release ever!'))
end
it 'does not change other attributes' do
diff --git a/spec/requests/api/settings_spec.rb b/spec/requests/api/settings_spec.rb
index 45fb1562e84..9a7249ac136 100644
--- a/spec/requests/api/settings_spec.rb
+++ b/spec/requests/api/settings_spec.rb
@@ -60,7 +60,7 @@ describe API::Settings, 'Settings' do
ecdsa_key_restriction: 384,
ed25519_key_restriction: 256,
enforce_terms: true,
- terms: 'Hello world!',
+ terms: _('Hello world!'),
performance_bar_allowed_group_path: group.full_path,
instance_statistics_visibility_private: true,
diff_max_patch_bytes: 150_000,
@@ -85,7 +85,7 @@ describe API::Settings, 'Settings' do
expect(json_response['ecdsa_key_restriction']).to eq(384)
expect(json_response['ed25519_key_restriction']).to eq(256)
expect(json_response['enforce_terms']).to be(true)
- expect(json_response['terms']).to eq('Hello world!')
+ expect(json_response['terms']).to eq(_('Hello world!'))
expect(json_response['performance_bar_allowed_group_id']).to eq(group.id)
expect(json_response['instance_statistics_visibility_private']).to be(true)
expect(json_response['diff_max_patch_bytes']).to eq(150_000)
diff --git a/spec/requests/api/tags_spec.rb b/spec/requests/api/tags_spec.rb
index fffe878ddbd..63431d78fc9 100644
--- a/spec/requests/api/tags_spec.rb
+++ b/spec/requests/api/tags_spec.rb
@@ -117,7 +117,7 @@ describe API::Tags do
end
context 'with releases' do
- let(:description) { 'Awesome release!' }
+ let(:description) { _('Awesome release!') }
let!(:release) do
create(:release,
@@ -371,7 +371,7 @@ describe API::Tags do
describe 'POST /projects/:id/repository/tags/:tag_name/release' do
let(:route) { "/projects/#{project_id}/repository/tags/#{tag_name}/release" }
- let(:description) { 'Awesome release!' }
+ let(:description) { _('Awesome release!') }
shared_examples_for 'repository new release' do
it 'creates description for existing git tag' do
@@ -427,8 +427,8 @@ describe API::Tags do
describe 'PUT id/repository/tags/:tag_name/release' do
let(:route) { "/projects/#{project_id}/repository/tags/#{tag_name}/release" }
- let(:description) { 'Awesome release!' }
- let(:new_description) { 'The best release!' }
+ let(:description) { _('Awesome release!') }
+ let(:new_description) { _('The best release!') }
shared_examples_for 'repository update release' do
context 'on tag with existing release' do
diff --git a/spec/requests/git_http_spec.rb b/spec/requests/git_http_spec.rb
index 5b625fd47be..6588b142787 100644
--- a/spec/requests/git_http_spec.rb
+++ b/spec/requests/git_http_spec.rb
@@ -302,7 +302,7 @@ describe 'Git HTTP requests' do
it 'rejects pushes with 403 Forbidden' do
upload(path, env) do |response|
expect(response).to have_gitlab_http_status(:forbidden)
- expect(response.body).to eq('You are not allowed to push code to this project.')
+ expect(response.body).to eq(_('You are not allowed to push code to this project.'))
end
end
diff --git a/spec/requests/lfs_http_spec.rb b/spec/requests/lfs_http_spec.rb
index f1514e90eb2..1727da0eeb7 100644
--- a/spec/requests/lfs_http_spec.rb
+++ b/spec/requests/lfs_http_spec.rb
@@ -42,7 +42,7 @@ describe 'Git LFS API and storage' do
it 'responds with 501' do
expect(response).to have_gitlab_http_status(501)
- expect(json_response).to include('message' => 'Git LFS is not enabled on this GitLab server, contact your admin.')
+ expect(json_response).to include('message' => _('Git LFS is not enabled on this GitLab server, contact your admin.'))
end
end
@@ -119,14 +119,14 @@ describe 'Git LFS API and storage' do
post_lfs_json "#{project.http_url_to_repo}/info/lfs/objects/batch", body, headers
expect(response).to have_gitlab_http_status(403)
- expect(json_response).to include('message' => 'Access forbidden. Check your access level.')
+ expect(json_response).to include('message' => _('Access forbidden. Check your access level.'))
end
it 'responds with a 403 message on download' do
get "#{project.http_url_to_repo}/gitlab-lfs/objects/#{sample_oid}", params: {}, headers: headers
expect(response).to have_gitlab_http_status(403)
- expect(json_response).to include('message' => 'Access forbidden. Check your access level.')
+ expect(json_response).to include('message' => _('Access forbidden. Check your access level.'))
end
end
@@ -164,7 +164,7 @@ describe 'Git LFS API and storage' do
end
it 'returns deprecated message' do
- expect(json_response).to include('message' => 'Server supports batch API only, please update your Git LFS client to version 1.0.1 and up.')
+ expect(json_response).to include('message' => _('Server supports batch API only, please update your Git LFS client to version 1.0.1 and up.'))
end
end
@@ -922,7 +922,7 @@ describe 'Git LFS API and storage' do
post_lfs_json path, body.merge('operation' => 'upload'), headers
expect(response).to have_gitlab_http_status(403)
- expect(json_response).to include('message' => 'You cannot write to this read-only GitLab instance.')
+ expect(json_response).to include('message' => _('You cannot write to this read-only GitLab instance.'))
end
end
diff --git a/spec/serializers/analytics_issue_entity_spec.rb b/spec/serializers/analytics_issue_entity_spec.rb
index 89588b4df2b..740a936b96d 100644
--- a/spec/serializers/analytics_issue_entity_spec.rb
+++ b/spec/serializers/analytics_issue_entity_spec.rb
@@ -5,7 +5,7 @@ describe AnalyticsIssueEntity do
let(:entity_hash) do
{
total_time: "172802.724419",
- title: "Eos voluptatem inventore in sed.",
+ title: _("Eos voluptatem inventore in sed."),
iid: "1",
id: "1",
created_at: "2016-11-12 15:04:02.948604",
diff --git a/spec/serializers/analytics_issue_serializer_spec.rb b/spec/serializers/analytics_issue_serializer_spec.rb
index 5befc28f4fa..7ee1e32740a 100644
--- a/spec/serializers/analytics_issue_serializer_spec.rb
+++ b/spec/serializers/analytics_issue_serializer_spec.rb
@@ -12,7 +12,7 @@ describe AnalyticsIssueSerializer do
let(:resource) do
{
total_time: "172802.724419",
- title: "Eos voluptatem inventore in sed.",
+ title: _("Eos voluptatem inventore in sed."),
iid: "1",
id: "1",
created_at: "2016-11-12 15:04:02.948604",
diff --git a/spec/serializers/analytics_merge_request_serializer_spec.rb b/spec/serializers/analytics_merge_request_serializer_spec.rb
index 62067cc0ef2..4c47ef3fd40 100644
--- a/spec/serializers/analytics_merge_request_serializer_spec.rb
+++ b/spec/serializers/analytics_merge_request_serializer_spec.rb
@@ -12,7 +12,7 @@ describe AnalyticsMergeRequestSerializer do
let(:resource) do
{
total_time: "172802.724419",
- title: "Eos voluptatem inventore in sed.",
+ title: _("Eos voluptatem inventore in sed."),
iid: "1",
id: "1",
state: 'open',
diff --git a/spec/services/application_settings/update_service_spec.rb b/spec/services/application_settings/update_service_spec.rb
index daf5dfba6b1..b4d1872f324 100644
--- a/spec/services/application_settings/update_service_spec.rb
+++ b/spec/services/application_settings/update_service_spec.rb
@@ -32,7 +32,7 @@ describe ApplicationSettings::UpdateService do
end
it 'does not create terms if they are the same as the existing ones' do
- create(:term, terms: 'Be nice!')
+ create(:term, terms: _('Be nice!'))
expect { subject.execute }.not_to change { ApplicationSetting::Term.count }
end
@@ -42,7 +42,7 @@ describe ApplicationSettings::UpdateService do
subject.execute
- expect(application_settings.terms).to eq('Be nice!')
+ expect(application_settings.terms).to eq(_('Be nice!'))
end
it 'Only queries once when the terms are changed' do
@@ -51,7 +51,7 @@ describe ApplicationSettings::UpdateService do
subject.execute
- expect(application_settings.terms).to eq('Be nice!')
+ expect(application_settings.terms).to eq(_('Be nice!'))
expect { 2.times { application_settings.terms } }
.not_to exceed_query_limit(0)
end
diff --git a/spec/services/ci/create_pipeline_service_spec.rb b/spec/services/ci/create_pipeline_service_spec.rb
index 8497e90bd8b..304d7dc4d7c 100644
--- a/spec/services/ci/create_pipeline_service_spec.rb
+++ b/spec/services/ci/create_pipeline_service_spec.rb
@@ -768,7 +768,7 @@ describe Ci::CreatePipelineService do
it 'does not create a merge request pipeline' do
expect(pipeline).not_to be_persisted
- expect(pipeline.errors[:base]).to eq(["No stages / jobs for this pipeline."])
+ expect(pipeline.errors[:base]).to eq([_("No stages / jobs for this pipeline.")])
end
end
end
@@ -814,7 +814,7 @@ describe Ci::CreatePipelineService do
expect(pipeline).not_to be_persisted
expect(pipeline.errors[:base])
- .to eq(['No stages / jobs for this pipeline.'])
+ .to eq([_('No stages / jobs for this pipeline.')])
end
end
@@ -825,7 +825,7 @@ describe Ci::CreatePipelineService do
expect(pipeline).not_to be_persisted
expect(pipeline.errors[:base])
- .to eq(['No stages / jobs for this pipeline.'])
+ .to eq([_('No stages / jobs for this pipeline.')])
end
end
end
@@ -854,7 +854,7 @@ describe Ci::CreatePipelineService do
expect(pipeline).not_to be_persisted
expect(pipeline.errors[:base])
- .to eq(['No stages / jobs for this pipeline.'])
+ .to eq([_('No stages / jobs for this pipeline.')])
end
end
end
@@ -885,7 +885,7 @@ describe Ci::CreatePipelineService do
expect(pipeline).not_to be_persisted
expect(pipeline.errors[:base])
- .to eq(['No stages / jobs for this pipeline.'])
+ .to eq([_('No stages / jobs for this pipeline.')])
end
end
end
@@ -914,7 +914,7 @@ describe Ci::CreatePipelineService do
expect(pipeline).not_to be_persisted
expect(pipeline.errors[:base])
- .to eq(['No stages / jobs for this pipeline.'])
+ .to eq([_('No stages / jobs for this pipeline.')])
end
end
end
diff --git a/spec/services/clusters/applications/check_installation_progress_service_spec.rb b/spec/services/clusters/applications/check_installation_progress_service_spec.rb
index 45b8ce94815..1b0a32a1751 100644
--- a/spec/services/clusters/applications/check_installation_progress_service_spec.rb
+++ b/spec/services/clusters/applications/check_installation_progress_service_spec.rb
@@ -37,7 +37,7 @@ describe Clusters::Applications::CheckInstallationProgressService do
service.execute
expect(application).to be_errored
- expect(application.status_reason).to eq("Installation timed out. Check pod logs for install-helm for more details.")
+ expect(application.status_reason).to eq(_("Installation timed out. Check pod logs for install-helm for more details."))
end
end
end
@@ -84,7 +84,7 @@ describe Clusters::Applications::CheckInstallationProgressService do
service.execute
expect(application).to be_errored
- expect(application.status_reason).to eq("Installation failed. Check pod logs for install-helm for more details.")
+ expect(application.status_reason).to eq(_("Installation failed. Check pod logs for install-helm for more details."))
end
end
diff --git a/spec/services/files/delete_service_spec.rb b/spec/services/files/delete_service_spec.rb
index 309802ce733..974f803f31e 100644
--- a/spec/services/files/delete_service_spec.rb
+++ b/spec/services/files/delete_service_spec.rb
@@ -56,7 +56,7 @@ describe Files::DeleteService do
it "returns a hash with the correct error message and a :error status " do
expect { subject.execute }
.to raise_error(Files::UpdateService::FileChangedError,
- "You are attempting to delete a file that has been previously updated.")
+ _("You are attempting to delete a file that has been previously updated."))
end
end
diff --git a/spec/services/files/update_service_spec.rb b/spec/services/files/update_service_spec.rb
index 23db35c2418..be30ea142a9 100644
--- a/spec/services/files/update_service_spec.rb
+++ b/spec/services/files/update_service_spec.rb
@@ -35,7 +35,7 @@ describe Files::UpdateService do
it "returns a hash with the correct error message and a :error status " do
expect { subject.execute }
.to raise_error(Files::UpdateService::FileChangedError,
- "You are attempting to update a file that has changed since you started editing it.")
+ _("You are attempting to update a file that has changed since you started editing it."))
end
end
diff --git a/spec/services/groups/create_service_spec.rb b/spec/services/groups/create_service_spec.rb
index fe6a8691ae0..74250bb60da 100644
--- a/spec/services/groups/create_service_spec.rb
+++ b/spec/services/groups/create_service_spec.rb
@@ -58,7 +58,7 @@ describe Groups::CreateService, '#execute' do
allow(Group).to receive(:supports_nested_objects?).and_return(false)
is_expected.not_to be_persisted
- expect(subject.errors[:parent_id]).to include('You don’t have permission to create a subgroup in this group.')
+ expect(subject.errors[:parent_id]).to include(_('You don’t have permission to create a subgroup in this group.'))
expect(subject.parent_id).to be_nil
end
end
@@ -73,7 +73,7 @@ describe Groups::CreateService, '#execute' do
it 'does not save group and returns an error' do
is_expected.not_to be_persisted
- expect(subject.errors[:parent_id].first).to eq('You don’t have permission to create a subgroup in this group.')
+ expect(subject.errors[:parent_id].first).to eq(_('You don’t have permission to create a subgroup in this group.'))
expect(subject.parent_id).to be_nil
end
end
diff --git a/spec/services/groups/transfer_service_spec.rb b/spec/services/groups/transfer_service_spec.rb
index 6b48c993c57..5567277d27e 100644
--- a/spec/services/groups/transfer_service_spec.rb
+++ b/spec/services/groups/transfer_service_spec.rb
@@ -18,7 +18,7 @@ describe Groups::TransferService, :postgresql do
it 'should add an error on group' do
transfer_service.execute(new_parent_group)
- expect(transfer_service.error).to eq('Transfer failed: Database is not supported.')
+ expect(transfer_service.error).to eq(_('Transfer failed: Database is not supported.'))
end
end
@@ -52,7 +52,7 @@ describe Groups::TransferService, :postgresql do
it 'should add an error on group' do
transfer_service.execute(nil)
- expect(transfer_service.error).to eq('Transfer failed: Group is already a root group.')
+ expect(transfer_service.error).to eq(_('Transfer failed: Group is already a root group.'))
end
end
@@ -65,7 +65,7 @@ describe Groups::TransferService, :postgresql do
it "should add an error on group" do
transfer_service.execute(new_parent_group)
- expect(transfer_service.error).to eq("Transfer failed: You don't have enough permissions.")
+ expect(transfer_service.error).to eq(_("Transfer failed: You don't have enough permissions."))
end
end
@@ -82,7 +82,7 @@ describe Groups::TransferService, :postgresql do
it 'should add an error on group' do
transfer_service.execute(nil)
- expect(transfer_service.error).to eq('Transfer failed: The parent group already has a subgroup with the same path.')
+ expect(transfer_service.error).to eq(_('Transfer failed: The parent group already has a subgroup with the same path.'))
end
end
@@ -128,7 +128,7 @@ describe Groups::TransferService, :postgresql do
it 'should add an error on group' do
transfer_service.execute(new_parent_group)
- expect(transfer_service.error).to eq('Transfer failed: Group is already associated to the parent group.')
+ expect(transfer_service.error).to eq(_('Transfer failed: Group is already associated to the parent group.'))
end
end
@@ -141,7 +141,7 @@ describe Groups::TransferService, :postgresql do
it "should add an error on group" do
transfer_service.execute(new_parent_group)
- expect(transfer_service.error).to eq("Transfer failed: You don't have enough permissions.")
+ expect(transfer_service.error).to eq(_("Transfer failed: You don't have enough permissions."))
end
end
@@ -158,7 +158,7 @@ describe Groups::TransferService, :postgresql do
it 'should add an error on group' do
transfer_service.execute(new_parent_group)
- expect(transfer_service.error).to eq('Transfer failed: The parent group already has a subgroup with the same path.')
+ expect(transfer_service.error).to eq(_('Transfer failed: The parent group already has a subgroup with the same path.'))
end
end
diff --git a/spec/services/labels/find_or_create_service_spec.rb b/spec/services/labels/find_or_create_service_spec.rb
index 97ba2742392..f6ad1c74649 100644
--- a/spec/services/labels/find_or_create_service_spec.rb
+++ b/spec/services/labels/find_or_create_service_spec.rb
@@ -8,7 +8,7 @@ describe Labels::FindOrCreateService do
let(:params) do
{
title: 'Security',
- description: 'Security related stuff.',
+ description: _('Security related stuff.'),
color: '#FF0000'
}
end
diff --git a/spec/services/merge_requests/build_service_spec.rb b/spec/services/merge_requests/build_service_spec.rb
index 536d0d345a4..39a97a51962 100644
--- a/spec/services/merge_requests/build_service_spec.rb
+++ b/spec/services/merge_requests/build_service_spec.rb
@@ -19,7 +19,7 @@ describe MergeRequests::BuildService do
let(:merge_request) { service.execute }
let(:compare) { double(:compare, commits: commits) }
let(:commit_1) { double(:commit_1, sha: 'f00ba7', safe_message: "Initial commit\n\nCreate the app") }
- let(:commit_2) { double(:commit_2, sha: 'f00ba7', safe_message: 'This is a bad commit message!') }
+ let(:commit_2) { double(:commit_2, sha: 'f00ba7', safe_message: _('This is a bad commit message!')) }
let(:commits) { nil }
let(:params) do
diff --git a/spec/services/merge_requests/conflicts/resolve_service_spec.rb b/spec/services/merge_requests/conflicts/resolve_service_spec.rb
index 7edf8a96c94..afac3b36f44 100644
--- a/spec/services/merge_requests/conflicts/resolve_service_spec.rb
+++ b/spec/services/merge_requests/conflicts/resolve_service_spec.rb
@@ -48,7 +48,7 @@ describe MergeRequests::Conflicts::ResolveService do
}
}
],
- commit_message: 'This is a commit message!'
+ commit_message: _('This is a commit message!')
}
end
@@ -146,7 +146,7 @@ describe MergeRequests::Conflicts::ResolveService do
}
}
],
- commit_message: 'This is a commit message!'
+ commit_message: _('This is a commit message!')
}
end
@@ -189,7 +189,7 @@ describe MergeRequests::Conflicts::ResolveService do
sections: { '6eb14e00385d2fb284765eb1cd8d420d33d63fc9_9_9' => 'head' }
}
],
- commit_message: 'This is a commit message!'
+ commit_message: _('This is a commit message!')
}
end
@@ -220,7 +220,7 @@ describe MergeRequests::Conflicts::ResolveService do
content: regex_conflict.content
}
],
- commit_message: 'This is a commit message!'
+ commit_message: _('This is a commit message!')
}
end
@@ -240,7 +240,7 @@ describe MergeRequests::Conflicts::ResolveService do
content: ''
}
],
- commit_message: 'This is a commit message!'
+ commit_message: _('This is a commit message!')
}
end
diff --git a/spec/services/preview_markdown_service_spec.rb b/spec/services/preview_markdown_service_spec.rb
index 458cb8f1f31..a98c1b23cb3 100644
--- a/spec/services/preview_markdown_service_spec.rb
+++ b/spec/services/preview_markdown_service_spec.rb
@@ -86,7 +86,7 @@ describe PreviewMarkdownService do
it 'explains quick actions effect' do
result = service.execute
- expect(result[:commands]).to eq 'Sets time estimate to 2y.'
+ expect(result[:commands]).to eq _('Sets time estimate to 2y.')
end
end
@@ -111,7 +111,7 @@ describe PreviewMarkdownService do
it 'explains quick actions effect' do
result = service.execute
- expect(result[:commands]).to eq 'Tags this commit to v1.2.3 with "Stable release".'
+ expect(result[:commands]).to eq _('Tags this commit to v1.2.3 with "Stable release".')
end
end
diff --git a/spec/services/projects/lfs_pointers/lfs_download_link_list_service_spec.rb b/spec/services/projects/lfs_pointers/lfs_download_link_list_service_spec.rb
index d7a2829d5f8..e347a0a405f 100644
--- a/spec/services/projects/lfs_pointers/lfs_download_link_list_service_spec.rb
+++ b/spec/services/projects/lfs_pointers/lfs_download_link_list_service_spec.rb
@@ -92,7 +92,7 @@ describe Projects::LfsPointers::LfsDownloadLinkListService do
describe '#parse_response_links' do
it 'does not add oid entry if href not found' do
- expect(Rails.logger).to receive(:error).with("Link for Lfs Object with oid whatever not found or invalid.")
+ expect(Rails.logger).to receive(:error).with(_("Link for Lfs Object with oid whatever not found or invalid."))
result = subject.send(:parse_response_links, invalid_object_response)
diff --git a/spec/services/projects/transfer_service_spec.rb b/spec/services/projects/transfer_service_spec.rb
index 766276fdba3..fec6d1bc75f 100644
--- a/spec/services/projects/transfer_service_spec.rb
+++ b/spec/services/projects/transfer_service_spec.rb
@@ -168,7 +168,7 @@ describe Projects::TransferService do
it { expect(@result).to eq false }
it { expect(project.namespace).to eq(user.namespace) }
- it { expect(project.errors.messages[:new_namespace].first).to eq 'Please select a new namespace for your project.' }
+ it { expect(project.errors.messages[:new_namespace].first).to eq _('Please select a new namespace for your project.') }
end
context 'disallow transferring of project with tags' do
@@ -202,7 +202,7 @@ describe Projects::TransferService do
group.add_owner(user)
unless gitlab_shell.create_repository(repository_storage, "#{group.full_path}/#{project.path}")
- raise 'failed to add repository'
+ raise _('failed to add repository')
end
@result = transfer_project(project, user, group)
diff --git a/spec/services/projects/update_service_spec.rb b/spec/services/projects/update_service_spec.rb
index 8adfc63222e..8aed8fd17cb 100644
--- a/spec/services/projects/update_service_spec.rb
+++ b/spec/services/projects/update_service_spec.rb
@@ -68,7 +68,7 @@ describe Projects::UpdateService do
it 'does not update the project to public' do
result = update_project(project, user, visibility_level: Gitlab::VisibilityLevel::PUBLIC)
- expect(result).to eq({ status: :error, message: 'New visibility level not allowed!' })
+ expect(result).to eq({ status: :error, message: _('New visibility level not allowed!') })
expect(project).to be_private
end
@@ -93,7 +93,7 @@ describe Projects::UpdateService do
it 'does not update project visibility level' do
result = update_project(project, admin, visibility_level: Gitlab::VisibilityLevel::PUBLIC)
- expect(result).to eq({ status: :error, message: 'Visibility level public is not allowed in a internal group.' })
+ expect(result).to eq({ status: :error, message: _('Visibility level public is not allowed in a internal group.') })
expect(project.reload).to be_internal
end
end
@@ -315,7 +315,7 @@ describe Projects::UpdateService do
expect(result).to eq({
status: :error,
- message: "Name can contain only letters, digits, emojis, '_', '.', dash, space. It must start with letter, digit, emoji or '_'."
+ message: _("Name can contain only letters, digits, emojis, '_', '.', dash, space. It must start with letter, digit, emoji or '_'.")
})
end
end
diff --git a/spec/services/quick_actions/interpret_service_spec.rb b/spec/services/quick_actions/interpret_service_spec.rb
index 938764f40b0..fe823056fd6 100644
--- a/spec/services/quick_actions/interpret_service_spec.rb
+++ b/spec/services/quick_actions/interpret_service_spec.rb
@@ -1265,7 +1265,7 @@ describe QuickActions::InterpretService do
it 'includes issuable name' do
_, explanations = service.explain(content, issue)
- expect(explanations).to eq(['Closes this issue.'])
+ expect(explanations).to eq([_('Closes this issue.')])
end
end
@@ -1276,7 +1276,7 @@ describe QuickActions::InterpretService do
it 'includes issuable name' do
_, explanations = service.explain(content, merge_request)
- expect(explanations).to eq(['Reopens this merge request.'])
+ expect(explanations).to eq([_('Reopens this merge request.')])
end
end
@@ -1286,7 +1286,7 @@ describe QuickActions::InterpretService do
it 'includes new title' do
_, explanations = service.explain(content, issue)
- expect(explanations).to eq(['Changes the title to "This is new title".'])
+ expect(explanations).to eq([_('Changes the title to "This is new title".')])
end
end
@@ -1329,7 +1329,7 @@ describe QuickActions::InterpretService do
it 'includes current milestone name' do
_, explanations = service.explain(content, merge_request)
- expect(explanations).to eq(['Removes %"9.10" milestone.'])
+ expect(explanations).to eq([_('Removes %"9.10" milestone.')])
end
end
@@ -1351,7 +1351,7 @@ describe QuickActions::InterpretService do
merge_request.update!(label_ids: [bug.id])
_, explanations = service.explain(content, merge_request)
- expect(explanations).to eq(['Removes all labels.'])
+ expect(explanations).to eq([_('Removes all labels.')])
end
end
@@ -1374,7 +1374,7 @@ describe QuickActions::InterpretService do
it 'includes issuable name' do
_, explanations = service.explain(content, issue)
- expect(explanations).to eq(['Subscribes to this issue.'])
+ expect(explanations).to eq([_('Subscribes to this issue.')])
end
end
@@ -1385,7 +1385,7 @@ describe QuickActions::InterpretService do
merge_request.subscribe(developer, project)
_, explanations = service.explain(content, merge_request)
- expect(explanations).to eq(['Unsubscribes from this merge request.'])
+ expect(explanations).to eq([_('Unsubscribes from this merge request.')])
end
end
@@ -1395,7 +1395,7 @@ describe QuickActions::InterpretService do
it 'includes the date' do
_, explanations = service.explain(content, issue)
- expect(explanations).to eq(['Sets the due date to Apr 1, 2016.'])
+ expect(explanations).to eq([_('Sets the due date to Apr 1, 2016.')])
end
end
@@ -1405,7 +1405,7 @@ describe QuickActions::InterpretService do
it 'includes the new status' do
_, explanations = service.explain(content, merge_request)
- expect(explanations).to eq(['Marks this merge request as Work In Progress.'])
+ expect(explanations).to eq([_('Marks this merge request as Work In Progress.')])
end
end
@@ -1415,7 +1415,7 @@ describe QuickActions::InterpretService do
it 'includes the emoji' do
_, explanations = service.explain(content, issue)
- expect(explanations).to eq(['Toggles :confetti_ball: emoji award.'])
+ expect(explanations).to eq([_('Toggles :confetti_ball: emoji award.')])
end
end
@@ -1425,7 +1425,7 @@ describe QuickActions::InterpretService do
it 'includes the formatted duration' do
_, explanations = service.explain(content, merge_request)
- expect(explanations).to eq(['Sets time estimate to 3mo 3w 4d.'])
+ expect(explanations).to eq([_('Sets time estimate to 3mo 3w 4d.')])
end
end
@@ -1435,7 +1435,7 @@ describe QuickActions::InterpretService do
it 'includes the formatted duration and proper verb' do
_, explanations = service.explain(content, issue)
- expect(explanations).to eq(['Subtracts 2h spent time.'])
+ expect(explanations).to eq([_('Subtracts 2h spent time.')])
end
end
@@ -1445,7 +1445,7 @@ describe QuickActions::InterpretService do
it 'includes the branch name' do
_, explanations = service.explain(content, merge_request)
- expect(explanations).to eq(['Sets target branch to my-feature.'])
+ expect(explanations).to eq([_('Sets target branch to my-feature.')])
end
end
@@ -1467,7 +1467,7 @@ describe QuickActions::InterpretService do
it 'includes the project name' do
_, explanations = service.explain(content, issue)
- expect(explanations).to eq(["Moves this issue to test/project."])
+ expect(explanations).to eq([_("Moves this issue to test/project.")])
end
end
@@ -1479,7 +1479,7 @@ describe QuickActions::InterpretService do
it 'includes the tag name only' do
_, explanations = service.explain(content, commit)
- expect(explanations).to eq(["Tags this commit to v1.2.3."])
+ expect(explanations).to eq([_("Tags this commit to v1.2.3.")])
end
end
@@ -1489,7 +1489,7 @@ describe QuickActions::InterpretService do
it 'includes the tag name only' do
_, explanations = service.explain(content, commit)
- expect(explanations).to eq(["Tags this commit to v1.2.3."])
+ expect(explanations).to eq([_("Tags this commit to v1.2.3.")])
end
end
end
@@ -1500,7 +1500,7 @@ describe QuickActions::InterpretService do
it 'includes the tag name and message' do
_, explanations = service.explain(content, commit)
- expect(explanations).to eq(["Tags this commit to v1.2.3 with \"Stable release\"."])
+ expect(explanations).to eq([_("Tags this commit to v1.2.3 with \"Stable release\".")])
end
end
end
diff --git a/spec/services/releases/create_service_spec.rb b/spec/services/releases/create_service_spec.rb
index 612e9f152e7..e3116ba7f09 100644
--- a/spec/services/releases/create_service_spec.rb
+++ b/spec/services/releases/create_service_spec.rb
@@ -6,7 +6,7 @@ describe Releases::CreateService do
let(:tag_name) { project.repository.tag_names.first }
let(:tag_sha) { project.repository.find_tag(tag_name).dereferenced_target.sha }
let(:name) { 'Bionic Beaver' }
- let(:description) { 'Awesome release!' }
+ let(:description) { _('Awesome release!') }
let(:params) { { tag: tag_name, name: name, description: description, ref: ref } }
let(:ref) { nil }
let(:service) { described_class.new(project, user, params) }
diff --git a/spec/services/releases/update_service_spec.rb b/spec/services/releases/update_service_spec.rb
index 6c68f364739..07ff2a03dce 100644
--- a/spec/services/releases/update_service_spec.rb
+++ b/spec/services/releases/update_service_spec.rb
@@ -4,7 +4,7 @@ describe Releases::UpdateService do
let(:project) { create(:project, :repository) }
let(:user) { create(:user) }
let(:new_name) { 'A new name' }
- let(:new_description) { 'The best release!' }
+ let(:new_description) { _('The best release!') }
let(:params) { { name: new_name, description: new_description, tag: tag_name } }
let(:service) { described_class.new(project, user, params) }
let!(:release) { create(:release, project: project, author: user, tag: tag_name) }
diff --git a/spec/services/test_hooks/project_service_spec.rb b/spec/services/test_hooks/project_service_spec.rb
index 19e1c5ff3b2..003ba59150c 100644
--- a/spec/services/test_hooks/project_service_spec.rb
+++ b/spec/services/test_hooks/project_service_spec.rb
@@ -33,7 +33,7 @@ describe TestHooks::ProjectService do
allow(project).to receive(:empty_repo?).and_return(true)
expect(hook).not_to receive(:execute)
- expect(service.execute).to include({ status: :error, message: 'Ensure the project has at least one commit.' })
+ expect(service.execute).to include({ status: :error, message: _('Ensure the project has at least one commit.') })
end
it 'executes hook' do
@@ -53,7 +53,7 @@ describe TestHooks::ProjectService do
allow(project).to receive(:empty_repo?).and_return(true)
expect(hook).not_to receive(:execute)
- expect(service.execute).to include({ status: :error, message: 'Ensure the project has at least one commit.' })
+ expect(service.execute).to include({ status: :error, message: _('Ensure the project has at least one commit.') })
end
it 'executes hook' do
@@ -71,7 +71,7 @@ describe TestHooks::ProjectService do
it 'returns error message if not enough data' do
expect(hook).not_to receive(:execute)
- expect(service.execute).to include({ status: :error, message: 'Ensure the project has notes.' })
+ expect(service.execute).to include({ status: :error, message: _('Ensure the project has notes.') })
end
it 'executes hook' do
@@ -90,7 +90,7 @@ describe TestHooks::ProjectService do
it 'returns error message if not enough data' do
expect(hook).not_to receive(:execute)
- expect(service.execute).to include({ status: :error, message: 'Ensure the project has issues.' })
+ expect(service.execute).to include({ status: :error, message: _('Ensure the project has issues.') })
end
it 'executes hook' do
@@ -109,7 +109,7 @@ describe TestHooks::ProjectService do
it 'returns error message if not enough data' do
expect(hook).not_to receive(:execute)
- expect(service.execute).to include({ status: :error, message: 'Ensure the project has issues.' })
+ expect(service.execute).to include({ status: :error, message: _('Ensure the project has issues.') })
end
it 'executes hook' do
@@ -127,7 +127,7 @@ describe TestHooks::ProjectService do
it 'returns error message if not enough data' do
expect(hook).not_to receive(:execute)
- expect(service.execute).to include({ status: :error, message: 'Ensure the project has merge requests.' })
+ expect(service.execute).to include({ status: :error, message: _('Ensure the project has merge requests.') })
end
it 'executes hook' do
@@ -145,7 +145,7 @@ describe TestHooks::ProjectService do
it 'returns error message if not enough data' do
expect(hook).not_to receive(:execute)
- expect(service.execute).to include({ status: :error, message: 'Ensure the project has CI jobs.' })
+ expect(service.execute).to include({ status: :error, message: _('Ensure the project has CI jobs.') })
end
it 'executes hook' do
@@ -163,7 +163,7 @@ describe TestHooks::ProjectService do
it 'returns error message if not enough data' do
expect(hook).not_to receive(:execute)
- expect(service.execute).to include({ status: :error, message: 'Ensure the project has CI pipelines.' })
+ expect(service.execute).to include({ status: :error, message: _('Ensure the project has CI pipelines.') })
end
it 'executes hook' do
@@ -184,12 +184,12 @@ describe TestHooks::ProjectService do
allow(project).to receive(:wiki_enabled?).and_return(false)
expect(hook).not_to receive(:execute)
- expect(service.execute).to include({ status: :error, message: 'Ensure the wiki is enabled and has pages.' })
+ expect(service.execute).to include({ status: :error, message: _('Ensure the wiki is enabled and has pages.') })
end
it 'returns error message if not enough data' do
expect(hook).not_to receive(:execute)
- expect(service.execute).to include({ status: :error, message: 'Ensure the wiki is enabled and has pages.' })
+ expect(service.execute).to include({ status: :error, message: _('Ensure the wiki is enabled and has pages.') })
end
it 'executes hook' do
diff --git a/spec/services/test_hooks/system_service_spec.rb b/spec/services/test_hooks/system_service_spec.rb
index 74d7715e50f..ce19f78ffdc 100644
--- a/spec/services/test_hooks/system_service_spec.rb
+++ b/spec/services/test_hooks/system_service_spec.rb
@@ -66,7 +66,7 @@ describe TestHooks::SystemService do
it 'returns error message if the user does not have any repository with a merge request' do
expect(hook).not_to receive(:execute)
- expect(service.execute).to include({ status: :error, message: 'Ensure one of your projects has merge requests.' })
+ expect(service.execute).to include({ status: :error, message: _('Ensure one of your projects has merge requests.') })
end
it 'executes hook' do
diff --git a/spec/support/features/issuable_quick_actions_shared_examples.rb b/spec/support/features/issuable_quick_actions_shared_examples.rb
index 2a883ce1074..577d55fe039 100644
--- a/spec/support/features/issuable_quick_actions_shared_examples.rb
+++ b/spec/support/features/issuable_quick_actions_shared_examples.rb
@@ -382,7 +382,7 @@ shared_examples 'issuable record that supports quick actions in its description
expect(page).to have_content 'Awesome!'
expect(page).not_to have_content '/assign @bob'
- expect(page).to have_content 'Assigns @bob.'
+ expect(page).to have_content _('Assigns @bob.')
end
end
end
diff --git a/spec/support/helpers/filtered_search_helpers.rb b/spec/support/helpers/filtered_search_helpers.rb
index 6569feec39b..466f3ca9f6c 100644
--- a/spec/support/helpers/filtered_search_helpers.rb
+++ b/spec/support/helpers/filtered_search_helpers.rb
@@ -129,7 +129,7 @@ module FilteredSearchHelpers
end
def default_placeholder
- 'Search or filter results...'
+ _('Search or filter results...')
end
def get_filtered_search_placeholder
diff --git a/spec/support/helpers/live_debugger.rb b/spec/support/helpers/live_debugger.rb
index 911eb48a8ca..dc01a08afe5 100644
--- a/spec/support/helpers/live_debugger.rb
+++ b/spec/support/helpers/live_debugger.rb
@@ -3,15 +3,15 @@ require 'io/console'
module LiveDebugger
def live_debug
puts
- puts "Current example is paused for live debugging."
+ puts _("Current example is paused for live debugging.")
puts "Opening #{current_url} in your default browser..."
puts "The current user credentials are: #{@current_user.username} / #{@current_user.password}" if @current_user
- puts "Press any key to resume the execution of the example!!"
+ puts _("Press any key to resume the execution of the example!!")
`open #{current_url}`
loop until $stdin.getch
- puts "Back to the example!"
+ puts _("Back to the example!")
end
end
diff --git a/spec/support/helpers/select2_helper.rb b/spec/support/helpers/select2_helper.rb
index 90618ba5b19..f54b06daafa 100644
--- a/spec/support/helpers/select2_helper.rb
+++ b/spec/support/helpers/select2_helper.rb
@@ -12,7 +12,7 @@
module Select2Helper
def select2(value, options = {})
- raise ArgumentError, 'options must be a Hash' unless options.is_a?(Hash)
+ raise ArgumentError, _('options must be a Hash') unless options.is_a?(Hash)
selector = options.fetch(:from)
diff --git a/spec/support/helpers/terms_helper.rb b/spec/support/helpers/terms_helper.rb
index a00ec14138b..84a18fb57ad 100644
--- a/spec/support/helpers/terms_helper.rb
+++ b/spec/support/helpers/terms_helper.rb
@@ -14,6 +14,6 @@ module TermsHelper
def expect_to_be_on_terms_page
expect(current_path).to eq terms_path
- expect(page).to have_content('Please accept the Terms of Service before continuing.')
+ expect(page).to have_content(_('Please accept the Terms of Service before continuing.'))
end
end
diff --git a/spec/support/helpers/test_env.rb b/spec/support/helpers/test_env.rb
index d352a7cdf1a..1919b0e19c3 100644
--- a/spec/support/helpers/test_env.rb
+++ b/spec/support/helpers/test_env.rb
@@ -181,7 +181,7 @@ module TestEnv
spawn_script = Rails.root.join('scripts/gitaly-test-spawn').to_s
Bundler.with_original_env do
- raise "gitaly spawn failed" unless system(spawn_script)
+ raise _("gitaly spawn failed") unless system(spawn_script)
end
@gitaly_pid = Integer(File.read('tmp/tests/gitaly.pid'))
@@ -282,7 +282,7 @@ module TestEnv
def eager_load_driver_server
return unless defined?(Capybara)
- puts "Starting the Capybara driver server..."
+ puts _("Starting the Capybara driver server...")
Capybara.current_session.visit '/'
end
@@ -338,7 +338,7 @@ module TestEnv
# Try to reset without fetching to avoid using the network.
unless reset.call
- raise 'Could not fetch test seed repository.' unless system(*%W(#{Gitlab.config.git.bin_path} -C #{repo_path} fetch origin))
+ raise _('Could not fetch test seed repository.') unless system(*%W(#{Gitlab.config.git.bin_path} -C #{repo_path} fetch origin))
# Before we used Git clone's --mirror option, bare repos could end up
# with missing refs, clearing them and retrying should fix the issue.
diff --git a/spec/support/shared_examples/uploaders/gitlab_uploader_shared_examples.rb b/spec/support/shared_examples/uploaders/gitlab_uploader_shared_examples.rb
index 1190863d88e..3b27990a901 100644
--- a/spec/support/shared_examples/uploaders/gitlab_uploader_shared_examples.rb
+++ b/spec/support/shared_examples/uploaders/gitlab_uploader_shared_examples.rb
@@ -4,7 +4,7 @@ shared_examples "matches the method pattern" do |method|
let(:pattern) { patterns[method] }
it do
- skip "No pattern provided, skipping." unless pattern
+ skip _("No pattern provided, skipping.") unless pattern
expect(target.method(method).call(*args)).to match(pattern)
end
@@ -35,7 +35,7 @@ shared_examples "builds correct paths" do |**patterns|
describe "#relative_path" do
it 'is relative' do
- skip 'Path not set, skipping.' unless subject.path
+ skip _('Path not set, skipping.') unless subject.path
expect(Pathname.new(subject.relative_path)).to be_relative
end
diff --git a/spec/support/shared_examples/uploaders/object_storage_shared_examples.rb b/spec/support/shared_examples/uploaders/object_storage_shared_examples.rb
index 1bd176280c5..4df7e6b7f57 100644
--- a/spec/support/shared_examples/uploaders/object_storage_shared_examples.rb
+++ b/spec/support/shared_examples/uploaders/object_storage_shared_examples.rb
@@ -29,7 +29,7 @@ shared_examples "migrates" do |to_store:, from_store: nil|
elsif from == described_class::Store::LOCAL
expect(subject.file).to be_a(CarrierWave::SanitizedFile)
else
- raise 'Unexpected file type'
+ raise _('Unexpected file type')
end
end
@@ -117,18 +117,18 @@ shared_examples "migrates" do |to_store:, from_store: nil|
context 'upon a fog failure' do
before do
storage_class = subject.send(:storage_for, to).class
- expect_any_instance_of(storage_class).to receive(:store!).and_raise("Store failure.")
+ expect_any_instance_of(storage_class).to receive(:store!).and_raise(_("Store failure."))
end
- include_examples "handles gracefully", error: "Store failure."
+ include_examples "handles gracefully", error: _("Store failure.")
end
context 'upon a database failure' do
before do
- expect(uploader).to receive(:persist_object_store!).and_raise("ActiveRecord failure.")
+ expect(uploader).to receive(:persist_object_store!).and_raise(_("ActiveRecord failure."))
end
- include_examples "handles gracefully", error: "ActiveRecord failure."
+ include_examples "handles gracefully", error: _("ActiveRecord failure.")
end
end
end
diff --git a/spec/tasks/gitlab/cleanup_rake_spec.rb b/spec/tasks/gitlab/cleanup_rake_spec.rb
index 19794227d9f..08b8420ef61 100644
--- a/spec/tasks/gitlab/cleanup_rake_spec.rb
+++ b/spec/tasks/gitlab/cleanup_rake_spec.rb
@@ -111,7 +111,7 @@ describe 'gitlab:cleanup rake tasks' do
end
it 'logs action as done' do
- expect(logger).to receive(:info).with("Looking for orphaned project uploads to clean up...")
+ expect(logger).to receive(:info).with(_("Looking for orphaned project uploads to clean up..."))
expect(logger).to receive(:info).with("Did fix #{path} -> #{new_path}")
run_rake_task('gitlab:cleanup:project_uploads')
@@ -127,7 +127,7 @@ describe 'gitlab:cleanup rake tasks' do
end
it 'logs action as able to be done' do
- expect(logger).to receive(:info).with("Looking for orphaned project uploads to clean up. Dry run...")
+ expect(logger).to receive(:info).with(_("Looking for orphaned project uploads to clean up. Dry run..."))
expect(logger).to receive(:info).with("Can fix #{path} -> #{new_path}")
expect(logger).to receive(:info).with(/To clean up these files run this command with DRY_RUN=false/)
diff --git a/spec/tasks/gitlab/uploads/migrate_rake_spec.rb b/spec/tasks/gitlab/uploads/migrate_rake_spec.rb
index 9588e8be5dc..4e8c173199f 100644
--- a/spec/tasks/gitlab/uploads/migrate_rake_spec.rb
+++ b/spec/tasks/gitlab/uploads/migrate_rake_spec.rb
@@ -23,7 +23,7 @@ describe 'gitlab:uploads:migrate rake tasks' do
it do
expect(ObjectStorage::MigrateUploadsWorker)
.to receive(:perform_async).exactly(batch).times
- .and_return("A fake job.")
+ .and_return(_("A fake job."))
run
end
diff --git a/spec/uploaders/workers/object_storage/migrate_uploads_worker_spec.rb b/spec/uploaders/workers/object_storage/migrate_uploads_worker_spec.rb
index da490cb02af..b734167887f 100644
--- a/spec/uploaders/workers/object_storage/migrate_uploads_worker_spec.rb
+++ b/spec/uploaders/workers/object_storage/migrate_uploads_worker_spec.rb
@@ -106,7 +106,7 @@ describe ObjectStorage::MigrateUploadsWorker, :sidekiq do
context 'migration is unsuccessful' do
before do
allow_any_instance_of(ObjectStorage::Concern)
- .to receive(:migrate!).and_raise(CarrierWave::UploadError, "I am a teapot.")
+ .to receive(:migrate!).and_raise(CarrierWave::UploadError, _("I am a teapot."))
end
it_behaves_like 'outputs correctly', failures: 10
diff --git a/spec/validators/namespace_path_validator_spec.rb b/spec/validators/namespace_path_validator_spec.rb
index 61e2845f35f..db1b4def82f 100644
--- a/spec/validators/namespace_path_validator_spec.rb
+++ b/spec/validators/namespace_path_validator_spec.rb
@@ -13,7 +13,7 @@ describe NamespacePathValidator do
it 'adds a message when the path is not in the correct format' do
group = build(:group)
- validator.validate_each(group, :path, "Path with spaces, and comma's!")
+ validator.validate_each(group, :path, _("Path with spaces, and comma's!"))
expect(group.errors[:path]).to include(Gitlab::PathRegex.namespace_format_message)
end
diff --git a/spec/validators/project_path_validator_spec.rb b/spec/validators/project_path_validator_spec.rb
index 8bb5e72dc22..1f9a6a57f92 100644
--- a/spec/validators/project_path_validator_spec.rb
+++ b/spec/validators/project_path_validator_spec.rb
@@ -13,7 +13,7 @@ describe ProjectPathValidator do
it 'adds a message when the path is not in the correct format' do
project = build(:project)
- validator.validate_each(project, :path, "Path with spaces, and comma's!")
+ validator.validate_each(project, :path, _("Path with spaces, and comma's!"))
expect(project.errors[:path]).to include(Gitlab::PathRegex.project_path_format_message)
end
diff --git a/spec/views/projects/services/_form.haml_spec.rb b/spec/views/projects/services/_form.haml_spec.rb
index 85167bca115..bc52784923c 100644
--- a/spec/views/projects/services/_form.haml_spec.rb
+++ b/spec/views/projects/services/_form.haml_spec.rb
@@ -38,8 +38,8 @@ describe 'projects/services/_form' do
it 'display merge_request_events and commit_events descriptions' do
render
- expect(rendered).to have_content('JIRA comments will be created when an issue gets referenced in a commit.')
- expect(rendered).to have_content('JIRA comments will be created when an issue gets referenced in a merge request.')
+ expect(rendered).to have_content(_('JIRA comments will be created when an issue gets referenced in a commit.'))
+ expect(rendered).to have_content(_('JIRA comments will be created when an issue gets referenced in a merge request.'))
end
end
end
diff --git a/spec/views/projects/settings/ci_cd/_autodevops_form.html.haml_spec.rb b/spec/views/projects/settings/ci_cd/_autodevops_form.html.haml_spec.rb
index cb1b9e6f5fb..83a34cda9fb 100644
--- a/spec/views/projects/settings/ci_cd/_autodevops_form.html.haml_spec.rb
+++ b/spec/views/projects/settings/ci_cd/_autodevops_form.html.haml_spec.rb
@@ -43,7 +43,7 @@ describe 'projects/settings/ci_cd/_autodevops_form' do
render
expect(rendered).to have_css('.auto-devops-warning-message')
- expect(rendered).to have_text('Auto Review Apps and Auto Deploy need a domain name to work correctly.')
+ expect(rendered).to have_text(_('Auto Review Apps and Auto Deploy need a domain name to work correctly.'))
end
end
diff --git a/spec/workers/repository_remove_remote_worker_spec.rb b/spec/workers/repository_remove_remote_worker_spec.rb
index 6ddb653d142..a1e206a0548 100644
--- a/spec/workers/repository_remove_remote_worker_spec.rb
+++ b/spec/workers/repository_remove_remote_worker_spec.rb
@@ -30,7 +30,7 @@ describe RepositoryRemoveRemoteWorker do
expect(subject)
.to receive(:log_error)
- .with('Cannot obtain an exclusive lease. There must be another instance already in execution.')
+ .with(_('Cannot obtain an exclusive lease. There must be another instance already in execution.'))
subject.perform(project.id, remote_name)
end