From 577b71a62e181eb913efa9593bf726ca87e4a4af Mon Sep 17 00:00:00 2001 From: Vokhmin Alexey V Date: Mon, 24 Dec 2012 17:58:46 +0400 Subject: [PATCH] #794: rename errors: "contains__key" to "wrong__key" --- app/models/key_pair.rb | 2 +- config/locales/models/key_pair.en.yml | 4 ++-- config/locales/models/key_pair.ru.yml | 4 ++-- spec/models/key_pair_spec.rb | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/models/key_pair.rb b/app/models/key_pair.rb index 428aae235..6f7b9c168 100644 --- a/app/models/key_pair.rb +++ b/app/models/key_pair.rb @@ -85,7 +85,7 @@ class KeyPair < ActiveRecord::Base return false else if info[:type] != field - errors.add field, I18n.t("activerecord.errors.key_pair.contains_#{field}_key") + errors.add field, I18n.t("activerecord.errors.key_pair.wrong_#{field}_key") return false end end diff --git a/config/locales/models/key_pair.en.yml b/config/locales/models/key_pair.en.yml index 0a3af3b97..5cb59fabf 100644 --- a/config/locales/models/key_pair.en.yml +++ b/config/locales/models/key_pair.en.yml @@ -19,8 +19,8 @@ en: repo_key_exists: Repository has been signed already! Please remove old signature and try again wrong_keys: keys are imported, but it is not a key pair (ids differ) wrong_key: wrong - contains_public_key: contains secret key - contains_secret_key: contains public key + wrong_public_key: contains secret key + wrong_secret_key: contains public key key_has_passphrase: contains passphrase models: key_pair: Key Pair diff --git a/config/locales/models/key_pair.ru.yml b/config/locales/models/key_pair.ru.yml index 01af6f6ac..d0c95506c 100644 --- a/config/locales/models/key_pair.ru.yml +++ b/config/locales/models/key_pair.ru.yml @@ -19,8 +19,8 @@ ru: repo_key_exists: Репозиторий уже подписан! Пожалуйста, удалите старую подпись и попробуйте снова wrong_keys: Ключи импортированы, но не являются парой (идентификаторы не совпадают) wrong_key: неправильный - contains_public_key: содержит секретный ключ - contains_secret_key: содержит публичный ключ + wrong_public_key: содержит секретный ключ + wrong_secret_key: содержит публичный ключ key_has_passphrase: содержит пароль models: key_pair: Подпись diff --git a/spec/models/key_pair_spec.rb b/spec/models/key_pair_spec.rb index ef2d9ec3a..a817a0bbc 100644 --- a/spec/models/key_pair_spec.rb +++ b/spec/models/key_pair_spec.rb @@ -35,13 +35,13 @@ describe KeyPair do it 'checks error when public key contains secret key' do subject.public = subject.secret subject.valid? - subject.errors[:public].should =~ [I18n.t('activerecord.errors.key_pair.contains_public_key')] + subject.errors[:public].should =~ [I18n.t('activerecord.errors.key_pair.wrong_public_key')] end it 'checks error when secret key contains public key' do subject.secret = subject.public subject.valid? - subject.errors[:secret].should =~ [I18n.t('activerecord.errors.key_pair.contains_secret_key')] + subject.errors[:secret].should =~ [I18n.t('activerecord.errors.key_pair.wrong_secret_key')] end it 'checks error when different fingerprint of keys' do