diff --git a/app/views/admin/contacts/forms/_danger.html.haml b/app/views/admin/contacts/forms/_danger.html.haml index d279218c6..1b4eef9c2 100644 --- a/app/views/admin/contacts/forms/_danger.html.haml +++ b/app/views/admin/contacts/forms/_danger.html.haml @@ -7,4 +7,4 @@ %p Once you delete a contact, there is no going back. Please be certain. %p - = link_to 'Permanently delete this contact', { action: :destroy, id: @contact.id }, method: :delete, class: 'boxed-action' + = link_to t('admin.buttons.delete_contact'), { action: :destroy, id: @contact.id }, method: :delete, class: 'boxed-action' diff --git a/app/views/admin/contacts/forms/_editing.html.haml b/app/views/admin/contacts/forms/_editing.html.haml index 7074314b5..1abf4ef88 100644 --- a/app/views/admin/contacts/forms/_editing.html.haml +++ b/app/views/admin/contacts/forms/_editing.html.haml @@ -3,4 +3,4 @@ Editing %strong #{@contact.name} - = f.submit 'Save changes & apply edits to database', class: 'btn btn-success', data: { disable_with: 'Please wait...' } + = f.submit t('admin.buttons.save_changes'), class: 'btn btn-success', data: { disable_with: 'Please wait...' } diff --git a/app/views/admin/contacts/forms/_new_contact.html.haml b/app/views/admin/contacts/forms/_new_contact.html.haml index 88c9afd32..dc01f4ba7 100644 --- a/app/views/admin/contacts/forms/_new_contact.html.haml +++ b/app/views/admin/contacts/forms/_new_contact.html.haml @@ -5,4 +5,4 @@ Creating contact for %strong #{@location.name} - = f.submit 'Create contact', class: 'btn btn-success', data: { disable_with: 'Please wait...' } + = f.submit t('admin.buttons.create_contact'), class: 'btn btn-success', data: { disable_with: 'Please wait...' } diff --git a/app/views/admin/contacts/forms/_new_org_contact.html.haml b/app/views/admin/contacts/forms/_new_org_contact.html.haml index ab032633a..d79befcef 100644 --- a/app/views/admin/contacts/forms/_new_org_contact.html.haml +++ b/app/views/admin/contacts/forms/_new_org_contact.html.haml @@ -5,4 +5,4 @@ Creating contact for %strong #{@organization.name} - = f.submit 'Create contact', class: 'btn btn-success', data: { disable_with: 'Please wait...' } + = f.submit t('admin.buttons.create_contact'), class: 'btn btn-success', data: { disable_with: 'Please wait...' } diff --git a/app/views/admin/contacts/forms/_new_service_contact.html.haml b/app/views/admin/contacts/forms/_new_service_contact.html.haml index c7b8ce395..28c116167 100644 --- a/app/views/admin/contacts/forms/_new_service_contact.html.haml +++ b/app/views/admin/contacts/forms/_new_service_contact.html.haml @@ -5,4 +5,4 @@ Creating contact for %strong #{@service.name} - = f.submit 'Create contact', class: 'btn btn-success', data: { disable_with: 'Please wait...' } + = f.submit t('admin.buttons.create_contact'), class: 'btn btn-success', data: { disable_with: 'Please wait...' } diff --git a/app/views/admin/dashboard/index.html.haml b/app/views/admin/dashboard/index.html.haml index 2fbaa12f9..293f6567e 100644 --- a/app/views/admin/dashboard/index.html.haml +++ b/app/views/admin/dashboard/index.html.haml @@ -2,22 +2,22 @@ %p Welcome back, #{current_admin.name}! %p - = link_to 'Organizations', admin_organizations_path, class: 'btn btn-primary' + = link_to t('admin.buttons.organizations'), admin_organizations_path, class: 'btn btn-primary' %p - = link_to 'Locations', admin_locations_path, class: 'btn btn-primary' + = link_to t('admin.buttons.locations'), admin_locations_path, class: 'btn btn-primary' %p - = link_to 'Services', admin_services_path, class: 'btn btn-primary' + = link_to t('admin.buttons.services'), admin_services_path, class: 'btn btn-primary' %p - = link_to 'Programs', admin_programs_path, class: 'btn btn-primary' + = link_to t('admin.buttons.programs'), admin_programs_path, class: 'btn btn-primary' - if current_admin.super_admin? %p - = link_to 'Add a new organization', new_admin_organization_path, class: 'btn btn-primary' + = link_to t('admin.buttons.add_organization'), new_admin_organization_path, class: 'btn btn-primary' - if @orgs.present? %p - = link_to 'Add a new location', new_admin_location_path, class: 'btn btn-primary' + = link_to t('admin.buttons.add_location'), new_admin_location_path, class: 'btn btn-primary' %p - = link_to 'Add a new program', new_admin_program_path, class: 'btn btn-primary' + = link_to t('admin.buttons.add_program'), new_admin_program_path, class: 'btn btn-primary' - if current_admin.super_admin? %h2 CSV Downloads @@ -25,4 +25,4 @@ %p= zip_file_status %hr - Ohana API #{link_to "v#{version}", 'https://github.com/codeforamerica/ohana-api/blob/master/CHANGELOG.md'} \ No newline at end of file + Ohana API #{link_to "v#{version}", 'https://github.com/codeforamerica/ohana-api/blob/master/CHANGELOG.md'} diff --git a/app/views/admin/locations/_confirm_delete_location.html.haml b/app/views/admin/locations/_confirm_delete_location.html.haml index 6029b2099..f176c007b 100644 --- a/app/views/admin/locations/_confirm_delete_location.html.haml +++ b/app/views/admin/locations/_confirm_delete_location.html.haml @@ -19,4 +19,4 @@ permanently. .modal-footer %button.btn.btn-default{ 'data-dismiss' => 'modal' } Close - = link_to 'I understand the consequences, delete this location', { action: :destroy, id: location_id }, method: :delete, class: 'btn btn-danger' + = link_to t('admin.buttons.confirm_delete_location'), { action: :destroy, id: location_id }, method: :delete, class: 'btn btn-danger' diff --git a/app/views/admin/locations/_form.html.haml b/app/views/admin/locations/_form.html.haml index 916a2c61e..fe9fd1456 100644 --- a/app/views/admin/locations/_form.html.haml +++ b/app/views/admin/locations/_form.html.haml @@ -9,7 +9,7 @@ = link_to contact.name, edit_admin_location_contact_path(@location, contact) %br %p - = link_to 'Add a new contact', new_admin_location_contact_path(@location), class: 'btn btn-primary' + = link_to t('admin.buttons.add_contact'), new_admin_location_contact_path(@location), class: 'btn btn-primary' .content-box %h2 Services @@ -19,7 +19,7 @@ = link_to service.name || "Service ##{i + 1}", edit_admin_location_service_path(@location, service) %br %p - = link_to 'Add a new service', new_admin_location_service_path(@location), class: 'btn btn-primary' + = link_to t('admin.buttons.add_service'), new_admin_location_service_path(@location), class: 'btn btn-primary' .danger-zone %header @@ -30,7 +30,7 @@ %p Once you delete a location, there is no going back. Please be certain. %p - = link_to 'Permanently delete this location', {}, href: '', data: { toggle: 'modal', target: '#modal-window' }, class: 'boxed-action' + = link_to t('admin.buttons.delete_location'), {}, href: '', data: { toggle: 'modal', target: '#modal-window' }, class: 'boxed-action' .modal.fade#modal-window{ 'aria-hidden' => 'true', 'aria-labelledby' => 'myModalLabel', 'role' => 'dialog', 'tabindex' => '-1' } = render 'admin/locations/confirm_delete_location', location_id: @location.id, loc_name: @location.name, org_name: @org.name @@ -39,4 +39,4 @@ Editing %strong #{@org.name} / #{@location.name} - = f.submit 'Save changes & apply edits to database', class: 'btn btn-success', data: { disable_with: 'Please wait...' } + = f.submit t('admin.buttons.save_changes'), class: 'btn btn-success', data: { disable_with: 'Please wait...' } diff --git a/app/views/admin/locations/forms/_address.html.haml b/app/views/admin/locations/forms/_address.html.haml index 4a665bbac..53b2dd58f 100644 --- a/app/views/admin/locations/forms/_address.html.haml +++ b/app/views/admin/locations/forms/_address.html.haml @@ -7,4 +7,4 @@ = f.fields_for :address do |builder| = render 'admin/locations/forms/address_fields', f: builder - unless @location.address.present? - = link_to_add_fields 'Add a street address', f, :address + = link_to_add_fields t('admin.buttons.add_street_address'), f, :address diff --git a/app/views/admin/locations/forms/_address_fields.html.haml b/app/views/admin/locations/forms/_address_fields.html.haml index b20af8426..f24cca241 100644 --- a/app/views/admin/locations/forms/_address_fields.html.haml +++ b/app/views/admin/locations/forms/_address_fields.html.haml @@ -30,4 +30,4 @@ .col-sm-2 = f.text_field :country, maxlength: 2, class: 'form-control' = f.hidden_field :_destroy - = link_to 'Delete this address permanently', '#', class: 'btn btn-danger delete_association' + = link_to t('admin.buttons.delete_street_address'), '#', class: 'btn btn-danger delete_association' diff --git a/app/views/admin/locations/forms/_admin_email_fields.html.haml b/app/views/admin/locations/forms/_admin_email_fields.html.haml index 562e50842..0e31e9177 100644 --- a/app/views/admin/locations/forms/_admin_email_fields.html.haml +++ b/app/views/admin/locations/forms/_admin_email_fields.html.haml @@ -2,5 +2,5 @@ .row .col-sm-6 = email_field_tag 'location[admin_emails][]', '', class: 'form-control' - = link_to 'Delete this admin permanently', '#', class: 'btn btn-danger delete_attribute' + = link_to t('admin.buttons.delete_admin'), '#', class: 'btn btn-danger delete_attribute' %hr diff --git a/app/views/admin/locations/forms/_admin_email_fields_for_new_location.html.haml b/app/views/admin/locations/forms/_admin_email_fields_for_new_location.html.haml index c6588f747..3c528ff9e 100644 --- a/app/views/admin/locations/forms/_admin_email_fields_for_new_location.html.haml +++ b/app/views/admin/locations/forms/_admin_email_fields_for_new_location.html.haml @@ -1,5 +1,5 @@ = field_set_tag do = text_field_tag 'location[admin_emails][]', current_admin.email, class: 'form-control' %br - = link_to 'Delete this admin permanently', '#', class: 'btn btn-danger delete_attribute' + = link_to t('admin.buttons.delete_admin'), '#', class: 'btn btn-danger delete_attribute' %hr diff --git a/app/views/admin/locations/forms/_admin_emails.html.haml b/app/views/admin/locations/forms/_admin_emails.html.haml index 67412f8d8..ff8a9012c 100644 --- a/app/views/admin/locations/forms/_admin_emails.html.haml +++ b/app/views/admin/locations/forms/_admin_emails.html.haml @@ -13,6 +13,6 @@ .row %div{ class: "col-sm-6 #{error_class_for(@location, :admin_emails, admin)}" } = email_field_tag 'location[admin_emails][]', admin, class: 'form-control', id: "location_admin_emails_#{i}" - = link_to 'Delete this admin permanently', '#', class: 'btn btn-danger delete_attribute' + = link_to t('admin.buttons.delete_admin'), '#', class: 'btn btn-danger delete_attribute' %hr - = link_to_add_array_fields 'Add a new admin email', :locations, :admin_email + = link_to_add_array_fields t('admin.buttons.add_admin'), :locations, :admin_email diff --git a/app/views/admin/locations/forms/_holiday_schedule_fields.html.haml b/app/views/admin/locations/forms/_holiday_schedule_fields.html.haml index 5a23cf8cc..5793be98b 100644 --- a/app/views/admin/locations/forms/_holiday_schedule_fields.html.haml +++ b/app/views/admin/locations/forms/_holiday_schedule_fields.html.haml @@ -24,5 +24,5 @@ = f.time_select :closes_at, minute_step: 15, prompt: true, ampm: true, ignore_date: true = f.hidden_field :_destroy - = link_to 'Remove this holiday schedule', '#', class: 'btn btn-danger delete_association' + = link_to t('admin.buttons.remove_holiday_schedule'), '#', class: 'btn btn-danger delete_association' %hr diff --git a/app/views/admin/locations/forms/_mail_address.html.haml b/app/views/admin/locations/forms/_mail_address.html.haml index 297a83f23..0102ededc 100644 --- a/app/views/admin/locations/forms/_mail_address.html.haml +++ b/app/views/admin/locations/forms/_mail_address.html.haml @@ -5,4 +5,4 @@ = f.fields_for :mail_address do |builder| = render 'admin/locations/forms/mail_address_fields', f: builder - unless @location.mail_address.present? - = link_to_add_fields 'Add a mailing address', f, :mail_address + = link_to_add_fields t('admin.buttons.add_mailing_address'), f, :mail_address diff --git a/app/views/admin/locations/forms/_mail_address_fields.html.haml b/app/views/admin/locations/forms/_mail_address_fields.html.haml index 039b4644f..dd94c257b 100644 --- a/app/views/admin/locations/forms/_mail_address_fields.html.haml +++ b/app/views/admin/locations/forms/_mail_address_fields.html.haml @@ -35,4 +35,4 @@ .col-sm-2 = f.text_field :country, maxlength: 2, class: 'form-control' = f.hidden_field :_destroy - = link_to 'Delete this mailing address permanently', '#', class: 'btn btn-danger delete_association' + = link_to t('admin.buttons.delete_mailing_address'), '#', class: 'btn btn-danger delete_association' diff --git a/app/views/admin/locations/forms/_new_location_form.html.haml b/app/views/admin/locations/forms/_new_location_form.html.haml index bdd0d2237..8f1f5ad7b 100644 --- a/app/views/admin/locations/forms/_new_location_form.html.haml +++ b/app/views/admin/locations/forms/_new_location_form.html.haml @@ -1,3 +1,3 @@ = render 'admin/locations/forms/fields', f: f -= f.submit 'Create location', class: 'btn btn-primary btn-lg', data: { disable_with: 'Please wait...' } += f.submit t('admin.buttons.create_location'), class: 'btn btn-primary btn-lg', data: { disable_with: 'Please wait...' } diff --git a/app/views/admin/locations/forms/_phone_fields.html.haml b/app/views/admin/locations/forms/_phone_fields.html.haml index ccb70de75..16ec093a0 100644 --- a/app/views/admin/locations/forms/_phone_fields.html.haml +++ b/app/views/admin/locations/forms/_phone_fields.html.haml @@ -33,5 +33,5 @@ .col-md-4 = f.telephone_field :country_prefix, maxlength: 4, class: 'form-control' = f.hidden_field :_destroy - = link_to 'Delete this phone permanently', '#', class: 'btn btn-danger delete_association' + = link_to t('admin.buttons.delete_phone'), '#', class: 'btn btn-danger delete_association' %hr diff --git a/app/views/admin/locations/forms/_phones.html.haml b/app/views/admin/locations/forms/_phones.html.haml index 62ac7bb60..bb03db4b5 100644 --- a/app/views/admin/locations/forms/_phones.html.haml +++ b/app/views/admin/locations/forms/_phones.html.haml @@ -8,4 +8,4 @@ If the phone number belongs to a contact, please move it to the existing contact, or add a new contact. = f.fields_for :phones do |builder| = render 'admin/locations/forms/phone_fields', f: builder - = link_to_add_fields 'Add a new phone number', f, :phones + = link_to_add_fields t('admin.buttons.add_phone'), f, :phones diff --git a/app/views/admin/locations/forms/_regular_schedule_fields.html.haml b/app/views/admin/locations/forms/_regular_schedule_fields.html.haml index e4020df9d..179f53eb8 100644 --- a/app/views/admin/locations/forms/_regular_schedule_fields.html.haml +++ b/app/views/admin/locations/forms/_regular_schedule_fields.html.haml @@ -6,4 +6,4 @@ = f.time_select :closes_at, minute_step: 15, prompt: true, ampm: true = f.hidden_field :_destroy - = link_to 'x', '#', class: 'btn-sm btn-danger delete_association' + = link_to t('admin.buttons.delete_symbol'), '#', class: 'btn-sm btn-danger delete_association' diff --git a/app/views/admin/locations/index.html.haml b/app/views/admin/locations/index.html.haml index 83fec2f4b..9f1608124 100644 --- a/app/views/admin/locations/index.html.haml +++ b/app/views/admin/locations/index.html.haml @@ -15,4 +15,4 @@ - if @locations.present? %p - = link_to 'Add a new location', new_admin_location_path, class: 'btn btn-primary' + = link_to t('admin.buttons.add_location'), new_admin_location_path, class: 'btn btn-primary' diff --git a/app/views/admin/organizations/_confirm_delete_organization.html.haml b/app/views/admin/organizations/_confirm_delete_organization.html.haml index cc04a6bd9..0d83e06ba 100644 --- a/app/views/admin/organizations/_confirm_delete_organization.html.haml +++ b/app/views/admin/organizations/_confirm_delete_organization.html.haml @@ -16,4 +16,4 @@ and all of its associated locations permanently. .modal-footer %button.btn.btn-default{ 'data-dismiss' => 'modal' } Close - = link_to 'I understand the consequences, delete this organization', { action: :destroy, id: org_id }, method: :delete, class: 'btn btn-danger' + = link_to t('admin.buttons.confirm_delete_organization'), { action: :destroy, id: org_id }, method: :delete, class: 'btn btn-danger' diff --git a/app/views/admin/organizations/_form.html.haml b/app/views/admin/organizations/_form.html.haml index 4d3fb61df..c10c81485 100644 --- a/app/views/admin/organizations/_form.html.haml +++ b/app/views/admin/organizations/_form.html.haml @@ -9,7 +9,7 @@ = link_to contact.name, edit_admin_organization_contact_path(@organization, contact) %br %p - = link_to 'Add a new contact', new_admin_organization_contact_path(@organization), class: 'btn btn-primary' + = link_to t('admin.buttons.add_contact'), new_admin_organization_contact_path(@organization), class: 'btn btn-primary' .danger-zone %header @@ -20,7 +20,7 @@ %p Once you delete an organization, there is no going back. Please be certain. %p - = link_to 'Permanently delete this organization', {}, href: '', data: { toggle: 'modal', target: '#modal-window' }, class: 'boxed-action' + = link_to t('admin.buttons.delete_organization'), {}, href: '', data: { toggle: 'modal', target: '#modal-window' }, class: 'boxed-action' .modal.fade#modal-window{ 'aria-hidden' => 'true', 'aria-labelledby' => 'myModalLabel', 'role' => 'dialog', 'tabindex' => '-1' } = render 'admin/organizations/confirm_delete_organization', org_id: @organization.id, org_name: @organization.name @@ -29,4 +29,4 @@ Editing %strong #{@organization.name} - = f.submit 'Save changes & apply edits to database', class: 'btn btn-success', data: { disable_with: 'Please wait...' } + = f.submit t('admin.buttons.save_changes'), class: 'btn btn-success', data: { disable_with: 'Please wait...' } diff --git a/app/views/admin/organizations/forms/_new_organization_form.html.haml b/app/views/admin/organizations/forms/_new_organization_form.html.haml index f82601ba4..f6ed317c1 100644 --- a/app/views/admin/organizations/forms/_new_organization_form.html.haml +++ b/app/views/admin/organizations/forms/_new_organization_form.html.haml @@ -1,3 +1,3 @@ = render 'admin/organizations/forms/fields', f: f -= f.submit 'Create organization', class: 'btn btn-primary btn-lg', data: { disable_with: 'Please wait...' } += f.submit t('admin.buttons.create_organization'), class: 'btn btn-primary btn-lg', data: { disable_with: 'Please wait...' } diff --git a/app/views/admin/programs/_confirm_delete_program.html.haml b/app/views/admin/programs/_confirm_delete_program.html.haml index 9502edd54..9caa9ac7e 100644 --- a/app/views/admin/programs/_confirm_delete_program.html.haml +++ b/app/views/admin/programs/_confirm_delete_program.html.haml @@ -16,4 +16,4 @@ and all of its associated services permanently. .modal-footer %button.btn.btn-default{ 'data-dismiss' => 'modal' } Close - = link_to 'I understand the consequences, delete this program', { action: :destroy, id: program_id }, method: :delete, class: 'btn btn-danger' + = link_to t('admin.buttons.confirm_delete_program'), { action: :destroy, id: program_id }, method: :delete, class: 'btn btn-danger' diff --git a/app/views/admin/programs/forms/_danger.html.haml b/app/views/admin/programs/forms/_danger.html.haml index db8cd39f6..434eb6f0f 100644 --- a/app/views/admin/programs/forms/_danger.html.haml +++ b/app/views/admin/programs/forms/_danger.html.haml @@ -7,6 +7,6 @@ %p Once you delete a program, there is no going back. All of the program's services will be deleted as well. Please be certain. %p - = link_to 'Permanently delete this program', {}, href: '', data: { toggle: 'modal', target: '#modal-window' }, class: 'boxed-action' + = link_to t('admin.buttons.delete_program'), {}, href: '', data: { toggle: 'modal', target: '#modal-window' }, class: 'boxed-action' .modal.fade#modal-window{ 'aria-hidden' => 'true', 'aria-labelledby' => 'myModalLabel', 'role' => 'dialog', 'tabindex' => '-1' } = render 'admin/programs/confirm_delete_program', program_id: @program.id, program_name: @program.name diff --git a/app/views/admin/programs/forms/_editing.html.haml b/app/views/admin/programs/forms/_editing.html.haml index ec77f4a29..e569891ab 100644 --- a/app/views/admin/programs/forms/_editing.html.haml +++ b/app/views/admin/programs/forms/_editing.html.haml @@ -3,4 +3,4 @@ Editing %strong #{@program.name} - = f.submit 'Save changes & apply edits to database', class: 'btn btn-success', data: { disable_with: 'Please wait...' } + = f.submit t('admin.buttons.save_changes'), class: 'btn btn-success', data: { disable_with: 'Please wait...' } diff --git a/app/views/admin/programs/forms/_new_program_form.html.haml b/app/views/admin/programs/forms/_new_program_form.html.haml index 9871bd2a5..5bf29bb2b 100644 --- a/app/views/admin/programs/forms/_new_program_form.html.haml +++ b/app/views/admin/programs/forms/_new_program_form.html.haml @@ -1,3 +1,3 @@ = render 'admin/programs/forms/fields', f: f -= f.submit 'Create program', class: 'btn btn-primary btn-lg', data: { disable_with: 'Please wait...' } += f.submit t('admin.buttons.create_program'), class: 'btn btn-primary btn-lg', data: { disable_with: 'Please wait...' } diff --git a/app/views/admin/programs/index.html.haml b/app/views/admin/programs/index.html.haml index 701c435c0..bbaf348d0 100644 --- a/app/views/admin/programs/index.html.haml +++ b/app/views/admin/programs/index.html.haml @@ -16,4 +16,4 @@ = paginate @programs - if Pundit.policy_scope!(current_admin, Organization).present? - = link_to 'Add a new program', new_admin_program_path, class: 'btn btn-primary' + = link_to t('admin.buttons.add_program'), new_admin_program_path, class: 'btn btn-primary' diff --git a/app/views/admin/services/_confirm_delete_service.html.haml b/app/views/admin/services/_confirm_delete_service.html.haml index 36dc0544d..0d05e3625 100644 --- a/app/views/admin/services/_confirm_delete_service.html.haml +++ b/app/views/admin/services/_confirm_delete_service.html.haml @@ -15,4 +15,4 @@ #{service_name || service_id}. .modal-footer %button.btn.btn-default{ 'data-dismiss' => 'modal' } Close - = link_to 'I understand the consequences, delete this service', { action: :destroy, id: service_id, name: service_name }, method: :delete, class: 'btn btn-danger' + = link_to t('admin.buttons.confirm_delete_service'), { action: :destroy, id: service_id, name: service_name }, method: :delete, class: 'btn btn-danger' diff --git a/app/views/admin/services/_form.html.haml b/app/views/admin/services/_form.html.haml index b1b189e3f..219bf5d57 100644 --- a/app/views/admin/services/_form.html.haml +++ b/app/views/admin/services/_form.html.haml @@ -9,7 +9,7 @@ = link_to contact.name, edit_admin_location_service_contact_path(@location, @service, contact) %br %p - = link_to 'Add a new contact', new_admin_location_service_contact_path(@location, @service), class: 'btn btn-primary' + = link_to t('admin.buttons.add_contact'), new_admin_location_service_contact_path(@location, @service), class: 'btn btn-primary' = render 'admin/services/forms/service_locations' @@ -22,7 +22,7 @@ %p Once you delete a service, there is no going back. Please be certain. %p - = link_to 'Permanently delete this service', {}, href: '', data: { toggle: 'modal', target: '#modal-window' }, class: 'boxed-action' + = link_to t('admin.buttons.delete_service'), {}, href: '', data: { toggle: 'modal', target: '#modal-window' }, class: 'boxed-action' .modal.fade#modal-window{ 'aria-hidden' => 'true', 'aria-labelledby' => 'myModalLabel', 'role' => 'dialog', 'tabindex' => '-1' } = render 'admin/services/confirm_delete_service', service_id: @service.id, service_name: @service.name @@ -31,4 +31,4 @@ Editing %strong #{@service.name} / #{@location.name} - = f.submit 'Save changes & apply edits to database', class: 'btn btn-success', data: { disable_with: 'Please wait...' } + = f.submit t('admin.buttons.save_changes'), class: 'btn btn-success', data: { disable_with: 'Please wait...' } diff --git a/app/views/admin/services/forms/_new_service_form.html.haml b/app/views/admin/services/forms/_new_service_form.html.haml index 982d359a1..d15cde297 100644 --- a/app/views/admin/services/forms/_new_service_form.html.haml +++ b/app/views/admin/services/forms/_new_service_form.html.haml @@ -7,4 +7,4 @@ Creating service for %strong #{@location.name} - = f.submit 'Create service', class: 'btn btn-success', data: { disable_with: 'Please wait...' } + = f.submit t('admin.buttons.create_service'), class: 'btn btn-success', data: { disable_with: 'Please wait...' } diff --git a/app/views/admin/shared/_navigation_links.html.haml b/app/views/admin/shared/_navigation_links.html.haml index a1b8458e8..7f72ec7be 100644 --- a/app/views/admin/shared/_navigation_links.html.haml +++ b/app/views/admin/shared/_navigation_links.html.haml @@ -1,14 +1,14 @@ - if admin_signed_in? %li - = link_to 'Edit account', edit_admin_registration_path + = link_to t('navigation.edit_account'), edit_admin_registration_path %li - = link_to 'Organizations', admin_organizations_path + = link_to t('admin.buttons.organizations'), admin_organizations_path %li - = link_to 'Locations', admin_locations_path + = link_to t('admin.buttons.locations'), admin_locations_path %li - = link_to 'Services', admin_services_path + = link_to t('admin.buttons.services'), admin_services_path %li - = link_to 'Sign out', destroy_admin_session_path, method: 'delete' + = link_to t('navigation.sign_out'), destroy_admin_session_path, method: 'delete' %ul.nav.navbar-nav.navbar-right %li = link_to "Hi, #{current_admin.name}", '#', class: 'logged-in' diff --git a/app/views/admin/shared/forms/_holiday_hours.html.haml b/app/views/admin/shared/forms/_holiday_hours.html.haml index c0b7ad22c..22ac003ed 100644 --- a/app/views/admin/shared/forms/_holiday_hours.html.haml +++ b/app/views/admin/shared/forms/_holiday_hours.html.haml @@ -4,4 +4,4 @@ Holiday Hours of operation = f.fields_for :holiday_schedules do |builder| = render 'admin/locations/forms/holiday_schedule_fields', f: builder - = link_to_add_fields 'Add holiday schedule', f, :holiday_schedules + = link_to_add_fields I18n.t('admin.buttons.add_holiday_schedule'), f, :holiday_schedules diff --git a/app/views/admin/shared/forms/_hours.html.haml b/app/views/admin/shared/forms/_hours.html.haml index b8b98ec66..b54bfae49 100644 --- a/app/views/admin/shared/forms/_hours.html.haml +++ b/app/views/admin/shared/forms/_hours.html.haml @@ -4,4 +4,4 @@ Hours of operation = f.fields_for :regular_schedules do |builder| = render 'admin/locations/forms/regular_schedule_fields', f: builder - = link_to_add_fields 'Add hours of operation', f, :regular_schedules + = link_to_add_fields I18n.t('admin.buttons.add_hours_of_operation'), f, :regular_schedules diff --git a/app/views/api_applications/_form.html.haml b/app/views/api_applications/_form.html.haml index 7460233cf..ffa06c6e6 100644 --- a/app/views/api_applications/_form.html.haml +++ b/app/views/api_applications/_form.html.haml @@ -16,8 +16,8 @@ = f.text_field :callback_url, class: 'form-control' - if f.object.new_record? .actions - = f.submit 'Register application', class: 'btn btn-primary' + = f.submit t('buttons.register_application'), class: 'btn btn-primary' - else .actions - = f.submit 'Update application', class: 'btn btn-success' - = link_to 'Delete application', { action: :destroy, id: @api_application.id }, method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-danger' + = f.submit t('buttons.update_application'), class: 'btn btn-success' + = link_to t('buttons.delete_application'), { action: :destroy, id: @api_application.id }, method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-danger' diff --git a/app/views/api_applications/index.html.haml b/app/views/api_applications/index.html.haml index 8ba0584c4..617116695 100644 --- a/app/views/api_applications/index.html.haml +++ b/app/views/api_applications/index.html.haml @@ -6,4 +6,4 @@ %li = link_to "#{api_application.name} (#{api_application.main_url})", api_application_path(api_application) %br -= link_to 'Register new application', new_api_application_path, class: 'btn btn-primary' += link_to t('buttons.register_new_application'), new_api_application_path, class: 'btn btn-primary' diff --git a/app/views/devise/confirmations/new.html.haml b/app/views/devise/confirmations/new.html.haml index dfba5d445..dc4bb156e 100644 --- a/app/views/devise/confirmations/new.html.haml +++ b/app/views/devise/confirmations/new.html.haml @@ -5,6 +5,6 @@ .form-group = f.label :email = f.email_field :email, autofocus: true, class: 'form-control' - = f.submit 'Resend confirmation instructions', class: 'button center' + = f.submit t('buttons.resend_confirmation_instructions'), class: 'button center' %br - = render 'devise/shared/links' \ No newline at end of file + = render 'devise/shared/links' diff --git a/app/views/devise/passwords/edit.html.haml b/app/views/devise/passwords/edit.html.haml index a085c06e6..5c66266d1 100644 --- a/app/views/devise/passwords/edit.html.haml +++ b/app/views/devise/passwords/edit.html.haml @@ -9,6 +9,6 @@ .form-group = f.label :password_confirmation, 'Confirm new password' = f.password_field :password_confirmation, autocomplete: 'off', class: 'form-control' - = f.submit 'Change my password', class: 'button right' + = f.submit t('buttons.change_my_password'), class: 'button right' %br = render 'devise/shared/links' diff --git a/app/views/devise/passwords/new.html.haml b/app/views/devise/passwords/new.html.haml index e1e79e20a..73ec4ddf6 100644 --- a/app/views/devise/passwords/new.html.haml +++ b/app/views/devise/passwords/new.html.haml @@ -7,6 +7,6 @@ .form-group = f.label :email = f.email_field :email, autofocus: true, class: 'form-control' - = f.submit 'Send me reset password instructions', class: 'button center' + = f.submit t('buttons.send_reset_password_instructions'), class: 'button center' %br = render 'devise/shared/links' diff --git a/app/views/devise/registrations/edit.html.haml b/app/views/devise/registrations/edit.html.haml index 13ffb4950..4e8cfe21f 100644 --- a/app/views/devise/registrations/edit.html.haml +++ b/app/views/devise/registrations/edit.html.haml @@ -26,9 +26,9 @@ .form-group = f.label :current_password = f.password_field :current_password, autocomplete: 'off', class: 'form-control' - = f.submit 'Update', class: 'btn btn-success' + = f.submit t('buttons.update'), class: 'btn btn-success' %h3 Cancel Account %p Unhappy? We'll be sad to see you go. -= button_to 'Cancel my account', registration_path(resource_name), data: { confirm: 'Are you sure?' }, method: :delete, class: 'btn btn-danger' += button_to t('buttons.cancel_my_account'), registration_path(resource_name), data: { confirm: 'Are you sure?' }, method: :delete, class: 'btn btn-danger' diff --git a/app/views/devise/registrations/new.html.haml b/app/views/devise/registrations/new.html.haml index d0a88efbb..6421841ab 100644 --- a/app/views/devise/registrations/new.html.haml +++ b/app/views/devise/registrations/new.html.haml @@ -15,6 +15,6 @@ .form-group = f.label :password_confirmation = f.password_field :password_confirmation, autocomplete: 'off', class: 'form-control' - = f.submit 'Sign up', class: 'button right' + = f.submit t('navigation.sign_up'), class: 'button right' %br = render 'devise/shared/links' diff --git a/app/views/devise/sessions/new.html.haml b/app/views/devise/sessions/new.html.haml index 0d78d2a91..8c0a90f56 100644 --- a/app/views/devise/sessions/new.html.haml +++ b/app/views/devise/sessions/new.html.haml @@ -13,7 +13,7 @@ = f.label :password = f.password_field :password, autocomplete: 'off', class: 'form-control' - = f.submit 'Sign in', class: 'button right' + = f.submit t('navigation.sign_in'), class: 'button right' .form-group = f.check_box :remember_me diff --git a/app/views/devise/shared/_links.html.haml b/app/views/devise/shared/_links.html.haml index d487542d9..53e76b232 100644 --- a/app/views/devise/shared/_links.html.haml +++ b/app/views/devise/shared/_links.html.haml @@ -1,19 +1,19 @@ - if controller_name != 'sessions' - = link_to 'Sign in', new_session_path(resource_name) + = link_to t('navigation.sign_in'), new_session_path(resource_name) %br/ - if devise_mapping.registerable? && controller_name != 'registrations' - = link_to 'Sign up', new_registration_path(resource_name) + = link_to t('navigation.sign_up'), new_registration_path(resource_name) %br/ - if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' - = link_to 'Forgot your password?', new_password_path(resource_name) + = link_to t('navigation.forgot_your_password'), new_password_path(resource_name) %br/ - if devise_mapping.confirmable? && controller_name != 'confirmations' - = link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) + = link_to t('navigation.no_confirmation_instructions'), new_confirmation_path(resource_name) %br/ - if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' - = link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) + = link_to t('navigation.no_unlock_instructions'), new_unlock_path(resource_name) %br/ - if devise_mapping.omniauthable? - resource_class.omniauth_providers.each do |provider| - = link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider) + = link_to "#{t('navigation.sign_in_with')} #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider) %br/ diff --git a/app/views/home/index.html.haml b/app/views/home/index.html.haml index 4d886e10c..098b8f5da 100644 --- a/app/views/home/index.html.haml +++ b/app/views/home/index.html.haml @@ -2,7 +2,7 @@ - if user_signed_in? %p - Welcome back, #{@user.name}! #{link_to 'Register a new application', new_api_application_path} or #{link_to 'view', api_applications_path} your existing ones. + Welcome back, #{@user.name}! #{link_to t('links.register_a_new_application'), new_api_application_path} or #{link_to t('links.view'), api_applications_path} your existing ones. - else %p Welcome to the #{t('titles.brand')} developer portal! @@ -14,4 +14,4 @@ Read the #{link_to 'documentation', 'http://codeforamerica.github.io/ohana-api-docs/'} to learn more. If you're a Ruby developer, we encourage you to use the official #{link_to 'Ohanakapa', 'https://github.com/codeforamerica/ohanakapa-ruby'} Ruby library. %p - #{link_to 'Sign up', new_user_registration_path} for a developer account, or #{link_to 'sign in', new_user_session_path}. + #{link_to t('navigation.sign_up'), new_user_registration_path} for a developer account, or #{link_to t('navigation.sign_in'), new_user_session_path}. diff --git a/app/views/shared/_navigation_links.html.haml b/app/views/shared/_navigation_links.html.haml index ffd0297f2..8a737a8fd 100644 --- a/app/views/shared/_navigation_links.html.haml +++ b/app/views/shared/_navigation_links.html.haml @@ -1,15 +1,15 @@ - if user_signed_in? %li - = link_to 'Edit account', edit_user_registration_path + = link_to t('navigation.edit_account'), edit_user_registration_path %li - = link_to 'Your apps', api_applications_path + = link_to t('navigation.your_apps'), api_applications_path %li - = link_to 'Sign out', destroy_user_session_path, method: 'delete' + = link_to t('navigation.sign_out'), destroy_user_session_path, method: 'delete' %ul.nav.navbar-nav.navbar-right %li = link_to "Hi, #{current_user.name}", '#', class: 'logged-in' - else %li - = link_to 'Sign in', new_user_session_path + = link_to t('navigation.sign_in'), new_user_session_path %li - = link_to 'Sign up', new_user_registration_path \ No newline at end of file + = link_to t('navigation.sign_up'), new_user_registration_path diff --git a/config/locales/en.yml b/config/locales/en.yml index 87eb43c39..34d64e830 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -29,10 +29,48 @@ en: admin: api_location: 'San Mateo County' buttons: + organizations: 'Organizations' + locations: 'Locations' + services: 'Services' + programs: 'Programs' + add_organization: 'Add a new organization' + create_organization: 'Create organization' + delete_organization: 'Permanently delete this organization' + confirm_delete_organization: 'I understand the consequences, delete this organization' + add_location: 'Add a new location' + create_location: 'Create location' + delete_location: 'Permanently delete this location' + confirm_delete_location: 'I understand the consequences, delete this location' + add_program: 'Add a new program' + create_program: 'Create program' + delete_program: 'Permanently delete this program' + confirm_delete_program: 'I understand the consequences, delete this program' + add_service: 'Add a new service' + create_service: 'Create service' + delete_service: 'Permanently delete this service' + confirm_delete_service: 'I understand the consequences, delete this service' + add_contact: 'Add a new contact' + create_contact: 'Create contact' + delete_contact: 'Permanently delete this contact' + add_street_address: 'Add a street address' + delete_street_address: 'Delete this address permanently' + add_mailing_address: 'Add a mailing address' + delete_mailing_address: 'Delete this mailing address permanently' + add_phone: 'Add a new phone number' + delete_phone: 'Delete this phone permanently' + add_hours_of_operation: 'Add hours of operation' + add_holiday_schedule: 'Add hoiday schedule' + remove_holiday_schedule: 'Remove this holiday schedule' + add_admin: 'Add a new admin email' + delete_admin: 'Delete this admin permanently' + add_keyword: 'Add a new keyword' + delete_keyword: 'Delete this keyword permanently' + save_changes: 'Save changes & apply edits to database' + delete_symbol: 'x' download_zip_file: 'Download zip file' generate_zip_file: 'Generate zip file' - not_authorized: 'You are not authorized to perform this action.' - notices: + not_authorized: 'You are not authorized to perform this action.' + notices: zip_file_generation: > Your zip file is being generated. Please refresh the page in a few seconds. Once it's ready, the button at the bottom will change from @@ -91,3 +129,28 @@ en: brand: "Ohana API" admin: "%{brand} Admin" developer: "%{brand} Developers" + + navigation: + edit_account: 'Edit account' + your_apps: 'Your apps' + sign_in: 'Sign in' + sign_in_with: 'Sign in with' + sign_up: 'Sign up' + sign_out: 'Sign out' + forgot_your_password: 'Forgot your password?' + no_confirmation_instructions: "Didn't receive confirmation instructions?" + no_unlock_instructions: "Didn't receive unlock instructions?" + buttons: + update: 'Update' + cancel_my_account: 'Cancel my account' + resend_confirmation_instructions: 'Resend confirmation instructions' + send_reset_password_instructions: 'Send me reset password instructions' + change_my_password: 'Change my password' + register_application: 'Register application' + register_new_application: 'Register new application' + register_a_new_applicaiton: 'Register a new application' + update_application: 'Update application' + delete_application: 'Delete application' + links: + register_a_new_application: 'Register a new application' + view: 'view' diff --git a/spec/features/admin/contacts/create_contact_spec.rb b/spec/features/admin/contacts/create_contact_spec.rb index 388e622c3..4fd7e839c 100644 --- a/spec/features/admin/contacts/create_contact_spec.rb +++ b/spec/features/admin/contacts/create_contact_spec.rb @@ -5,26 +5,26 @@ create(:location) login_super_admin visit('/admin/locations/vrs-services') - click_link 'Add a new contact' + click_link I18n.t('admin.buttons.add_contact') end scenario 'with all required fields' do fill_in 'contact_name', with: 'New VRS Services contact' - click_button 'Create contact' + click_button I18n.t('admin.buttons.create_contact') click_link 'New VRS Services contact' expect(find_field('contact_name').value).to eq 'New VRS Services contact' end scenario 'without any required fields' do - click_button 'Create contact' + click_button I18n.t('admin.buttons.create_contact') expect(page).to have_content "Name can't be blank for Contact" end scenario 'with email' do fill_in 'contact_name', with: 'New VRS Services contact' fill_in 'contact_email', with: 'foo@bar.com' - click_button 'Create contact' + click_button I18n.t('admin.buttons.create_contact') click_link 'New VRS Services contact' expect(find_field('contact_email').value).to eq 'foo@bar.com' @@ -33,7 +33,7 @@ scenario 'with department' do fill_in 'contact_name', with: 'New VRS Services contact' fill_in 'contact_department', with: 'new department' - click_button 'Create contact' + click_button I18n.t('admin.buttons.create_contact') click_link 'New VRS Services contact' expect(find_field('contact_department').value).to eq 'new department' @@ -42,7 +42,7 @@ scenario 'with title' do fill_in 'contact_name', with: 'New VRS Services contact' fill_in 'contact_title', with: 'CTO' - click_button 'Create contact' + click_button I18n.t('admin.buttons.create_contact') click_link 'New VRS Services contact' expect(find_field('contact_title').value).to eq 'CTO' diff --git a/spec/features/admin/contacts/delete_contact_spec.rb b/spec/features/admin/contacts/delete_contact_spec.rb index a04261884..b7121838a 100644 --- a/spec/features/admin/contacts/delete_contact_spec.rb +++ b/spec/features/admin/contacts/delete_contact_spec.rb @@ -10,7 +10,7 @@ end scenario 'when deleting contact' do - find_link('Permanently delete this contact').click + find_link(I18n.t('admin.buttons.delete_contact')).click using_wait_time 1 do expect(current_path).to eq admin_location_path(@location) expect(page).not_to have_link 'Moncef Belyamani' diff --git a/spec/features/admin/contacts/update_department_spec.rb b/spec/features/admin/contacts/update_department_spec.rb index 96b1ca693..184953d11 100644 --- a/spec/features/admin/contacts/update_department_spec.rb +++ b/spec/features/admin/contacts/update_department_spec.rb @@ -11,7 +11,7 @@ scenario 'with valid department' do fill_in 'contact_department', with: 'CFO' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_content 'Contact was successfully updated.' expect(find_field('contact_department').value).to eq 'CFO' end diff --git a/spec/features/admin/contacts/update_email_spec.rb b/spec/features/admin/contacts/update_email_spec.rb index d0a55e20f..bfc6dbdc8 100644 --- a/spec/features/admin/contacts/update_email_spec.rb +++ b/spec/features/admin/contacts/update_email_spec.rb @@ -11,13 +11,13 @@ scenario 'with invalid email' do fill_in 'contact_email', with: 'foobar' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_content 'is not a valid email' end scenario 'with valid email' do fill_in 'contact_email', with: 'foo@bar.com' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_content 'Contact was successfully updated.' expect(find_field('contact_email').value).to eq 'foo@bar.com' end diff --git a/spec/features/admin/contacts/update_name_spec.rb b/spec/features/admin/contacts/update_name_spec.rb index 594b41d4b..408e505b4 100644 --- a/spec/features/admin/contacts/update_name_spec.rb +++ b/spec/features/admin/contacts/update_name_spec.rb @@ -11,13 +11,13 @@ scenario 'with empty name' do fill_in 'contact_name', with: '' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_content "Name can't be blank for Contact" end scenario 'with valid name' do fill_in 'contact_name', with: 'Monfresh' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_content 'Contact was successfully updated.' expect(find_field('contact_name').value).to eq 'Monfresh' end diff --git a/spec/features/admin/contacts/update_title_spec.rb b/spec/features/admin/contacts/update_title_spec.rb index c4b283a27..f18623048 100644 --- a/spec/features/admin/contacts/update_title_spec.rb +++ b/spec/features/admin/contacts/update_title_spec.rb @@ -11,7 +11,7 @@ scenario 'with valid title' do fill_in 'contact_title', with: 'CFO' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_content 'Contact was successfully updated.' expect(find_field('contact_title').value).to eq 'CFO' end diff --git a/spec/features/admin/dashboard_spec.rb b/spec/features/admin/dashboard_spec.rb index a2bb7f5f9..cf7e4b2b0 100644 --- a/spec/features/admin/dashboard_spec.rb +++ b/spec/features/admin/dashboard_spec.rb @@ -12,7 +12,7 @@ it 'includes a link to the sign up page' do within '#main' do - expect(page).to have_link 'Sign up', href: new_admin_registration_path + expect(page).to have_link I18n.t('navigation.sign_up'), href: new_admin_registration_path end end @@ -24,7 +24,7 @@ it 'does not include a link to Your locations in the navigation' do within '.navbar' do - expect(page).not_to have_link 'Locations', href: admin_locations_path + expect(page).not_to have_link I18n.t('admin.navigation.locations'), href: admin_locations_path end end @@ -49,54 +49,54 @@ it 'includes a link to organizations in the body' do within '.content' do expect(page). - to have_link 'Organizations', href: admin_organizations_path + to have_link I18n.t('admin.buttons.organizations'), href: admin_organizations_path end end it 'includes a link to locations in the body' do within '.content' do expect(page). - to have_link 'Locations', href: admin_locations_path + to have_link I18n.t('admin.buttons.locations'), href: admin_locations_path end end it 'includes a link to services in the body' do within '.content' do expect(page). - to have_link 'Services', href: admin_services_path + to have_link I18n.t('admin.buttons.services'), href: admin_services_path end end it 'includes a link to programs in the body' do within '.content' do expect(page). - to have_link 'Programs', href: admin_programs_path + to have_link I18n.t('admin.buttons.programs'), href: admin_programs_path end end it 'does not include a link to the sign up page in the navigation' do within '.navbar' do - expect(page).not_to have_link 'Sign up' + expect(page).not_to have_link I18n.t('navigation.sign_up') end end it 'does not include a link to the sign in page in the navigation' do within '.navbar' do - expect(page).not_to have_link 'Sign in' + expect(page).not_to have_link I18n.t('navigation.sign_in') end end it 'includes a link to sign out in the navigation' do within '.navbar' do expect(page). - to have_link 'Sign out', href: destroy_admin_session_path + to have_link I18n.t('navigation.sign_out'), href: destroy_admin_session_path end end it 'includes a link to the Edit Account page in the navigation' do within '.navbar' do expect(page). - to have_link 'Edit account', href: edit_admin_registration_path + to have_link I18n.t('navigation.edit_account'), href: edit_admin_registration_path end end @@ -108,32 +108,32 @@ it 'includes a link to locations in the navigation' do within '.navbar' do - expect(page).to have_link 'Locations', href: admin_locations_path + expect(page).to have_link I18n.t('admin.buttons.locations'), href: admin_locations_path end end it 'includes a link to organizations in the navigation' do within '.navbar' do - expect(page).to have_link 'Organizations', href: admin_organizations_path + expect(page).to have_link I18n.t('admin.buttons.organizations'), href: admin_organizations_path end end it 'includes a link to services in the navigation' do within '.navbar' do - expect(page).to have_link 'Services', href: admin_services_path + expect(page).to have_link I18n.t('admin.buttons.services'), href: admin_services_path end end it 'does not display a link to add a new organization' do - expect(page).not_to have_link 'Add a new organization', new_admin_organization_path + expect(page).not_to have_link I18n.t('admin.buttons.add_organization'), new_admin_organization_path end it 'does not display a link to add a new location' do - expect(page).to_not have_link 'Add a new location', new_admin_location_path + expect(page).to_not have_link I18n.t('admin.buttons.add_location'), new_admin_location_path end it 'does not display a link to add a new program' do - expect(page).to_not have_link 'Add a new program', new_admin_program_path + expect(page).to_not have_link I18n.t('admin.buttons.add_program'), new_admin_program_path end it 'does not display a link to download CSV' do @@ -152,15 +152,15 @@ end it 'displays a link to add a new organization' do - expect(page).to have_link 'Add a new organization', new_admin_organization_path + expect(page).to have_link I18n.t('admin.buttons.add_organization'), new_admin_organization_path end it 'does not display a link to add a new location' do - expect(page).to_not have_link 'Add a new location', new_admin_location_path + expect(page).to_not have_link I18n.t('admin.buttons.add_location'), new_admin_location_path end it 'does not display a link to add a new program' do - expect(page).to_not have_link 'Add a new program', new_admin_program_path + expect(page).to_not have_link I18n.t('admin.buttons.add_program'), new_admin_program_path end end @@ -172,11 +172,11 @@ end it 'displays a link to add a new location' do - expect(page).to have_link 'Add a new location', new_admin_location_path + expect(page).to have_link I18n.t('admin.buttons.add_location'), new_admin_location_path end it 'displays a link to add a new program' do - expect(page).to have_link 'Add a new program', new_admin_program_path + expect(page).to have_link I18n.t('admin.buttons.add_program'), new_admin_program_path end it 'displays link to generate zip file' do diff --git a/spec/features/admin/edit_account_spec.rb b/spec/features/admin/edit_account_spec.rb index 8c2a3b555..86e8a89eb 100644 --- a/spec/features/admin/edit_account_spec.rb +++ b/spec/features/admin/edit_account_spec.rb @@ -9,7 +9,7 @@ it 'allows the name to be changed' do fill_in 'admin_name', with: 'New Admin name' fill_in 'admin_current_password', with: @admin.password - click_button 'Update' + click_button I18n.t('buttons.update') visit '/admin/edit' expect(find_field('admin_name').value).to eq 'New Admin name' end @@ -17,7 +17,7 @@ it 'redirects to the admin edit page after update' do fill_in 'admin_name', with: 'New Admin name' fill_in 'admin_current_password', with: @admin.password - click_button 'Update' + click_button I18n.t('buttons.update') expect(current_path).to eq edit_admin_registration_path end end diff --git a/spec/features/admin/locations/ability_to_add_admin_email_spec.rb b/spec/features/admin/locations/ability_to_add_admin_email_spec.rb index 9c1af99b7..074f4a8c3 100644 --- a/spec/features/admin/locations/ability_to_add_admin_email_spec.rb +++ b/spec/features/admin/locations/ability_to_add_admin_email_spec.rb @@ -9,7 +9,7 @@ it "doesn't allow adding an admin" do login_admin visit '/admin/locations/vrs-services' - expect(page).to_not have_content 'Add a new admin email' + expect(page).to_not have_content I18n.t('admin.buttons.add_admin') end end @@ -17,7 +17,7 @@ it 'allows adding an admin' do login_super_admin visit '/admin/locations/vrs-services' - expect(page).to have_content 'Add a new admin email' + expect(page).to have_content I18n.t('admin.buttons.add_admin') end end @@ -26,7 +26,7 @@ create(:location_for_org_admin) login_admin visit '/admin/locations/samaritan-house' - expect(page).to have_content 'Add a new admin email' + expect(page).to have_content I18n.t('admin.buttons.add_admin') end end @@ -36,7 +36,7 @@ @location.update!(admin_emails: ['moncef@gmail.com']) login_as_admin(new_admin) visit '/admin/locations/vrs-services' - expect(page).to have_content 'Add a new admin email' + expect(page).to have_content I18n.t('admin.buttons.add_admin') end end end diff --git a/spec/features/admin/locations/create_location_spec.rb b/spec/features/admin/locations/create_location_spec.rb index f1091ad31..ec6f3210c 100644 --- a/spec/features/admin/locations/create_location_spec.rb +++ b/spec/features/admin/locations/create_location_spec.rb @@ -9,7 +9,7 @@ scenario 'with all required fields', :js do fill_in_all_required_fields - click_button 'Create location' + click_button I18n.t('admin.buttons.create_location') expect(current_path).to eq '/admin/locations/new-parent-agency-location' expect(find_field('location_name').value).to eq 'New Parent Agency location' @@ -23,7 +23,7 @@ end scenario 'without any required fields' do - click_button 'Create location' + click_button I18n.t('admin.buttons.create_location') expect(page).to have_content "Unless it's virtual, a location must have an address." expect(page).to have_content "Description can't be blank for Location" expect(page).to have_content "Name can't be blank for Location" @@ -32,7 +32,7 @@ scenario 'with valid mailing address', :js do fill_in_all_required_fields - click_link 'Add a mailing address' + click_link I18n.t('admin.buttons.add_mailing_address') update_mailing_address( attention: 'moncef', address_1: '123', @@ -41,7 +41,7 @@ postal_code: '12345', country: 'US' ) - click_button 'Create location' + click_button I18n.t('admin.buttons.create_location') expect(find_field('location_mail_address_attributes_attention').value). to eq 'moncef' @@ -64,7 +64,7 @@ extension: '1234', vanity_number: '123-ABC-DEFG' ) - click_button 'Create location' + click_button I18n.t('admin.buttons.create_location') expect(find_field('location_phones_attributes_0_number').value). to eq '123-456-7890' @@ -86,7 +86,7 @@ fill_in_all_required_fields fill_in 'location_email', with: 'moncefbelyamani@samaritanhousesanmateo.org' - click_button 'Create location' + click_button I18n.t('admin.buttons.create_location') expect(find_field('location_email').value). to eq 'moncefbelyamani@samaritanhousesanmateo.org' @@ -99,7 +99,7 @@ opens_at_hour: '9 AM', opens_at_minute: '30', closes_at_hour: '5 PM', closes_at_minute: '45' ) - click_button 'Create location' + click_button I18n.t('admin.buttons.create_location') prefix = 'location_regular_schedules_attributes_0' @@ -121,7 +121,7 @@ end_day: '2', closed: 'Closed' ) - click_button 'Create location' + click_button I18n.t('admin.buttons.create_location') prefix = 'location_holiday_schedules_attributes_0' @@ -143,7 +143,7 @@ scenario 'when adding an accessibility option', :js do fill_in_all_required_fields check 'location_accessibility_elevator' - click_button 'Create location' + click_button I18n.t('admin.buttons.create_location') expect(find('#location_accessibility_elevator')).to be_checked end @@ -151,7 +151,7 @@ scenario 'when adding transportation option', :js do fill_in_all_required_fields fill_in 'location_transportation', with: 'SAMTRANS stops within 1/2 mile.' - click_button 'Create location' + click_button I18n.t('admin.buttons.create_location') expect(find_field('location_transportation').value). to eq 'SAMTRANS stops within 1/2 mile.' @@ -160,7 +160,7 @@ scenario 'when adding a website', :js do fill_in_all_required_fields fill_in 'location_website', with: 'http://ruby.com' - click_button 'Create location' + click_button I18n.t('admin.buttons.create_location') expect(find_field('location_website').value).to eq 'http://ruby.com' end @@ -168,7 +168,7 @@ scenario 'when adding an alternate name', :js do fill_in_all_required_fields fill_in 'location_alternate_name', with: 'HSA' - click_button 'Create location' + click_button I18n.t('admin.buttons.create_location') expect(find_field('location_alternate_name').value). to eq 'HSA' @@ -179,7 +179,7 @@ fill_in 'location_name', with: 'New Parent Agency location' fill_in 'location_description', with: 'new description' select('Does not have a physical address', from: 'location_virtual') - click_button 'Create location' + click_button I18n.t('admin.buttons.create_location') expect(find_field('location_virtual').value). to eq 'true' @@ -189,7 +189,7 @@ fill_in_all_required_fields select2('French', 'location_languages', multiple: true) select2('Spanish', 'location_languages', multiple: true) - click_button 'Create location' + click_button I18n.t('admin.buttons.create_location') expect(find_field('location_languages', visible: false).value). to eq %w(French Spanish) diff --git a/spec/features/admin/locations/delete_location_spec.rb b/spec/features/admin/locations/delete_location_spec.rb index 30ae61894..c9c33e00a 100644 --- a/spec/features/admin/locations/delete_location_spec.rb +++ b/spec/features/admin/locations/delete_location_spec.rb @@ -8,8 +8,8 @@ end scenario 'when submitting warning', :js do - find_link('Permanently delete this location').click - find_link('I understand the consequences, delete this location').click + find_link(I18n.t('admin.buttons.delete_location')).click + find_link(I18n.t('admin.buttons.confirm_delete_location')).click using_wait_time 1 do expect(current_path).to eq admin_locations_path expect(page).not_to have_link 'VRS Services' @@ -17,7 +17,7 @@ end scenario 'when canceling warning', :js do - find_link('Permanently delete this location').click + find_link(I18n.t('admin.buttons.delete_location')).click find_button('Close').click visit admin_locations_path expect(page).to have_link 'VRS Services' diff --git a/spec/features/admin/locations/update_accessibility_spec.rb b/spec/features/admin/locations/update_accessibility_spec.rb index 3a767199a..d3bf413f0 100644 --- a/spec/features/admin/locations/update_accessibility_spec.rb +++ b/spec/features/admin/locations/update_accessibility_spec.rb @@ -23,7 +23,7 @@ scenario 'when adding an option' do check 'location_accessibility_elevator' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page). to have_content 'Location was successfully updated.' expect(find('#location_accessibility_elevator')).to be_checked @@ -32,10 +32,10 @@ scenario 'when removing an option' do check 'location_accessibility_restroom' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') visit '/admin/locations/soup-kitchen' uncheck 'location_accessibility_restroom' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page). to have_content 'Location was successfully updated.' expect(find('#location_accessibility_restroom')).to_not be_checked diff --git a/spec/features/admin/locations/update_address_spec.rb b/spec/features/admin/locations/update_address_spec.rb index fe7a4addf..7cbdf34cc 100644 --- a/spec/features/admin/locations/update_address_spec.rb +++ b/spec/features/admin/locations/update_address_spec.rb @@ -19,7 +19,7 @@ remove_street_address visit '/admin/locations/no-address' - expect(page).to have_link 'Add a street address' + expect(page).to have_link I18n.t('admin.buttons.add_street_address') end end @@ -40,56 +40,56 @@ scenario 'with an empty street' do update_street_address(address_1: '', city: 'fair', state_province: 'VA', postal_code: '12345', country: 'US') - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_content "address 1 can't be blank for Address" end scenario 'with an empty city' do update_street_address(address_1: '123', city: '', state_province: 'VA', postal_code: '12345', country: 'US') - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_content "city can't be blank for Address" end scenario 'with an empty state' do update_street_address(address_1: '123', city: 'fair', state_province: '', postal_code: '12345', country: 'US') - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_content t('errors.messages.invalid_state_province') end scenario 'with an empty zip' do update_street_address(address_1: '123', city: 'Belmont', state_province: 'CA', postal_code: '') - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_content "postal code can't be blank for Address" end scenario 'with an empty country' do update_street_address(address_1: '123', city: 'Belmont', state_province: 'CA', postal_code: '12345') - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_content "country can't be blank for Address" end scenario 'with an invalid state' do update_street_address(address_1: '123', city: 'Par', state_province: 'V', postal_code: '12345', country: 'US') - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_content t('errors.messages.invalid_state_province') end scenario 'with an invalid zip' do update_street_address(address_1: '123', city: 'Ald', state_province: 'VA', postal_code: '1234', country: 'US') - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_content 'valid ZIP code' end scenario 'with an invalid country' do update_street_address(address_1: '123', city: 'Ald', state_province: 'VA', postal_code: '12345', country: 'U') - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_content 'too short' end end diff --git a/spec/features/admin/locations/update_admin_emails_spec.rb b/spec/features/admin/locations/update_admin_emails_spec.rb index e53785bcd..e94cbaaf2 100644 --- a/spec/features/admin/locations/update_admin_emails_spec.rb +++ b/spec/features/admin/locations/update_admin_emails_spec.rb @@ -9,7 +9,7 @@ scenario 'when no admin_emails exist' do expect(page).to have_no_xpath("//input[@name='location[admin_emails][]']") - expect(page).to_not have_link 'Delete this admin permanently' + expect(page).to_not have_link I18n.t('admin.buttons.delete_admin') end scenario 'by adding 2 new admins', :js do @@ -22,16 +22,16 @@ end scenario 'with empty admin', :js do - find_link('Add a new admin email').trigger('click') - click_button 'Save changes' + find_link(I18n.t('admin.buttons.add_admin')).trigger('click') + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_no_xpath("//input[@name='location[admin_emails][]']") end scenario 'with 2 admins but one is empty', :js do - find_link('Add a new admin email').trigger('click') + find_link(I18n.t('admin.buttons.add_admin')).trigger('click') fill_in 'location[admin_emails][]', with: 'moncef@samaritanhouse.com' - find_link('Add a new admin email').trigger('click') - click_button 'Save changes' + find_link(I18n.t('admin.buttons.add_admin')).trigger('click') + click_button I18n.t('admin.buttons.save_changes') total_admins = all(:xpath, "//input[@name='location[admin_emails][]']") expect(total_admins.length).to eq 1 end @@ -39,19 +39,19 @@ scenario 'with 2 admin_emails but only one is invalid', :js do @location.update!(admin_emails: ['foo@ruby.org']) visit '/admin/locations/vrs-services' - find_link('Add a new admin email').trigger('click') + find_link(I18n.t('admin.buttons.add_admin')).trigger('click') admin_emails = page. all(:xpath, "//input[@name='location[admin_emails][]']") fill_in admin_emails[-1][:id], with: 'Alexandria' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') total_fields_with_errors = page.all(:css, '.field_with_errors') expect(total_fields_with_errors.length).to eq 1 end scenario 'with invalid admin', :js do - find_link('Add a new admin email').trigger('click') + find_link(I18n.t('admin.buttons.add_admin')).trigger('click') fill_in 'location[admin_emails][]', with: 'moncefsamaritanhouse.com' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page). to have_content 'moncefsamaritanhouse.com is not a valid email' expect(page).to have_css('.field_with_errors') diff --git a/spec/features/admin/locations/update_alternate_name_spec.rb b/spec/features/admin/locations/update_alternate_name_spec.rb index 066b4311a..ff6c58da4 100644 --- a/spec/features/admin/locations/update_alternate_name_spec.rb +++ b/spec/features/admin/locations/update_alternate_name_spec.rb @@ -9,7 +9,7 @@ scenario 'with alternate name' do fill_in 'location_alternate_name', with: 'Juvenile Sexual Responsibility Program' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(find_field('location_alternate_name').value). to eq 'Juvenile Sexual Responsibility Program' end diff --git a/spec/features/admin/locations/update_description_spec.rb b/spec/features/admin/locations/update_description_spec.rb index 6f2adf41b..10a7dcd08 100644 --- a/spec/features/admin/locations/update_description_spec.rb +++ b/spec/features/admin/locations/update_description_spec.rb @@ -9,13 +9,13 @@ scenario 'with empty description' do fill_in 'location_description', with: '' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_content "Description can't be blank for Location" end scenario 'with valid description' do fill_in 'location_description', with: 'This is a description' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(find_field('location_description').value).to eq 'This is a description' end end diff --git a/spec/features/admin/locations/update_email_spec.rb b/spec/features/admin/locations/update_email_spec.rb index 7ecaee3eb..27fa0cd51 100644 --- a/spec/features/admin/locations/update_email_spec.rb +++ b/spec/features/admin/locations/update_email_spec.rb @@ -9,13 +9,13 @@ scenario 'with valid location email' do fill_in 'location_email', with: 'foo@bar.com' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(find_field('location_email').value).to eq 'foo@bar.com' end scenario 'with invalid location email' do fill_in 'location_email', with: 'foobar.com' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_content 'foobar.com is not a valid email' end end diff --git a/spec/features/admin/locations/update_holiday_hours_spec.rb b/spec/features/admin/locations/update_holiday_hours_spec.rb index 68e7453c5..5ba603fb2 100644 --- a/spec/features/admin/locations/update_holiday_hours_spec.rb +++ b/spec/features/admin/locations/update_holiday_hours_spec.rb @@ -15,7 +15,7 @@ end_day: '2', closed: 'Closed' ) - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') prefix = 'location_holiday_schedules_attributes_0' @@ -44,7 +44,7 @@ opens_at_hour: '10 AM', opens_at_minute: '30', closes_at_hour: '3 PM', closes_at_minute: '45' ) - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') prefix = 'location_holiday_schedules_attributes_0' @@ -70,8 +70,8 @@ prefix = 'location_holiday_schedules_attributes_0' expect(find_field("#{prefix}_closed").value).to eq 'true' - click_link 'Remove this holiday schedule' - click_button 'Save changes' + click_link I18n.t('admin.buttons.remove_holiday_schedule') + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_no_field("#{prefix}_closed") end diff --git a/spec/features/admin/locations/update_hours_spec.rb b/spec/features/admin/locations/update_hours_spec.rb index 47c638d05..fbb466cf6 100644 --- a/spec/features/admin/locations/update_hours_spec.rb +++ b/spec/features/admin/locations/update_hours_spec.rb @@ -13,7 +13,7 @@ opens_at_hour: '9 AM', opens_at_minute: '30', closes_at_hour: '5 PM', closes_at_minute: '45' ) - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') prefix = 'location_regular_schedules_attributes_0' @@ -34,9 +34,9 @@ expect(find_field("#{prefix}_weekday").value).to eq '7' within '.hours' do - click_link 'x' + click_link I18n.t('admin.buttons.delete_symbol') end - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_no_field("#{prefix}_weekday") end diff --git a/spec/features/admin/locations/update_languages_spec.rb b/spec/features/admin/locations/update_languages_spec.rb index 40f8985e1..dcfd829ed 100644 --- a/spec/features/admin/locations/update_languages_spec.rb +++ b/spec/features/admin/locations/update_languages_spec.rb @@ -8,20 +8,20 @@ end scenario 'with no languages' do - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(@location.reload.languages).to eq [] end scenario 'with one language', :js do select2('French', 'location_languages', multiple: true) - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(@location.reload.languages).to eq ['French'] end scenario 'with two languages', :js do select2('French', 'location_languages', multiple: true) select2('Spanish', 'location_languages', multiple: true) - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(@location.reload.languages).to eq %w(French Spanish) end @@ -29,7 +29,7 @@ @location.update!(languages: %w(Arabic French)) visit '/admin/locations/vrs-services' first('.select2-search-choice-close').click - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(@location.reload.languages).to eq ['French'] end end diff --git a/spec/features/admin/locations/update_mail_address_spec.rb b/spec/features/admin/locations/update_mail_address_spec.rb index d3c7e6bae..7438fc674 100644 --- a/spec/features/admin/locations/update_mail_address_spec.rb +++ b/spec/features/admin/locations/update_mail_address_spec.rb @@ -31,7 +31,7 @@ remove_mail_address visit '/admin/locations/vrs-services' - expect(page).to have_link 'Add a mailing address' + expect(page).to have_link I18n.t('admin.buttons.add_mailing_address') end scenario 'when leaving location without address or mail address', :js do @@ -58,56 +58,56 @@ scenario 'with an empty street' do update_mailing_address(address_1: '', city: 'fair', state_province: 'VA', postal_code: '12345', country: 'US') - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_content "address 1 can't be blank for Mail Address" end scenario 'with an empty city' do update_mailing_address(address_1: '123', city: '', state_province: 'VA', postal_code: '12345', country: 'US') - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_content "city can't be blank for Mail Address" end scenario 'with an empty state' do update_mailing_address(address_1: '123', city: 'fair', state_province: '', postal_code: '12345', country: 'US') - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_content t('errors.messages.invalid_state_province') end scenario 'with an empty zip' do update_mailing_address(address_1: '123', city: 'Belmont', state_province: 'CA', postal_code: '', country: 'US') - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_content "postal code can't be blank for Mail Address" end scenario 'with an empty country' do update_mailing_address(address_1: '123', city: 'Belmont', state_province: 'CA', postal_code: '12345') - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_content "country can't be blank for Mail Address" end scenario 'with an invalid state' do update_mailing_address(address_1: '123', city: 'Par', state_province: 'V', postal_code: '12345', country: 'US') - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_content t('errors.messages.invalid_state_province') end scenario 'with an invalid zip' do update_mailing_address(address_1: '123', city: 'Ald', state_province: 'VA', postal_code: '1234', country: 'US') - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_content 'valid ZIP code' end scenario 'with an invalid country' do update_mailing_address(address_1: '123', city: 'Ald', state_province: 'VA', postal_code: '12345', country: 'U') - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_content 'too short' end end diff --git a/spec/features/admin/locations/update_name_spec.rb b/spec/features/admin/locations/update_name_spec.rb index bf465d53a..737166cba 100644 --- a/spec/features/admin/locations/update_name_spec.rb +++ b/spec/features/admin/locations/update_name_spec.rb @@ -9,14 +9,14 @@ scenario 'with empty location name' do fill_in 'location_name', with: '' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_content "Name can't be blank for Location" expect(page).to have_css('.field_with_errors') end scenario 'with valid location name' do fill_in 'location_name', with: 'Juvenile Sexual Responsibility Program' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(find_field('location_name').value). to eq 'Juvenile Sexual Responsibility Program' end diff --git a/spec/features/admin/locations/update_phone_numbers_spec.rb b/spec/features/admin/locations/update_phone_numbers_spec.rb index 473ff7f3d..d263110f9 100644 --- a/spec/features/admin/locations/update_phone_numbers_spec.rb +++ b/spec/features/admin/locations/update_phone_numbers_spec.rb @@ -13,7 +13,7 @@ to have_no_xpath('.//input[contains(@name, "[extension]")]') end - expect(page).to_not have_link 'Delete this phone permanently' + expect(page).to_not have_link I18n.t('admin.buttons.delete_phone') end scenario 'by adding a new phone', :js do @@ -24,7 +24,7 @@ extension: '1234', vanity_number: '123-ABC-DEFG' ) - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') visit '/admin/locations/vrs-services' expect(find_field('location_phones_attributes_0_number').value). @@ -56,8 +56,8 @@ department: 'Director of Development', number_type: 'Voice' ) - click_link 'Add a new phone number' - click_button 'Save changes' + click_link I18n.t('admin.buttons.add_phone') + click_button I18n.t('admin.buttons.save_changes') within('.phones') do total_phones = all(:xpath, './/input[contains(@name, "[number]")]') @@ -71,12 +71,12 @@ department: 'Director of Development', number_type: 'Voice' ) - click_link 'Add a new phone number' + click_link I18n.t('admin.buttons.add_phone') within('.phones') do all_phones = all(:xpath, './/input[contains(@name, "[department]")]') fill_in all_phones[-1][:id], with: 'Department' end - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_content "number can't be blank for Phone" end @@ -94,8 +94,8 @@ visit '/admin/locations/library' - find(:xpath, "(//a[text()='Delete this phone permanently'])[2]").click - click_button 'Save changes' + find(:xpath, "(//a[text()='#{I18n.t('admin.buttons.delete_phone')}'])[2]").click + click_button I18n.t('admin.buttons.save_changes') expect(find_field('location_phones_attributes_0_number').value). to eq '123-456-7890' @@ -133,25 +133,25 @@ scenario 'with an empty number' do update_phone(number: '') - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_content "number can't be blank for Phone" end scenario 'with an invalid number' do update_phone(number: '703') - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_content 'is not a valid US phone or fax number' end scenario 'with an invalid extension' do update_phone(number: '703-555-1212', extension: 'x200') - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_content 'extension is not a number' end scenario 'with an empty extension' do update_phone(number: '703-555-1212', extension: '') - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to_not have_content 'extension is not a number' end end diff --git a/spec/features/admin/locations/update_short_description_spec.rb b/spec/features/admin/locations/update_short_description_spec.rb index 265ddbdbd..3a0f6a459 100644 --- a/spec/features/admin/locations/update_short_description_spec.rb +++ b/spec/features/admin/locations/update_short_description_spec.rb @@ -9,13 +9,13 @@ scenario 'with empty description' do fill_in 'location_short_desc', with: '' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(find_field('location_short_desc').value).to eq '' end scenario 'with valid description' do fill_in 'location_short_desc', with: 'This is a short description' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(find_field('location_short_desc').value). to eq 'This is a short description' end diff --git a/spec/features/admin/locations/update_transportation_spec.rb b/spec/features/admin/locations/update_transportation_spec.rb index 479a4eaef..794db3e35 100644 --- a/spec/features/admin/locations/update_transportation_spec.rb +++ b/spec/features/admin/locations/update_transportation_spec.rb @@ -9,13 +9,13 @@ scenario 'with empty transportation options' do fill_in 'location_transportation', with: '' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(find_field('location_transportation').value).to eq '' end scenario 'with non-empty transportation options' do fill_in 'location_transportation', with: 'SAMTRANS stops within 1/2 mile.' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(find_field('location_transportation').value). to eq 'SAMTRANS stops within 1/2 mile.' end diff --git a/spec/features/admin/locations/update_virtual_spec.rb b/spec/features/admin/locations/update_virtual_spec.rb index e8ded3b14..a12663ebd 100644 --- a/spec/features/admin/locations/update_virtual_spec.rb +++ b/spec/features/admin/locations/update_virtual_spec.rb @@ -9,7 +9,7 @@ scenario 'setting to true' do select('Does not have a physical address', from: 'location_virtual') - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(find_field('location_virtual').value).to eq 'true' end end diff --git a/spec/features/admin/locations/update_website_spec.rb b/spec/features/admin/locations/update_website_spec.rb index 0169d514c..6b23c92de 100644 --- a/spec/features/admin/locations/update_website_spec.rb +++ b/spec/features/admin/locations/update_website_spec.rb @@ -9,14 +9,14 @@ scenario 'with invalid website' do fill_in 'location_website', with: 'www.monfresh.com' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_content 'www.monfresh.com is not a valid URL' expect(page).to have_css('.field_with_errors') end scenario 'with valid website' do fill_in 'location_website', with: 'http://codeforamerica.org' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(find_field('location_website').value). to eq 'http://codeforamerica.org' end diff --git a/spec/features/admin/locations/visit_location_spec.rb b/spec/features/admin/locations/visit_location_spec.rb index 616705736..64fb788b6 100644 --- a/spec/features/admin/locations/visit_location_spec.rb +++ b/spec/features/admin/locations/visit_location_spec.rb @@ -66,7 +66,7 @@ expect(page).to have_content I18n.t('admin.not_authorized') expect(current_path).to eq(admin_dashboard_path) visit('/admin/locations') - expect(page).to_not have_link 'Add a new location' + expect(page).to_not have_link I18n.t('admin.buttons.add_location') end end diff --git a/spec/features/admin/locations/visit_locations_spec.rb b/spec/features/admin/locations/visit_locations_spec.rb index f283482e8..ffb641003 100644 --- a/spec/features/admin/locations/visit_locations_spec.rb +++ b/spec/features/admin/locations/visit_locations_spec.rb @@ -49,27 +49,27 @@ it 'does not include a link to the sign up page in the navigation' do within '.navbar' do - expect(page).not_to have_link 'Sign up' + expect(page).not_to have_link I18n.t('navigation.sign_up') end end it 'does not include a link to the sign in page in the navigation' do within '.navbar' do - expect(page).not_to have_link 'Sign in' + expect(page).not_to have_link I18n.t('navigation.sign_in') end end it 'includes a link to sign out in the navigation' do within '.navbar' do expect(page). - to have_link 'Sign out', href: destroy_admin_session_path + to have_link I18n.t('navigation.sign_out'), href: destroy_admin_session_path end end it 'includes a link to the Edit Account page in the navigation' do within '.navbar' do expect(page). - to have_link 'Edit account', href: edit_admin_registration_path + to have_link I18n.t('navigation.edit_account'), href: edit_admin_registration_path end end @@ -81,7 +81,7 @@ it 'includes a link to locations in the navigation' do within '.navbar' do - expect(page).to have_link 'Locations', href: admin_locations_path + expect(page).to have_link I18n.t('admin.buttons.locations'), href: admin_locations_path end end end diff --git a/spec/features/admin/organizations/create_contact_spec.rb b/spec/features/admin/organizations/create_contact_spec.rb index 24045747c..a876327fc 100644 --- a/spec/features/admin/organizations/create_contact_spec.rb +++ b/spec/features/admin/organizations/create_contact_spec.rb @@ -5,7 +5,7 @@ @org = create(:organization) login_super_admin visit '/admin/organizations/parent-agency' - click_link 'Add a new contact' + click_link I18n.t('admin.buttons.add_contact') end it 'creates a contact for the right organization' do @@ -14,21 +14,21 @@ scenario 'with all required fields' do fill_in 'contact_name', with: 'New VRS Services contact' - click_button 'Create contact' + click_button I18n.t('admin.buttons.create_contact') click_link 'New VRS Services contact' expect(find_field('contact_name').value).to eq 'New VRS Services contact' end scenario 'without any required fields' do - click_button 'Create contact' + click_button I18n.t('admin.buttons.create_contact') expect(page).to have_content "Name can't be blank for Contact" end scenario 'with email' do fill_in 'contact_name', with: 'New VRS Services contact' fill_in 'contact_email', with: 'foo@bar.com' - click_button 'Create contact' + click_button I18n.t('admin.buttons.create_contact') click_link 'New VRS Services contact' expect(find_field('contact_email').value).to eq 'foo@bar.com' @@ -37,7 +37,7 @@ scenario 'with department' do fill_in 'contact_name', with: 'New VRS Services contact' fill_in 'contact_department', with: 'new department' - click_button 'Create contact' + click_button I18n.t('admin.buttons.create_contact') click_link 'New VRS Services contact' expect(find_field('contact_department').value).to eq 'new department' @@ -46,7 +46,7 @@ scenario 'with title' do fill_in 'contact_name', with: 'New VRS Services contact' fill_in 'contact_title', with: 'CTO' - click_button 'Create contact' + click_button I18n.t('admin.buttons.create_contact') click_link 'New VRS Services contact' expect(find_field('contact_title').value).to eq 'CTO' @@ -56,7 +56,7 @@ # and the form is already tested there. We just need to make sure # that the form is present for Contacts. scenario 'with phone' do - expect(page).to have_link 'Add a new phone' + expect(page).to have_link I18n.t('admin.buttons.add_phone') end end diff --git a/spec/features/admin/organizations/create_organization_spec.rb b/spec/features/admin/organizations/create_organization_spec.rb index a96117409..0a1587e88 100644 --- a/spec/features/admin/organizations/create_organization_spec.rb +++ b/spec/features/admin/organizations/create_organization_spec.rb @@ -10,7 +10,7 @@ scenario 'with all required fields' do fill_in 'organization_name', with: 'new org' fill_in 'organization_description', with: 'description for new org' - click_button 'Create organization' + click_button I18n.t('admin.buttons.create_organization') click_link 'new org' expect(find_field('organization_name').value).to eq 'new org' @@ -18,7 +18,7 @@ end scenario 'without any required fields' do - click_button 'Create organization' + click_button I18n.t('admin.buttons.create_organization') expect(page).to have_content "Name can't be blank for Organization" expect(page).to have_content "Description can't be blank for Organization" end @@ -27,7 +27,7 @@ fill_in 'organization_name', with: 'new org' fill_in 'organization_description', with: 'description for new org' fill_in 'organization_website', with: 'http://ruby.com' - click_button 'Create organization' + click_button I18n.t('admin.buttons.create_organization') click_link 'new org' expect(find_field('organization_website').value).to eq 'http://ruby.com' @@ -37,7 +37,7 @@ fill_in 'organization_name', with: 'new org' fill_in 'organization_description', with: 'description for new org' fill_in 'organization_alternate_name', with: 'AKA' - click_button 'Create organization' + click_button I18n.t('admin.buttons.create_organization') click_link 'new org' expect(find_field('organization_alternate_name').value).to eq 'AKA' @@ -47,7 +47,7 @@ fill_in 'organization_name', with: 'new org' fill_in 'organization_description', with: 'description for new org' fill_in 'organization_email', with: 'foo@bar.com' - click_button 'Create organization' + click_button I18n.t('admin.buttons.create_organization') click_link 'new org' expect(find_field('organization_email').value).to eq 'foo@bar.com' @@ -57,7 +57,7 @@ fill_in 'organization_name', with: 'new org' fill_in 'organization_description', with: 'description for new org' fill_in 'organization_legal_status', with: 'non-profit' - click_button 'Create organization' + click_button I18n.t('admin.buttons.create_organization') click_link 'new org' expect(find_field('organization_legal_status').value).to eq 'non-profit' @@ -67,7 +67,7 @@ fill_in 'organization_name', with: 'new org' fill_in 'organization_description', with: 'description for new org' fill_in 'organization_tax_id', with: '12-1234567' - click_button 'Create organization' + click_button I18n.t('admin.buttons.create_organization') click_link 'new org' expect(find_field('organization_tax_id').value).to eq '12-1234567' @@ -77,7 +77,7 @@ fill_in 'organization_name', with: 'new org' fill_in 'organization_description', with: 'description for new org' fill_in 'organization_tax_status', with: '501(c)(3)' - click_button 'Create organization' + click_button I18n.t('admin.buttons.create_organization') click_link 'new org' expect(find_field('organization_tax_status').value).to eq '501(c)(3)' @@ -87,7 +87,7 @@ fill_in 'organization_name', with: 'new org' fill_in 'organization_description', with: 'description for new org' select_date(Time.zone.today, from: 'organization_date_incorporated') - click_button 'Create organization' + click_button I18n.t('admin.buttons.create_organization') click_link 'new org' expect(find_field('organization_date_incorporated_1i').value). @@ -102,7 +102,7 @@ fill_in 'organization_name', with: 'new org' fill_in 'organization_description', with: 'description for new org' select2('State', 'organization_funding_sources', multiple: true) - click_button 'Create organization' + click_button I18n.t('admin.buttons.create_organization') click_link 'new org' expect(find('#organization_funding_sources', visible: false).value). @@ -114,7 +114,7 @@ fill_in 'organization_description', with: 'description for new org' select2('first', 'organization_accreditations', multiple: true, tag: true) select2('second', 'organization_accreditations', multiple: true, tag: true) - click_button 'Create organization' + click_button I18n.t('admin.buttons.create_organization') organization = Organization.find_by_name('new org') expect(organization.accreditations).to eq %w(first second) @@ -125,7 +125,7 @@ fill_in 'organization_description', with: 'description for new org' select2('first', 'organization_licenses', multiple: true, tag: true) select2('second', 'organization_licenses', multiple: true, tag: true) - click_button 'Create organization' + click_button I18n.t('admin.buttons.create_organization') organization = Organization.find_by_name('new org') expect(organization.licenses).to eq %w(first second) diff --git a/spec/features/admin/organizations/delete_contact_spec.rb b/spec/features/admin/organizations/delete_contact_spec.rb index a22d0b7a2..31c236e4a 100644 --- a/spec/features/admin/organizations/delete_contact_spec.rb +++ b/spec/features/admin/organizations/delete_contact_spec.rb @@ -10,7 +10,7 @@ end scenario 'when deleting contact' do - find_link('Permanently delete this contact').click + find_link(I18n.t('admin.buttons.delete_contact')).click using_wait_time 1 do expect(current_path).to eq admin_organization_path(@org) expect(page).not_to have_link 'Moncef Belyamani' diff --git a/spec/features/admin/organizations/delete_organization_spec.rb b/spec/features/admin/organizations/delete_organization_spec.rb index ba00b9d43..9fd60dc52 100644 --- a/spec/features/admin/organizations/delete_organization_spec.rb +++ b/spec/features/admin/organizations/delete_organization_spec.rb @@ -8,8 +8,8 @@ end scenario 'when submitting warning', :js do - find_link('Permanently delete this organization').click - find_link('I understand the consequences, delete this organization').click + find_link(I18n.t('admin.buttons.delete_organization')).click + find_link(I18n.t('admin.buttons.confirm_delete_organization')).click using_wait_time 2 do expect(current_path).to eq admin_organizations_path expect(page).not_to have_link 'Parent Agency' @@ -17,7 +17,7 @@ end scenario 'when canceling warning', :js do - find_link('Permanently delete this organization').click + find_link(I18n.t('admin.buttons.delete_organization')).click find_button('Close').click visit admin_organizations_path expect(page).to have_link 'Parent Agency' diff --git a/spec/features/admin/organizations/update_accreditations_spec.rb b/spec/features/admin/organizations/update_accreditations_spec.rb index bb97fb688..8a69bae3d 100644 --- a/spec/features/admin/organizations/update_accreditations_spec.rb +++ b/spec/features/admin/organizations/update_accreditations_spec.rb @@ -15,14 +15,14 @@ scenario 'with one accreditation', :js do select2('Knight Foundation Grant', 'organization_accreditations', multiple: true, tag: true) - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(@organization.reload.accreditations).to eq ['Knight Foundation Grant'] end scenario 'with two accreditations', :js do select2('first', 'organization_accreditations', multiple: true, tag: true) select2('second', 'organization_accreditations', multiple: true, tag: true) - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(@organization.reload.accreditations).to eq %w(first second) end @@ -32,7 +32,7 @@ within '#s2id_organization_accreditations' do first('.select2-search-choice-close').click end - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(@organization.reload.accreditations).to eq ['Donations'] end end diff --git a/spec/features/admin/organizations/update_alternate_name_spec.rb b/spec/features/admin/organizations/update_alternate_name_spec.rb index 32a0a1b99..6310db6ac 100644 --- a/spec/features/admin/organizations/update_alternate_name_spec.rb +++ b/spec/features/admin/organizations/update_alternate_name_spec.rb @@ -9,7 +9,7 @@ scenario 'with alternate name' do fill_in 'organization_alternate_name', with: 'Juvenile Sexual Responsibility Program' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(find_field('organization_alternate_name').value). to eq 'Juvenile Sexual Responsibility Program' end diff --git a/spec/features/admin/organizations/update_contact_name_spec.rb b/spec/features/admin/organizations/update_contact_name_spec.rb index b3ada4c2a..d81c18aba 100644 --- a/spec/features/admin/organizations/update_contact_name_spec.rb +++ b/spec/features/admin/organizations/update_contact_name_spec.rb @@ -11,13 +11,13 @@ scenario 'with empty name' do fill_in 'contact_name', with: '' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_content "Name can't be blank for Contact" end scenario 'with valid name' do fill_in 'contact_name', with: 'Monfresh' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_content 'Contact was successfully updated.' expect(find_field('contact_name').value).to eq 'Monfresh' end diff --git a/spec/features/admin/organizations/update_date_incorporated_spec.rb b/spec/features/admin/organizations/update_date_incorporated_spec.rb index 10c0abdf5..eb5c5aa28 100644 --- a/spec/features/admin/organizations/update_date_incorporated_spec.rb +++ b/spec/features/admin/organizations/update_date_incorporated_spec.rb @@ -9,7 +9,7 @@ scenario 'with date incorporated' do select_date(Time.zone.today, from: 'organization_date_incorporated') - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(find_field('organization_date_incorporated_1i').value). to eq Time.zone.today.year.to_s diff --git a/spec/features/admin/organizations/update_description_spec.rb b/spec/features/admin/organizations/update_description_spec.rb index d4e578190..8eb8a54e8 100644 --- a/spec/features/admin/organizations/update_description_spec.rb +++ b/spec/features/admin/organizations/update_description_spec.rb @@ -9,13 +9,13 @@ scenario 'with empty organization description' do fill_in 'organization_description', with: '' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_content "Description can't be blank for Organization" end scenario 'with valid organization description' do fill_in 'organization_description', with: 'Juvenile Sexual Responsibility Program' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(find_field('organization_description').value). to eq 'Juvenile Sexual Responsibility Program' end diff --git a/spec/features/admin/organizations/update_email_spec.rb b/spec/features/admin/organizations/update_email_spec.rb index b9e9a0cb6..3ba46766a 100644 --- a/spec/features/admin/organizations/update_email_spec.rb +++ b/spec/features/admin/organizations/update_email_spec.rb @@ -9,13 +9,13 @@ scenario 'with valid organization email' do fill_in 'organization_email', with: 'foo@bar.com' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(find_field('organization_email').value).to eq 'foo@bar.com' end scenario 'with invalid organization email' do fill_in 'organization_email', with: 'foobar.com' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_content 'foobar.com is not a valid email' end end diff --git a/spec/features/admin/organizations/update_funding_sources_spec.rb b/spec/features/admin/organizations/update_funding_sources_spec.rb index 916294bce..c26e6872f 100644 --- a/spec/features/admin/organizations/update_funding_sources_spec.rb +++ b/spec/features/admin/organizations/update_funding_sources_spec.rb @@ -8,20 +8,20 @@ end scenario 'with no funding_sources' do - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(@organization.reload.funding_sources).to eq [] end scenario 'with one funding source', :js do select2('State', 'organization_funding_sources', multiple: true) - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(@organization.reload.funding_sources).to eq ['State'] end scenario 'with two funding_sources', :js do select2('State', 'organization_funding_sources', multiple: true) select2('County', 'organization_funding_sources', multiple: true) - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(@organization.reload.funding_sources).to eq %w(State County) end @@ -31,7 +31,7 @@ within '#s2id_organization_funding_sources' do first('.select2-search-choice-close').click end - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(@organization.reload.funding_sources).to eq ['County'] end end diff --git a/spec/features/admin/organizations/update_legal_status_spec.rb b/spec/features/admin/organizations/update_legal_status_spec.rb index 16741897a..4990eeaf1 100644 --- a/spec/features/admin/organizations/update_legal_status_spec.rb +++ b/spec/features/admin/organizations/update_legal_status_spec.rb @@ -9,7 +9,7 @@ scenario 'with legal status' do fill_in 'organization_legal_status', with: 'non-profit' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(find_field('organization_legal_status').value).to eq 'non-profit' end end diff --git a/spec/features/admin/organizations/update_licenses_spec.rb b/spec/features/admin/organizations/update_licenses_spec.rb index 261200246..08c3b093a 100644 --- a/spec/features/admin/organizations/update_licenses_spec.rb +++ b/spec/features/admin/organizations/update_licenses_spec.rb @@ -15,14 +15,14 @@ scenario 'with one license', :js do select2('Knight Foundation Grant', 'organization_licenses', multiple: true, tag: true) - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(@organization.reload.licenses).to eq ['Knight Foundation Grant'] end scenario 'with two licenses', :js do select2('first', 'organization_licenses', multiple: true, tag: true) select2('second', 'organization_licenses', multiple: true, tag: true) - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(@organization.reload.licenses).to eq %w(first second) end @@ -32,7 +32,7 @@ within '#s2id_organization_licenses' do first('.select2-search-choice-close').click end - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(@organization.reload.licenses).to eq ['Donations'] end end diff --git a/spec/features/admin/organizations/update_name_spec.rb b/spec/features/admin/organizations/update_name_spec.rb index 79926e62e..bbeb21577 100644 --- a/spec/features/admin/organizations/update_name_spec.rb +++ b/spec/features/admin/organizations/update_name_spec.rb @@ -9,13 +9,13 @@ scenario 'with empty organization name' do fill_in 'organization_name', with: '' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_content "Name can't be blank for Organization" end scenario 'with valid organization name' do fill_in 'organization_name', with: 'Juvenile Sexual Responsibility Program' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(find_field('organization_name').value). to eq 'Juvenile Sexual Responsibility Program' end diff --git a/spec/features/admin/organizations/update_phone_numbers_spec.rb b/spec/features/admin/organizations/update_phone_numbers_spec.rb index 7a1ef1288..29f45cc0f 100644 --- a/spec/features/admin/organizations/update_phone_numbers_spec.rb +++ b/spec/features/admin/organizations/update_phone_numbers_spec.rb @@ -13,7 +13,7 @@ to have_no_xpath('.//input[contains(@name, "[extension]")]') end - expect(page).to_not have_link 'Delete this phone permanently' + expect(page).to_not have_link I18n.t('admin.buttons.delete_phone') end scenario 'by adding a new phone', :js do @@ -24,7 +24,7 @@ extension: '1234', vanity_number: '123-ABC-DEFG' ) - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') visit '/admin/organizations/parent-agency' expect(find_field('organization_phones_attributes_0_number').value). @@ -56,8 +56,8 @@ department: 'Director of Development', number_type: 'Voice' ) - click_link 'Add a new phone number' - click_button 'Save changes' + click_link I18n.t('admin.buttons.add_phone') + click_button I18n.t('admin.buttons.save_changes') within('.phones') do total_phones = all(:xpath, './/input[contains(@name, "[number]")]') @@ -71,12 +71,12 @@ department: 'Director of Development', number_type: 'Voice' ) - click_link 'Add a new phone number' + click_link I18n.t('admin.buttons.add_phone') within('.phones') do all_phones = all(:xpath, './/input[contains(@name, "[department]")]') fill_in all_phones[-1][:id], with: 'Department' end - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_content "number can't be blank for Phone" end end @@ -109,7 +109,7 @@ scenario 'with an empty number' do update_phone(number: '') - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_content "number can't be blank for Phone" end @@ -121,13 +121,13 @@ scenario 'with an invalid extension' do update_phone(number: '703-555-1212', extension: 'x200') - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_content 'extension is not a number' end scenario 'with an empty extension' do update_phone(number: '703-555-1212', extension: '') - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to_not have_content 'extension is not a number' end end diff --git a/spec/features/admin/organizations/update_tax_id_spec.rb b/spec/features/admin/organizations/update_tax_id_spec.rb index 5e8419a54..d12ec7198 100644 --- a/spec/features/admin/organizations/update_tax_id_spec.rb +++ b/spec/features/admin/organizations/update_tax_id_spec.rb @@ -9,7 +9,7 @@ scenario 'with tax id' do fill_in 'organization_tax_id', with: '12-1234567' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(find_field('organization_tax_id').value).to eq '12-1234567' end end diff --git a/spec/features/admin/organizations/update_tax_status_spec.rb b/spec/features/admin/organizations/update_tax_status_spec.rb index 9129f5450..580bcf376 100644 --- a/spec/features/admin/organizations/update_tax_status_spec.rb +++ b/spec/features/admin/organizations/update_tax_status_spec.rb @@ -9,7 +9,7 @@ scenario 'with tax status' do fill_in 'organization_tax_status', with: '501(c)(3)' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(find_field('organization_tax_status').value).to eq '501(c)(3)' end end diff --git a/spec/features/admin/organizations/update_website_spec.rb b/spec/features/admin/organizations/update_website_spec.rb index 4c9976682..350a6b301 100644 --- a/spec/features/admin/organizations/update_website_spec.rb +++ b/spec/features/admin/organizations/update_website_spec.rb @@ -9,14 +9,14 @@ scenario 'with invalid website' do fill_in 'organization_website', with: 'www.monfresh.com' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_content 'www.monfresh.com is not a valid URL' expect(page).to have_css('.field_with_errors') end scenario 'with valid website' do fill_in 'organization_website', with: 'http://codeforamerica.org' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(find_field('organization_website').value). to eq 'http://codeforamerica.org' end diff --git a/spec/features/admin/organizations/visit_organization_spec.rb b/spec/features/admin/organizations/visit_organization_spec.rb index d60a6f963..30c225c42 100644 --- a/spec/features/admin/organizations/visit_organization_spec.rb +++ b/spec/features/admin/organizations/visit_organization_spec.rb @@ -68,7 +68,7 @@ expect(page).to have_content I18n.t('admin.not_authorized') expect(current_path).to eq(admin_dashboard_path) visit('/admin/organizations') - expect(page).to_not have_link 'Add a new organization' + expect(page).to_not have_link I18n.t('admin.buttons.add_organization') end end end diff --git a/spec/features/admin/organizations/visit_organizations_spec.rb b/spec/features/admin/organizations/visit_organizations_spec.rb index e707a3088..d223597b2 100644 --- a/spec/features/admin/organizations/visit_organizations_spec.rb +++ b/spec/features/admin/organizations/visit_organizations_spec.rb @@ -17,7 +17,7 @@ it 'does not include a link to organizations in the navigation' do within '.navbar' do - expect(page).not_to have_link 'Organizations', href: admin_organizations_path + expect(page).not_to have_link I18n.t('admin.buttons.organizations'), href: admin_organizations_path end end end diff --git a/spec/features/admin/programs/create_program_spec.rb b/spec/features/admin/programs/create_program_spec.rb index f97150517..fb87204fd 100644 --- a/spec/features/admin/programs/create_program_spec.rb +++ b/spec/features/admin/programs/create_program_spec.rb @@ -10,7 +10,7 @@ scenario 'with all required fields', :js do select2('Parent Agency', 'org-name') fill_in 'program_name', with: 'New Program' - click_button 'Create program' + click_button I18n.t('admin.buttons.create_program') expect(page).to have_content 'Program was successfully created.' click_link 'New Program' @@ -18,7 +18,7 @@ end scenario 'without any required fields' do - click_button 'Create program' + click_button I18n.t('admin.buttons.create_program') expect(page).to have_content "Name can't be blank for Program" expect(page).to have_content "Organization can't be blank for Program" end @@ -27,7 +27,7 @@ select2('Parent Agency', 'org-name') fill_in 'program_name', with: 'New Program' fill_in 'program_alternate_name', with: 'Alternate name' - click_button 'Create program' + click_button I18n.t('admin.buttons.create_program') click_link 'New Program' expect(find_field('program_alternate_name').value).to eq 'Alternate name' diff --git a/spec/features/admin/programs/delete_program_spec.rb b/spec/features/admin/programs/delete_program_spec.rb index 4040539d9..64baae463 100644 --- a/spec/features/admin/programs/delete_program_spec.rb +++ b/spec/features/admin/programs/delete_program_spec.rb @@ -9,8 +9,8 @@ end scenario 'when submitting warning', :js do - find_link('Permanently delete this program').click - find_link('I understand the consequences, delete this program').click + find_link(I18n.t('admin.buttons.delete_program')).click + find_link(I18n.t('admin.buttons.confirm_delete_program')).click using_wait_time 1 do expect(current_path).to eq admin_programs_path end @@ -18,7 +18,7 @@ end scenario 'when canceling warning', :js do - find_link('Permanently delete this program').click + find_link(I18n.t('admin.buttons.delete_program')).click find_button('Close').click visit '/admin/programs' expect(page).to have_link 'Collection of Services' diff --git a/spec/features/admin/programs/update_alternate_name_spec.rb b/spec/features/admin/programs/update_alternate_name_spec.rb index 410c709c4..f7a809d40 100644 --- a/spec/features/admin/programs/update_alternate_name_spec.rb +++ b/spec/features/admin/programs/update_alternate_name_spec.rb @@ -10,7 +10,7 @@ scenario 'with valid alternate_name' do fill_in 'program_alternate_name', with: 'Youth Counseling' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_content 'Program was successfully updated.' expect(find_field('program_alternate_name').value).to eq 'Youth Counseling' end diff --git a/spec/features/admin/programs/update_name_spec.rb b/spec/features/admin/programs/update_name_spec.rb index f94e253d5..d0ebb04ce 100644 --- a/spec/features/admin/programs/update_name_spec.rb +++ b/spec/features/admin/programs/update_name_spec.rb @@ -10,13 +10,13 @@ scenario 'with empty name' do fill_in 'program_name', with: '' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_content "Name can't be blank for Program" end scenario 'with valid name' do fill_in 'program_name', with: 'Youth Counseling' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_content 'Program was successfully updated.' expect(find_field('program_name').value).to eq 'Youth Counseling' end diff --git a/spec/features/admin/programs/visit_programs_spec.rb b/spec/features/admin/programs/visit_programs_spec.rb index f7cf7f71e..04aa2478b 100644 --- a/spec/features/admin/programs/visit_programs_spec.rb +++ b/spec/features/admin/programs/visit_programs_spec.rb @@ -17,7 +17,7 @@ it 'does not include a link to programs in the navigation' do within '.navbar' do - expect(page).not_to have_link 'programs', href: admin_programs_path + expect(page).not_to have_link I18n.t('admin.buttons.programs'), href: admin_programs_path end end end @@ -51,14 +51,14 @@ create(:nearby_loc) visit '/admin/programs' - expect(page).not_to have_content 'Add a new program' + expect(page).not_to have_content I18n.t('admin.buttons.add_program') end it 'shows add new program button if admin has an organization' do create(:location_for_org_admin) visit '/admin/programs' - expect(page).to have_link 'Add a new program' + expect(page).to have_link I18n.t('admin.buttons.add_program') end end @@ -96,7 +96,7 @@ end it 'shows the add new program button' do - expect(page).to have_link 'Add a new program' + expect(page).to have_link I18n.t('admin.buttons.add_program') end end end diff --git a/spec/features/admin/services/copy_service_to_location_spec.rb b/spec/features/admin/services/copy_service_to_location_spec.rb index c88b6a07f..5c7a97112 100644 --- a/spec/features/admin/services/copy_service_to_location_spec.rb +++ b/spec/features/admin/services/copy_service_to_location_spec.rb @@ -25,7 +25,7 @@ it 'allows copying the service to another location when authorized' do check 'Belmont Farmers Market' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_content 'successfully updated' expect(@new_loc.reload.services.pluck(:name)).to eq ['Literacy Program'] end diff --git a/spec/features/admin/services/create_contact_spec.rb b/spec/features/admin/services/create_contact_spec.rb index e78de156a..6cd594954 100644 --- a/spec/features/admin/services/create_contact_spec.rb +++ b/spec/features/admin/services/create_contact_spec.rb @@ -6,7 +6,7 @@ login_super_admin visit '/admin/locations/vrs-services' click_link 'Literacy Program' - click_link 'Add a new contact' + click_link I18n.t('admin.buttons.add_contact') end it 'creates a contact for the right service' do @@ -15,21 +15,21 @@ scenario 'with all required fields' do fill_in 'contact_name', with: 'New VRS Services contact' - click_button 'Create contact' + click_button I18n.t('admin.buttons.create_contact') click_link 'New VRS Services contact' expect(find_field('contact_name').value).to eq 'New VRS Services contact' end scenario 'without any required fields' do - click_button 'Create contact' + click_button I18n.t('admin.buttons.create_contact') expect(page).to have_content "Name can't be blank for Contact" end scenario 'with email' do fill_in 'contact_name', with: 'New VRS Services contact' fill_in 'contact_email', with: 'foo@bar.com' - click_button 'Create contact' + click_button I18n.t('admin.buttons.create_contact') click_link 'New VRS Services contact' expect(find_field('contact_email').value).to eq 'foo@bar.com' @@ -38,7 +38,7 @@ scenario 'with department' do fill_in 'contact_name', with: 'New VRS Services contact' fill_in 'contact_department', with: 'new department' - click_button 'Create contact' + click_button I18n.t('admin.buttons.create_contact') click_link 'New VRS Services contact' expect(find_field('contact_department').value).to eq 'new department' @@ -47,7 +47,7 @@ scenario 'with title' do fill_in 'contact_name', with: 'New VRS Services contact' fill_in 'contact_title', with: 'CTO' - click_button 'Create contact' + click_button I18n.t('admin.buttons.create_contact') click_link 'New VRS Services contact' expect(find_field('contact_title').value).to eq 'CTO' @@ -57,7 +57,7 @@ # and the form is already tested there. We just need to make sure # that the form is present for Contacts. scenario 'with phone' do - expect(page).to have_link 'Add a new phone' + expect(page).to have_link I18n.t('admin.buttons.add_phone') end end diff --git a/spec/features/admin/services/create_service_spec.rb b/spec/features/admin/services/create_service_spec.rb index 4f6d03ff4..65318dcb5 100644 --- a/spec/features/admin/services/create_service_spec.rb +++ b/spec/features/admin/services/create_service_spec.rb @@ -5,12 +5,12 @@ @loc = create(:location) login_super_admin visit('/admin/locations/vrs-services') - click_link 'Add a new service' + click_link I18n.t('admin.buttons.add_service') end scenario 'with all required fields' do fill_in_required_service_fields - click_button 'Create service' + click_button I18n.t('admin.buttons.create_service') click_link 'New VRS Services service' expect(find_field('service_name').value).to eq 'New VRS Services service' @@ -18,7 +18,7 @@ end scenario 'without any required fields' do - click_button 'Create service' + click_button I18n.t('admin.buttons.create_service') expect(page).to have_content "Description can't be blank for Service" expect(page).to have_content "Name can't be blank for Service" end @@ -26,7 +26,7 @@ scenario 'with alternate_name' do fill_in_required_service_fields fill_in 'service_alternate_name', with: 'Alternate name' - click_button 'Create service' + click_button I18n.t('admin.buttons.create_service') click_link 'New VRS Services service' expect(find_field('service_alternate_name').value).to eq 'Alternate name' @@ -35,7 +35,7 @@ scenario 'with audience' do fill_in_required_service_fields fill_in 'service_audience', with: 'Low-income residents.' - click_button 'Create service' + click_button I18n.t('admin.buttons.create_service') click_link 'New VRS Services service' expect(find_field('service_audience').value).to eq 'Low-income residents.' @@ -44,7 +44,7 @@ scenario 'with eligibility' do fill_in_required_service_fields fill_in 'service_eligibility', with: 'Low-income residents.' - click_button 'Create service' + click_button I18n.t('admin.buttons.create_service') click_link 'New VRS Services service' expect(find_field('service_eligibility').value).to eq 'Low-income residents.' @@ -53,7 +53,7 @@ scenario 'with email' do fill_in_required_service_fields fill_in 'service_email', with: 'foo@bar.com' - click_button 'Create service' + click_button I18n.t('admin.buttons.create_service') click_link 'New VRS Services service' expect(find_field('service_email').value).to eq 'foo@bar.com' @@ -62,7 +62,7 @@ scenario 'with fees' do fill_in_required_service_fields fill_in 'service_fees', with: 'Low-income residents.' - click_button 'Create service' + click_button I18n.t('admin.buttons.create_service') click_link 'New VRS Services service' expect(find_field('service_fees').value).to eq 'Low-income residents.' @@ -71,7 +71,7 @@ scenario 'when adding an accepted payment', :js do fill_in_required_service_fields select2('Cash', 'service_accepted_payments', multiple: true) - click_button 'Create service' + click_button I18n.t('admin.buttons.create_service') click_link 'New VRS Services service' expect(find('#service_accepted_payments', visible: false).value). @@ -81,7 +81,7 @@ scenario 'when adding a funding source', :js do fill_in_required_service_fields select2('County', 'service_funding_sources', multiple: true) - click_button 'Create service' + click_button I18n.t('admin.buttons.create_service') click_link 'New VRS Services service' expect(find('#service_funding_sources', visible: false).value). @@ -91,7 +91,7 @@ scenario 'with application_process' do fill_in_required_service_fields fill_in 'service_application_process', with: 'Low-income residents.' - click_button 'Create service' + click_button I18n.t('admin.buttons.create_service') click_link 'New VRS Services service' expect(find_field('service_application_process').value).to eq 'Low-income residents.' @@ -100,7 +100,7 @@ scenario 'when adding interpretation services' do fill_in_required_service_fields fill_in 'service_interpretation_services', with: 'CTS LanguageLink' - click_button 'Create service' + click_button I18n.t('admin.buttons.create_service') click_link 'New VRS Services service' expect(find_field('service_interpretation_services').value).to eq 'CTS LanguageLink' @@ -109,7 +109,7 @@ scenario 'with status' do fill_in_required_service_fields select 'Inactive', from: 'service_status' - click_button 'Create service' + click_button I18n.t('admin.buttons.create_service') click_link 'New VRS Services service' expect(find_field('service_status').value).to eq 'inactive' @@ -119,7 +119,7 @@ fill_in_required_service_fields select2('first', 'service_keywords', multiple: true, tag: true) select2('second', 'service_keywords', multiple: true, tag: true) - click_button 'Create service' + click_button I18n.t('admin.buttons.create_service') click_link 'New VRS Services service' service = Service.find_by_name('New VRS Services service') @@ -129,7 +129,7 @@ scenario 'when adding a language', :js do fill_in_required_service_fields select2('French', 'service_languages', multiple: true) - click_button 'Create service' + click_button I18n.t('admin.buttons.create_service') click_link 'New VRS Services service' service = Service.find_by_name('New VRS Services service') @@ -140,7 +140,7 @@ scenario 'when adding a required document', :js do fill_in_required_service_fields select2('Picture ID', 'service_required_documents', multiple: true) - click_button 'Create service' + click_button I18n.t('admin.buttons.create_service') click_link 'New VRS Services service' expect(find('#service_required_documents', visible: false).value). @@ -150,7 +150,7 @@ scenario 'when adding a service area', :js do fill_in_required_service_fields select2('Belmont', 'service_service_areas', multiple: true) - click_button 'Create service' + click_button I18n.t('admin.buttons.create_service') click_link 'New VRS Services service' expect(find('#service_service_areas', visible: false).value). @@ -160,7 +160,7 @@ scenario 'when adding a website' do fill_in_required_service_fields fill_in 'service_website', with: 'http://ruby.com' - click_button 'Create service' + click_button I18n.t('admin.buttons.create_service') click_link 'New VRS Services service' expect(find_field('service_website').value).to eq 'http://ruby.com' @@ -169,7 +169,7 @@ scenario 'with wait_time' do fill_in_required_service_fields fill_in 'service_wait_time', with: 'Low-income residents.' - click_button 'Create service' + click_button I18n.t('admin.buttons.create_service') click_link 'New VRS Services service' expect(find_field('service_wait_time').value).to eq 'Low-income residents.' @@ -184,7 +184,7 @@ fill_in_required_service_fields check 'category_101' check 'category_101-01' - click_button 'Create service' + click_button I18n.t('admin.buttons.create_service') click_link 'New VRS Services service' expect(find('#category_101-01')).to be_checked @@ -196,7 +196,7 @@ visit new_admin_location_service_path(@loc) fill_in_required_service_fields select 'Collection of Services', from: 'service_program_id' - click_button 'Create service' + click_button I18n.t('admin.buttons.create_service') click_link 'New VRS Services service' expect(page). @@ -210,7 +210,7 @@ opens_at_hour: '9 AM', opens_at_minute: '30', closes_at_hour: '5 PM', closes_at_minute: '45' ) - click_button 'Create service' + click_button I18n.t('admin.buttons.create_service') click_link 'New VRS Services service' prefix = 'service_regular_schedules_attributes_0' @@ -233,7 +233,7 @@ end_day: '2', closed: 'Closed' ) - click_button 'Create service' + click_button I18n.t('admin.buttons.create_service') click_link 'New VRS Services service' prefix = 'service_holiday_schedules_attributes_0' @@ -258,7 +258,7 @@ visit('/admin/locations/vrs-services/services/new') fill_in_required_service_fields check 'Belmont Farmers Market' - click_button 'Create service' + click_button I18n.t('admin.buttons.create_service') expect(page).to have_content 'successfully created' expect(@new_loc.reload.services.pluck(:name)).to eq ['New VRS Services service'] diff --git a/spec/features/admin/services/delete_contact_spec.rb b/spec/features/admin/services/delete_contact_spec.rb index 456540b02..16ca79449 100644 --- a/spec/features/admin/services/delete_contact_spec.rb +++ b/spec/features/admin/services/delete_contact_spec.rb @@ -11,7 +11,7 @@ end scenario 'when deleting contact' do - find_link('Permanently delete this contact').click + find_link(I18n.t('admin.buttons.delete_contact')).click using_wait_time 1 do expect(current_path).to eq admin_location_service_path(@location, @service) expect(page).not_to have_link 'Moncef Belyamani' diff --git a/spec/features/admin/services/delete_service_spec.rb b/spec/features/admin/services/delete_service_spec.rb index 6e499d62d..a9c424a9d 100644 --- a/spec/features/admin/services/delete_service_spec.rb +++ b/spec/features/admin/services/delete_service_spec.rb @@ -9,8 +9,8 @@ scenario 'when submitting warning', :js do click_link 'Literacy Program' - find_link('Permanently delete this service').click - find_link('I understand the consequences, delete this service').click + find_link(I18n.t('admin.buttons.delete_service')).click + find_link(I18n.t('admin.buttons.confirm_delete_service')).click using_wait_time 1 do expect(current_path).to eq admin_locations_path end @@ -20,7 +20,7 @@ scenario 'when canceling warning', :js do click_link 'Literacy Program' - find_link('Permanently delete this service').click + find_link(I18n.t('admin.buttons.delete_service')).click find_button('Close').click visit '/admin/locations/vrs-services' expect(page).to have_link 'Literacy Program' diff --git a/spec/features/admin/services/update_accepted_payments_spec.rb b/spec/features/admin/services/update_accepted_payments_spec.rb index 9aa48c19e..3e28bee8f 100644 --- a/spec/features/admin/services/update_accepted_payments_spec.rb +++ b/spec/features/admin/services/update_accepted_payments_spec.rb @@ -9,20 +9,20 @@ end scenario 'with no accepted_payments' do - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(@service.reload.accepted_payments).to eq [] end scenario 'with one accepted payment', :js do select2('Cash', 'service_accepted_payments', multiple: true) - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(@service.reload.accepted_payments).to eq ['Cash'] end scenario 'with two accepted_payments', :js do select2('Cash', 'service_accepted_payments', multiple: true) select2('Check', 'service_accepted_payments', multiple: true) - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(@service.reload.accepted_payments).to eq %w(Cash Check) end @@ -33,7 +33,7 @@ within '#s2id_service_accepted_payments' do first('.select2-search-choice-close').click end - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(@service.reload.accepted_payments).to eq ['Check'] end end diff --git a/spec/features/admin/services/update_alternate_name_spec.rb b/spec/features/admin/services/update_alternate_name_spec.rb index 32beee8b9..d66d091a3 100644 --- a/spec/features/admin/services/update_alternate_name_spec.rb +++ b/spec/features/admin/services/update_alternate_name_spec.rb @@ -10,7 +10,7 @@ scenario 'with valid alternate_name' do fill_in 'service_alternate_name', with: 'Youth Counseling' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_content 'Service was successfully updated.' expect(find_field('service_alternate_name').value).to eq 'Youth Counseling' end diff --git a/spec/features/admin/services/update_audience_spec.rb b/spec/features/admin/services/update_audience_spec.rb index 1eb040b3b..5e032a8d3 100644 --- a/spec/features/admin/services/update_audience_spec.rb +++ b/spec/features/admin/services/update_audience_spec.rb @@ -10,7 +10,7 @@ scenario 'with valid audience' do click_link 'Literacy Program' fill_in 'service_audience', with: 'Youth Counseling' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_content 'Service was successfully updated.' expect(find_field('service_audience').value).to eq 'Youth Counseling' end diff --git a/spec/features/admin/services/update_categories_spec.rb b/spec/features/admin/services/update_categories_spec.rb index 24ab701cc..57ced05f3 100644 --- a/spec/features/admin/services/update_categories_spec.rb +++ b/spec/features/admin/services/update_categories_spec.rb @@ -16,7 +16,7 @@ scenario 'updating service without changing categories' do fill_in 'service_name', with: '' fill_in 'service_description', with: '' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_content("can't be blank") end @@ -24,13 +24,13 @@ scenario 'when adding one subcategory', :js do check 'category_101' check 'category_101-01' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(find('#category_101')).to be_checked expect(find('#category_101-01')).to be_checked uncheck 'category_101' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(find('#category_101')).to_not be_checked end @@ -41,7 +41,7 @@ check 'category_101-02' check 'category_101-03' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(find('#category_101-03')).to be_checked expect(find('#category_101-02')).to be_checked diff --git a/spec/features/admin/services/update_contact_name_spec.rb b/spec/features/admin/services/update_contact_name_spec.rb index 7b3b88272..1eff51734 100644 --- a/spec/features/admin/services/update_contact_name_spec.rb +++ b/spec/features/admin/services/update_contact_name_spec.rb @@ -12,13 +12,13 @@ scenario 'with empty name' do fill_in 'contact_name', with: '' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_content "Name can't be blank for Contact" end scenario 'with valid name' do fill_in 'contact_name', with: 'Monfresh' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_content 'Contact was successfully updated.' expect(find_field('contact_name').value).to eq 'Monfresh' end diff --git a/spec/features/admin/services/update_description_spec.rb b/spec/features/admin/services/update_description_spec.rb index f9d68fd56..04e543e93 100644 --- a/spec/features/admin/services/update_description_spec.rb +++ b/spec/features/admin/services/update_description_spec.rb @@ -10,13 +10,13 @@ scenario 'with empty description' do fill_in 'service_description', with: '' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_content "Description can't be blank for Service" end scenario 'with valid description' do fill_in 'service_description', with: 'Youth Counseling' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_content 'Service was successfully updated.' expect(find_field('service_description').value).to eq 'Youth Counseling' end diff --git a/spec/features/admin/services/update_eligibility_spec.rb b/spec/features/admin/services/update_eligibility_spec.rb index 561204a34..fd6116abf 100644 --- a/spec/features/admin/services/update_eligibility_spec.rb +++ b/spec/features/admin/services/update_eligibility_spec.rb @@ -10,7 +10,7 @@ scenario 'with valid eligibility' do click_link 'Literacy Program' fill_in 'service_eligibility', with: 'Youth Counseling' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_content 'Service was successfully updated.' expect(find_field('service_eligibility').value).to eq 'Youth Counseling' end diff --git a/spec/features/admin/services/update_email_spec.rb b/spec/features/admin/services/update_email_spec.rb index 39eb43085..a8169c6df 100644 --- a/spec/features/admin/services/update_email_spec.rb +++ b/spec/features/admin/services/update_email_spec.rb @@ -10,13 +10,13 @@ scenario 'with invalid email' do fill_in 'service_email', with: 'foobar.com' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_content 'is not a valid email' end scenario 'with valid email' do fill_in 'service_email', with: 'ruby@good.com' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_content 'Service was successfully updated.' expect(find_field('service_email').value).to eq 'ruby@good.com' end diff --git a/spec/features/admin/services/update_fees_spec.rb b/spec/features/admin/services/update_fees_spec.rb index c2f363a34..fa49af18c 100644 --- a/spec/features/admin/services/update_fees_spec.rb +++ b/spec/features/admin/services/update_fees_spec.rb @@ -10,7 +10,7 @@ scenario 'with valid fees' do click_link 'Literacy Program' fill_in 'service_fees', with: 'Youth Counseling' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_content 'Service was successfully updated.' expect(find_field('service_fees').value).to eq 'Youth Counseling' end diff --git a/spec/features/admin/services/update_funding_sources_spec.rb b/spec/features/admin/services/update_funding_sources_spec.rb index 268be78bc..d9acd9978 100644 --- a/spec/features/admin/services/update_funding_sources_spec.rb +++ b/spec/features/admin/services/update_funding_sources_spec.rb @@ -9,20 +9,20 @@ end scenario 'with no funding_sources' do - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(@service.reload.funding_sources).to eq [] end scenario 'with one accepted payment', :js do select2('State', 'service_funding_sources', multiple: true) - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(@service.reload.funding_sources).to eq ['State'] end scenario 'with two funding_sources', :js do select2('State', 'service_funding_sources', multiple: true) select2('County', 'service_funding_sources', multiple: true) - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(@service.reload.funding_sources).to eq %w(State County) end @@ -33,7 +33,7 @@ within '#s2id_service_funding_sources' do first('.select2-search-choice-close').click end - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(@service.reload.funding_sources).to eq ['County'] end end diff --git a/spec/features/admin/services/update_holiday_hours_spec.rb b/spec/features/admin/services/update_holiday_hours_spec.rb index c472fc132..e20d36080 100644 --- a/spec/features/admin/services/update_holiday_hours_spec.rb +++ b/spec/features/admin/services/update_holiday_hours_spec.rb @@ -16,7 +16,7 @@ end_day: '2', closed: 'Closed' ) - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') prefix = 'service_holiday_schedules_attributes_0' @@ -45,7 +45,7 @@ opens_at_hour: '10 AM', opens_at_minute: '30', closes_at_hour: '3 PM', closes_at_minute: '45' ) - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') prefix = 'service_holiday_schedules_attributes_0' @@ -72,8 +72,8 @@ prefix = 'service_holiday_schedules_attributes_0' expect(find_field("#{prefix}_closed").value).to eq 'true' - click_link 'Remove this holiday schedule' - click_button 'Save changes' + click_link I18n.t('admin.buttons.remove_holiday_schedule') + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_no_field("#{prefix}_closed") end diff --git a/spec/features/admin/services/update_hours_spec.rb b/spec/features/admin/services/update_hours_spec.rb index 5c87d9286..db70118ed 100644 --- a/spec/features/admin/services/update_hours_spec.rb +++ b/spec/features/admin/services/update_hours_spec.rb @@ -14,7 +14,7 @@ opens_at_hour: '9 AM', opens_at_minute: '30', closes_at_hour: '5 PM', closes_at_minute: '45' ) - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') prefix = 'service_regular_schedules_attributes_0' @@ -36,9 +36,9 @@ expect(find_field("#{prefix}_weekday").value).to eq '7' within '.hours' do - click_link 'x' + click_link I18n.t('admin.buttons.delete_symbol') end - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_no_field("#{prefix}_weekday") end diff --git a/spec/features/admin/services/update_how_to_apply_spec.rb b/spec/features/admin/services/update_how_to_apply_spec.rb index 1e59f41f8..5974050f3 100644 --- a/spec/features/admin/services/update_how_to_apply_spec.rb +++ b/spec/features/admin/services/update_how_to_apply_spec.rb @@ -10,7 +10,7 @@ scenario 'with valid application_process' do click_link 'Literacy Program' fill_in 'service_application_process', with: 'Youth Counseling' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_content 'Service was successfully updated.' expect(find_field('service_application_process').value).to eq 'Youth Counseling' end diff --git a/spec/features/admin/services/update_interpretation_services_spec.rb b/spec/features/admin/services/update_interpretation_services_spec.rb index 5cf38c992..e20c44af8 100644 --- a/spec/features/admin/services/update_interpretation_services_spec.rb +++ b/spec/features/admin/services/update_interpretation_services_spec.rb @@ -10,7 +10,7 @@ scenario 'with valid interpretation_services' do click_link 'Literacy Program' fill_in 'service_interpretation_services', with: 'CTS LanguageLink' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_content 'Service was successfully updated.' expect(find_field('service_interpretation_services').value).to eq 'CTS LanguageLink' end diff --git a/spec/features/admin/services/update_keywords_spec.rb b/spec/features/admin/services/update_keywords_spec.rb index 806eed67d..1aec93b4e 100644 --- a/spec/features/admin/services/update_keywords_spec.rb +++ b/spec/features/admin/services/update_keywords_spec.rb @@ -16,14 +16,14 @@ scenario 'with one keyword', :js do select2('ligal', 'service_keywords', multiple: true, tag: true) - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(@service.reload.keywords).to eq ['ligal'] end scenario 'with two keywords', :js do select2('first', 'service_keywords', multiple: true, tag: true) select2('second', 'service_keywords', multiple: true, tag: true) - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(@service.reload.keywords).to eq %w(first second) end @@ -34,7 +34,7 @@ within '#s2id_service_keywords' do first('.select2-search-choice-close').click end - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(@service.reload.keywords).to eq ['computer'] end end diff --git a/spec/features/admin/services/update_languages_spec.rb b/spec/features/admin/services/update_languages_spec.rb index 731abde43..6b6bc5603 100644 --- a/spec/features/admin/services/update_languages_spec.rb +++ b/spec/features/admin/services/update_languages_spec.rb @@ -9,20 +9,20 @@ end scenario 'with no languages' do - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(@service.reload.languages).to eq [] end scenario 'with one language', :js do select2('French', 'service_languages', multiple: true) - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(@service.reload.languages).to eq ['French'] end scenario 'with two languages', :js do select2('French', 'service_languages', multiple: true) select2('Spanish', 'service_languages', multiple: true) - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(@service.reload.languages).to eq %w(French Spanish) end @@ -33,7 +33,7 @@ within '#s2id_service_languages' do first('.select2-search-choice-close').click end - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(@service.reload.languages).to eq ['French'] end end diff --git a/spec/features/admin/services/update_name_spec.rb b/spec/features/admin/services/update_name_spec.rb index e846f4018..eeb3b2b8e 100644 --- a/spec/features/admin/services/update_name_spec.rb +++ b/spec/features/admin/services/update_name_spec.rb @@ -10,13 +10,13 @@ scenario 'with empty name' do fill_in 'service_name', with: '' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_content "Name can't be blank for Service" end scenario 'with valid name' do fill_in 'service_name', with: 'Youth Counseling' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_content 'Service was successfully updated.' expect(find_field('service_name').value).to eq 'Youth Counseling' end diff --git a/spec/features/admin/services/update_phone_numbers_spec.rb b/spec/features/admin/services/update_phone_numbers_spec.rb index c0507d667..afd63d0cb 100644 --- a/spec/features/admin/services/update_phone_numbers_spec.rb +++ b/spec/features/admin/services/update_phone_numbers_spec.rb @@ -9,7 +9,7 @@ end scenario 'when no phones exist' do - expect(page).to have_link 'Add a new phone number' + expect(page).to have_link I18n.t('admin.buttons.add_phone') end scenario 'by adding a new phone', :js do @@ -20,7 +20,7 @@ extension: '1234', vanity_number: '123-ABC-DEFG' ) - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(find_field('service_phones_attributes_0_number').value). to eq '123-456-7890' diff --git a/spec/features/admin/services/update_program_spec.rb b/spec/features/admin/services/update_program_spec.rb index 9d5507b20..eb5c91f5a 100644 --- a/spec/features/admin/services/update_program_spec.rb +++ b/spec/features/admin/services/update_program_spec.rb @@ -11,7 +11,7 @@ scenario 'with valid program' do select 'Collection of Services', from: 'service_program_id' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_content 'Service was successfully updated.' expect(page). to have_select('service_program_id', selected: 'Collection of Services') @@ -22,7 +22,7 @@ @service.program_id = @prog.id @service.save select 'This service is not part of any program', from: 'service_program_id' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_content 'Service was successfully updated.' expect(find_field('service_program_id').value).to eq '' expect(@service.reload.program_id).to be_nil diff --git a/spec/features/admin/services/update_required_documents_spec.rb b/spec/features/admin/services/update_required_documents_spec.rb index 3c9a31d5b..860485863 100644 --- a/spec/features/admin/services/update_required_documents_spec.rb +++ b/spec/features/admin/services/update_required_documents_spec.rb @@ -9,20 +9,20 @@ end scenario 'with no required_documents' do - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(@service.reload.required_documents).to eq [] end scenario 'with one required document', :js do select2('Bank Statement', 'service_required_documents', multiple: true) - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(@service.reload.required_documents).to eq ['Bank Statement'] end scenario 'with two required_documents', :js do select2('Bank Statement', 'service_required_documents', multiple: true) select2('Picture ID', 'service_required_documents', multiple: true) - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(@service.reload.required_documents).to eq ['Bank Statement', 'Picture ID'] end @@ -33,7 +33,7 @@ within '#s2id_service_required_documents' do first('.select2-search-choice-close').click end - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(@service.reload.required_documents).to eq ['Picture ID'] end end diff --git a/spec/features/admin/services/update_service_areas_spec.rb b/spec/features/admin/services/update_service_areas_spec.rb index d7acdd7bf..d46fe2ea3 100644 --- a/spec/features/admin/services/update_service_areas_spec.rb +++ b/spec/features/admin/services/update_service_areas_spec.rb @@ -16,14 +16,14 @@ scenario 'with one service area', :js do select2('Belmont', 'service_service_areas', multiple: true) - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(@service.reload.service_areas).to eq ['Belmont'] end scenario 'with two service areas', :js do select2('Belmont', 'service_service_areas', multiple: true) select2('Atherton', 'service_service_areas', multiple: true) - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(@service.reload.service_areas).to eq %w(Atherton Belmont) end @@ -34,7 +34,7 @@ within '#s2id_service_service_areas' do first('.select2-search-choice-close').click end - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(@service.reload.service_areas).to eq ['Belmont'] end end diff --git a/spec/features/admin/services/update_status_spec.rb b/spec/features/admin/services/update_status_spec.rb index 3e5776ef7..5477f599e 100644 --- a/spec/features/admin/services/update_status_spec.rb +++ b/spec/features/admin/services/update_status_spec.rb @@ -10,7 +10,7 @@ scenario 'with valid status' do click_link 'Literacy Program' select 'Defunct', from: 'service_status' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_content 'Service was successfully updated.' expect(find_field('service_status').value).to eq 'defunct' end diff --git a/spec/features/admin/services/update_wait_time_spec.rb b/spec/features/admin/services/update_wait_time_spec.rb index 3bd32b152..b1ce2c36e 100644 --- a/spec/features/admin/services/update_wait_time_spec.rb +++ b/spec/features/admin/services/update_wait_time_spec.rb @@ -10,7 +10,7 @@ scenario 'with valid wait_time' do click_link 'Literacy Program' fill_in 'service_wait_time', with: 'Youth Counseling' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_content 'Service was successfully updated.' expect(find_field('service_wait_time').value).to eq 'Youth Counseling' end diff --git a/spec/features/admin/services/update_website_spec.rb b/spec/features/admin/services/update_website_spec.rb index d6b2f25f6..fb49c46d4 100644 --- a/spec/features/admin/services/update_website_spec.rb +++ b/spec/features/admin/services/update_website_spec.rb @@ -10,14 +10,14 @@ scenario 'with invalid website' do fill_in 'service_website', with: 'www.monfresh.com' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(page).to have_content 'www.monfresh.com is not a valid URL' expect(page).to have_css('.field_with_errors') end scenario 'with valid website' do fill_in 'service_website', with: 'http://codeforamerica.org' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') expect(find_field('service_website').value). to eq 'http://codeforamerica.org' end diff --git a/spec/features/admin/services/visit_services_spec.rb b/spec/features/admin/services/visit_services_spec.rb index c1a670547..3abe638c8 100644 --- a/spec/features/admin/services/visit_services_spec.rb +++ b/spec/features/admin/services/visit_services_spec.rb @@ -17,7 +17,7 @@ it 'does not include a link to services in the navigation' do within '.navbar' do - expect(page).not_to have_link 'Services', href: admin_services_path + expect(page).not_to have_link I18n.t('admin.buttons.services'), href: admin_services_path end end end diff --git a/spec/features/admin/sign_in_spec.rb b/spec/features/admin/sign_in_spec.rb index 2e28fbeb0..d2414f300 100644 --- a/spec/features/admin/sign_in_spec.rb +++ b/spec/features/admin/sign_in_spec.rb @@ -7,13 +7,13 @@ it 'includes a link to the sign in page in the navigation' do within '.navbar' do - expect(page).not_to have_link 'Sign in', href: new_admin_session_path + expect(page).not_to have_link I18n.t('navigation.sign_in'), href: new_admin_session_path end end it 'includes a link to the sign up page in the navigation' do within '.navbar' do - expect(page).not_to have_link 'Sign up', href: new_admin_registration_path + expect(page).not_to have_link I18n.t('navigation.sign_in'), href: new_admin_registration_path end end @@ -47,27 +47,27 @@ it 'does not include a link to the sign up page in the navigation' do within '.navbar' do - expect(page).not_to have_link 'Sign up' + expect(page).not_to have_link I18n.t('navigation.sign_up') end end it 'does not include a link to the sign in page in the navigation' do within '.navbar' do - expect(page).not_to have_link 'Sign in' + expect(page).not_to have_link I18n.t('navigation.sign_in') end end it 'includes a link to sign out in the navigation' do within '.navbar' do expect(page). - to have_link 'Sign out', href: destroy_admin_session_path + to have_link I18n.t('navigation.sign_out'), href: destroy_admin_session_path end end it 'includes a link to the Edit Account page in the navigation' do within '.navbar' do expect(page). - to have_link 'Edit account', href: edit_admin_registration_path + to have_link I18n.t('navigation.edit_account'), href: edit_admin_registration_path end end diff --git a/spec/features/admin/sign_out_spec.rb b/spec/features/admin/sign_out_spec.rb index cca780b89..d78a7b928 100644 --- a/spec/features/admin/sign_out_spec.rb +++ b/spec/features/admin/sign_out_spec.rb @@ -7,7 +7,7 @@ end it 'redirects to the admin sign in page' do - click_link 'Sign out' + click_link I18n.t('navigation.sign_out') expect(current_path).to eq(new_admin_session_path) end end diff --git a/spec/features/delete_api_application_spec.rb b/spec/features/delete_api_application_spec.rb index 665ad6fb2..5e6c2c048 100644 --- a/spec/features/delete_api_application_spec.rb +++ b/spec/features/delete_api_application_spec.rb @@ -10,7 +10,7 @@ end it 'deletes the application when the delete button is clicked' do - click_link 'Delete application' + click_link I18n.t('buttons.delete_application') expect(page).to have_content 'Application was successfully deleted.' expect(current_path).to eq api_applications_path diff --git a/spec/features/edit_account_spec.rb b/spec/features/edit_account_spec.rb index 45ced6d1b..4e19e0590 100644 --- a/spec/features/edit_account_spec.rb +++ b/spec/features/edit_account_spec.rb @@ -9,7 +9,7 @@ it 'allows the name to be changed' do fill_in 'user_name', with: 'New User name' fill_in 'user_current_password', with: @user.password - click_button 'Update' + click_button I18n.t('buttons.update') visit edit_user_registration_path expect(find_field('user_name').value).to eq 'New User name' end @@ -17,7 +17,7 @@ it 'redirects to the user edit page after update' do fill_in 'user_name', with: 'New user name' fill_in 'user_current_password', with: @user.password - click_button 'Update' + click_button I18n.t('buttons.update') expect(current_path).to eq edit_user_registration_path end end diff --git a/spec/features/homepage_text_spec.rb b/spec/features/homepage_text_spec.rb index 1ecd0de90..bd32d1e65 100644 --- a/spec/features/homepage_text_spec.rb +++ b/spec/features/homepage_text_spec.rb @@ -31,24 +31,24 @@ it 'includes a link to sign out in the navigation' do within '.navbar' do expect(page). - to have_link 'Sign out', href: destroy_user_session_path + to have_link I18n.t('navigation.sign_out'), href: destroy_user_session_path end end it 'includes a link to the Edit Account page in the navigation' do within '.navbar' do expect(page). - to have_link 'Edit account', href: edit_user_registration_path + to have_link I18n.t('navigation.edit_account'), href: edit_user_registration_path end end scenario "click 'Register a new application' link" do - click_link 'Register a new application' + click_link I18n.t('links.register_a_new_application') expect(page).to have_content 'Register a new application' end scenario "click 'view' link" do - click_link 'view' + click_link I18n.t('links.view') expect(page).to have_content 'Developer Applications' end end diff --git a/spec/features/sign_out_spec.rb b/spec/features/sign_out_spec.rb index d144e3a52..20e071935 100644 --- a/spec/features/sign_out_spec.rb +++ b/spec/features/sign_out_spec.rb @@ -7,7 +7,7 @@ end it 'redirects to the user home page' do - click_link 'Sign out' + click_link I18n.t('navigation.sign_out') expect(current_path).to eq(root_path) end end diff --git a/spec/features/update_api_application_spec.rb b/spec/features/update_api_application_spec.rb index b53c6fccb..bbfc37b05 100644 --- a/spec/features/update_api_application_spec.rb +++ b/spec/features/update_api_application_spec.rb @@ -32,7 +32,7 @@ update_api_app('', '', '') expect(page).to have_content "Name can't be blank" expect(page).to have_content "Main url can't be blank" - expect(page).to have_button 'Update application' + expect(page).to have_button I18n.t('buttons.update_application') expect(page).to have_content 'API Token' end end diff --git a/spec/support/features/contact_helpers.rb b/spec/support/features/contact_helpers.rb index 3a84ca60f..7456c16ce 100644 --- a/spec/support/features/contact_helpers.rb +++ b/spec/support/features/contact_helpers.rb @@ -1,7 +1,7 @@ module Features module ContactHelpers def add_contact(options = {}) - click_link 'Add a new contact' + click_link I18n.t('admin.buttons.add_contact') update_contact(options) end @@ -31,8 +31,8 @@ def department end def delete_contact - click_link 'Delete this contact permanently' - click_button 'Save changes' + click_link I18n.t('admin.buttons.delete_contact') + click_button I18n.t('admin.buttons.save_changes') end end end diff --git a/spec/support/features/form_helpers.rb b/spec/support/features/form_helpers.rb index f90bf757d..6cf35ebea 100644 --- a/spec/support/features/form_helpers.rb +++ b/spec/support/features/form_helpers.rb @@ -6,7 +6,7 @@ def reset_accessibility uncheck checkbox[:id] end end - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') end def set_all_accessibility @@ -15,13 +15,13 @@ def set_all_accessibility check checkbox[:id] end end - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') end def add_street_address(options = {}) - click_link 'Add a street address' + click_link I18n.t('admin.buttons.add_street_address') update_street_address(options) - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') end def update_street_address(options = {}) @@ -30,13 +30,13 @@ def update_street_address(options = {}) fill_in 'location_address_attributes_state_province', with: options[:state_province] fill_in 'location_address_attributes_postal_code', with: options[:postal_code] fill_in 'location_address_attributes_country', with: options[:country] - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') end def add_mailing_address(options = {}) - click_link 'Add a mailing address' + click_link I18n.t('admin.buttons.add_mailing_address') update_mailing_address(options) - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') end def update_mailing_address(options = {}) @@ -49,35 +49,35 @@ def update_mailing_address(options = {}) end def remove_street_address - click_link 'Delete this address permanently' - click_button 'Save changes' + click_link I18n.t('admin.buttons.delete_street_address') + click_button I18n.t('admin.buttons.save_changes') end def remove_mail_address - click_link 'Delete this mailing address permanently' - click_button 'Save changes' + click_link I18n.t('admin.buttons.delete_mailing_address') + click_button I18n.t('admin.buttons.save_changes') end def add_two_admins - find_link('Add a new admin email').trigger('click') + find_link(I18n.t('admin.buttons.add_admin')).trigger('click') fill_in 'location[admin_emails][]', with: 'moncef@foo.com' - find_link('Add a new admin email').trigger('click') + find_link(I18n.t('admin.buttons.add_admin')).trigger('click') admins = all(:xpath, "//input[contains(@name, '[admin_emails]')]") fill_in admins[-1][:id], with: 'moncef@otherlocation.com' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') end def delete_all_admins - find_link('Delete this admin permanently', match: :first).trigger('click') - find_link('Delete this admin permanently', match: :first).trigger('click') - click_button 'Save changes' + find_link(I18n.t('admin.buttons.delete_admin'), match: :first).trigger('click') + find_link(I18n.t('admin.buttons.delete_admin'), match: :first).trigger('click') + click_button I18n.t('admin.buttons.save_changes') end def fill_in_all_required_fields select2('Parent Agency', 'org-name') fill_in 'location_name', with: 'New Parent Agency location' fill_in 'location_description', with: 'new description' - click_link 'Add a street address' + click_link I18n.t('admin.buttons.add_street_address') fill_in 'location_address_attributes_address_1', with: '123 Main St.' fill_in 'location_address_attributes_city', with: 'Belmont' fill_in 'location_address_attributes_state_province', with: 'CA' @@ -122,19 +122,19 @@ def set_single_select2_value(value, container) end def add_two_keywords - click_link 'Add a new keyword' + click_link I18n.t('admin.buttons.add_keyword') fill_in 'service[keywords][]', with: 'homeless' - click_link 'Add a new keyword' + click_link I18n.t('admin.buttons.add_keyword') keywords = page. all(:xpath, "//input[@name='service[keywords][]']") fill_in keywords[-1][:id], with: 'CalFresh' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') end def delete_all_keywords - find_link('Delete this keyword permanently', match: :first).click - find_link('Delete this keyword permanently', match: :first).click - click_button 'Save changes' + find_link(I18n.t('admin.buttons.delete_keyword'), match: :first).click + find_link(I18n.t('admin.buttons.delete_keyword'), match: :first).click + click_button I18n.t('admin.buttons.save_changes') end def add_two_service_areas @@ -144,13 +144,13 @@ def add_two_service_areas service_areas = page. all(:xpath, "//input[@name='service[service_areas][]']") fill_in service_areas[-1][:id], with: 'Atherton' - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') end def delete_all_service_areas find_link('Delete this service area permanently', match: :first).click find_link('Delete this service area permanently', match: :first).click - click_button 'Save changes' + click_button I18n.t('admin.buttons.save_changes') end def select_date(date, options = {}) diff --git a/spec/support/features/phone_helpers.rb b/spec/support/features/phone_helpers.rb index ad40ab7b8..3a43550b3 100644 --- a/spec/support/features/phone_helpers.rb +++ b/spec/support/features/phone_helpers.rb @@ -1,7 +1,7 @@ module Features module PhoneHelpers def add_phone(options = {}) - click_link 'Add a new phone number' + click_link I18n.t('admin.buttons.add_phone') update_phone(options) end @@ -40,8 +40,8 @@ def number_type end def delete_phone - click_link 'Delete this phone permanently' - click_button 'Save changes' + click_link I18n.t('admin.buttons.delete_phone') + click_button I18n.t('admin.buttons.save_changes') end end end diff --git a/spec/support/features/schedule_helpers.rb b/spec/support/features/schedule_helpers.rb index 1d31c8991..234d09b96 100644 --- a/spec/support/features/schedule_helpers.rb +++ b/spec/support/features/schedule_helpers.rb @@ -1,7 +1,7 @@ module Features module ScheduleHelpers def add_hour(options = {}) - click_link 'Add hours of operation' + click_link I18n.t('admin.buttons.add_hours_of_operation') update_hours(options) end @@ -14,7 +14,7 @@ def update_hours(options = {}) end def add_holiday_schedule(options = {}) - click_link 'Add holiday schedule' + click_link I18n.t('admin.buttons.add_holiday_schedule') update_holiday_schedule(options) end diff --git a/spec/support/features/session_helpers.rb b/spec/support/features/session_helpers.rb index 1dbfd827f..bc22bb3f2 100644 --- a/spec/support/features/session_helpers.rb +++ b/spec/support/features/session_helpers.rb @@ -27,7 +27,7 @@ def sign_in(email, password) fill_in 'Email', with: email fill_in 'Password', with: password end - click_button 'Sign in' + click_button I18n.t('navigation.sign_in') end def sign_in_admin(email, password) @@ -36,7 +36,7 @@ def sign_in_admin(email, password) fill_in 'admin_email', with: email fill_in 'admin_password', with: password end - click_button 'Sign in' + click_button I18n.t('navigation.sign_in') end def sign_up(name, email, password, confirmation) @@ -45,7 +45,7 @@ def sign_up(name, email, password, confirmation) fill_in 'user_email', with: email fill_in 'user_password', with: password fill_in 'user_password_confirmation', with: confirmation - click_button 'Sign up' + click_button I18n.t('navigation.sign_up') end def sign_up_admin(name, email, password, confirmation) @@ -54,17 +54,17 @@ def sign_up_admin(name, email, password, confirmation) fill_in 'admin_email', with: email fill_in 'admin_password', with: password fill_in 'admin_password_confirmation', with: confirmation - click_button 'Sign up' + click_button I18n.t('navigation.sign_up') end def create_api_app(name, main_url, callback_url) - click_link 'Register new application' + click_link I18n.t('buttons.register_new_application') within('#new_api_application') do fill_in 'Name', with: name fill_in 'Main URL', with: main_url fill_in 'Callback URL', with: callback_url end - click_button 'Register application' + click_button I18n.t('buttons.register_application') end def update_api_app(name, main_url, callback_url) @@ -73,7 +73,7 @@ def update_api_app(name, main_url, callback_url) fill_in 'Main URL', with: main_url fill_in 'Callback URL', with: callback_url end - click_button 'Update application' + click_button I18n.t('buttons.update_application') end def visit_app(name, main_url)