From e2af0640288805cbdcee6d3f075f8c94425d2a1a Mon Sep 17 00:00:00 2001 From: Alex Welch Date: Mon, 20 Oct 2014 15:38:54 -0600 Subject: [PATCH] improve registry search message --- app/models/registry.rb | 2 +- config/locales/en.yml | 2 +- spec/models/registry_spec.rb | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/models/registry.rb b/app/models/registry.rb index bf39c7d..1863d1e 100644 --- a/app/models/registry.rb +++ b/app/models/registry.rb @@ -44,7 +44,7 @@ def search(term) { error: { registry_id: id, - summary: I18n.t('registry_search_error'), + summary: I18n.t('registry_search_error', name: name), details: "#{e.class.name}: #{e.message}" } } diff --git a/config/locales/en.yml b/config/locales/en.yml index 1b4790f..7f08ca4 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -37,5 +37,5 @@ en: registry_connection_error: "Docker Registry API is not responding" - registry_search_error: "There was an error performing a search on one of your registries. The endpoint may be invalid or behind authorization." + registry_search_error: "There was an error performing a search on your registry, %{name}. The endpoint may be invalid or behind authorization." github_connection_error: "GitHub API is not responding" diff --git a/spec/models/registry_spec.rb b/spec/models/registry_spec.rb index a2ae283..6948699 100644 --- a/spec/models/registry_spec.rb +++ b/spec/models/registry_spec.rb @@ -79,8 +79,7 @@ subject { search[:error] } its([:registry_id]) { should eq(registry.id) } - its([:summary]) { should eq(I18n.t('registry_search_error')) } - its([:details]) { should eq('StandardError: Error details') } + its([:summary]) { should eq(I18n.t('registry_search_error', name: registry.name)) } end context 'when the RegistryClient search is successful' do