diff options
author | Luke Bennett <lbennett@gitlab.com> | 2019-01-30 05:10:37 +0000 |
---|---|---|
committer | Luke Bennett <lbennett@gitlab.com> | 2019-01-31 04:56:51 +0000 |
commit | e33e3d29ae56ddd10b66513c35f3e318ea375cb9 (patch) | |
tree | ce5d1515f93c1e38a01c95b5e0f07f1b572f3763 /spec/lib/gitlab | |
parent | b5f089f2b7100dffb1a346e95022f88e6ff06415 (diff) | |
download | gitlab-ce-e33e3d29ae56ddd10b66513c35f3e318ea375cb9.tar.gz |
Autofixed some untranslated stringsi18n-cop
Diffstat (limited to 'spec/lib/gitlab')
32 files changed, 62 insertions, 62 deletions
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 |