diff --git a/app/controllers/admin/settings_controller.rb b/app/controllers/admin/settings_controller.rb index 527e6f35b..d4df95649 100644 --- a/app/controllers/admin/settings_controller.rb +++ b/app/controllers/admin/settings_controller.rb @@ -14,7 +14,7 @@ module Admin Setting[k] = v end - flash[:notice] = I18n.t('records_updated') + flash[:notice] = t('.saved') redirect_to [:admin, :settings] else flash[:alert] = @errors.values.uniq.join(", ") diff --git a/app/views/admin/settings/index.haml b/app/views/admin/settings/index.haml index d765aea6f..94d0a2657 100644 --- a/app/views/admin/settings/index.haml +++ b/app/views/admin/settings/index.haml @@ -1,4 +1,6 @@ -= render 'shared/title', name: t('.title') +.page-header + .h1 + = t('.title') = form_tag [:admin, :settings] do .panel.panel-default @@ -93,4 +95,4 @@ .row .col-md-12.text-right - %button.btn.btn-primary=t('.submit_btn') + = submit_tag(t('.save_btn'), class: 'btn btn-success', name: nil) diff --git a/config/locales/admin/settings.en.yml b/config/locales/admin/settings.en.yml index 047a1eb6a..bb042db01 100644 --- a/config/locales/admin/settings.en.yml +++ b/config/locales/admin/settings.en.yml @@ -8,4 +8,7 @@ en: domain_expiration: Domain expiration billing: Billing contacts: Contacts - submit_btn: Save + save_btn: Save + + create: + saved: Settings have been successfully updated diff --git a/config/locales/en.yml b/config/locales/en.yml index 2511d086b..acc559c29 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -409,7 +409,6 @@ en: record_created: 'Record created' failed_to_create_record: 'Failed to create record' record_updated: 'Record updated' - records_updated: 'Records updated' failed_to_update_record: 'Failed to update record' record_deleted: 'Record deleted' failed_to_delete_record: 'Failed to delete record' diff --git a/spec/features/admin/settings/create_spec.rb b/spec/features/admin/settings/create_spec.rb new file mode 100644 index 000000000..d30e93e8e --- /dev/null +++ b/spec/features/admin/settings/create_spec.rb @@ -0,0 +1,13 @@ +require 'rails_helper' + +RSpec.feature 'Admin settings' do + background do + sign_in_to_admin_area + end + + it 'saves settings' do + visit admin_settings_path + click_link_or_button 'Save' + expect(page).to have_text(t('admin.settings.create.saved')) + end +end