From 1c579305eca2301f4c8c54c0ed2d450ce22e1754 Mon Sep 17 00:00:00 2001 From: peggles2 Date: Wed, 11 Mar 2020 10:24:08 -0400 Subject: [PATCH] Add first last name to form (#542) * SRCH-1266 - Create first_name last_name column in users table --- app/controllers/admin/users_controller.rb | 17 ++- app/controllers/concerns/accountable.rb | 8 +- app/controllers/sites/users_controller.rb | 2 +- app/controllers/users_controller.rb | 6 +- app/helpers/sites_helper.rb | 3 +- app/mailers/emailer.rb | 28 ++-- app/models/affiliate.rb | 2 +- app/models/user.rb | 7 +- app/models/watcher.rb | 9 +- app/views/sites/users/index.html.haml | 3 +- app/views/sites/users/new.html.haml | 6 +- app/views/users/_form.haml | 8 +- app/views/users/_new_form.haml | 8 +- app/views/users/show.html.haml | 7 +- .../update_external_tracking_code.erb | 2 +- features/admin.feature | 18 +-- features/admin_center_activate_search.feature | 20 +-- .../admin_center_clicks_and_queries.feature | 4 +- features/admin_center_dashboard.feature | 50 ++++--- features/admin_center_manage_content.feature | 134 ++++++++--------- features/admin_center_manage_display.feature | 84 +++++------ .../admin_center_referrer_analytics.feature | 4 +- .../admin_center_third_party_tracking.feature | 4 +- features/admin_center_watchers.feature | 36 ++--- features/blended_search.feature | 34 ++--- features/image_search.feature | 16 +-- features/legacy_search.feature | 132 ++++++++--------- features/mobile_image_searches.feature | 4 +- features/mobile_searches.feature | 136 +++++++++--------- features/mobile_searches_bing_v7.feature | 126 ++++++++-------- features/responsive_search.feature | 10 +- features/searchgov_search.feature | 4 +- features/step_definitions/affiliate_steps.rb | 5 +- features/step_definitions/user_steps.rb | 3 +- features/trending_urls.feature | 6 +- features/user_sessions.feature | 6 +- features/users.feature | 28 ++-- .../sites/users_controller_spec.rb | 18 ++- spec/controllers/users_controller_spec.rb | 12 +- spec/fixtures/json/hints.json | 3 +- .../watcher/low_query_ctr_watcher_body.json | 3 +- .../json/watcher/no_results_watcher_body.json | 3 +- spec/fixtures/users.yml | 63 +++++--- spec/lib/importers/hint_data_spec.rb | 10 +- spec/mailers/emailer_spec.rb | 64 +++++---- spec/models/affiliate_spec.rb | 24 +++- spec/models/user_spec.rb | 68 +++++---- spec/support/shared_concern_accountable.rb | 21 ++- 48 files changed, 698 insertions(+), 571 deletions(-) diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb index 6dbc5bfa75..9538d020a3 100644 --- a/app/controllers/admin/users_controller.rb +++ b/app/controllers/admin/users_controller.rb @@ -1,8 +1,12 @@ class Admin::UsersController < Admin::AdminController active_scaffold :user do |config| config.actions.exclude :create, :delete - config.columns = [:email, :contact_name, :memberships, :default_affiliate, :created_at, :updated_at, :approval_status] - config.update.columns = [:email, :contact_name, :organization_name, :is_affiliate_admin, :is_affiliate, :approval_status, :default_affiliate, :welcome_email_sent] + config.columns = %I[email first_name last_name + memberships default_affiliate created_at + updated_at approval_status] + config.update.columns = %I[ email first_name last_name organization_name + is_affiliate_admin is_affiliate approval_status + default_affiliate welcome_email_sent] config.list.sorting = { :created_at => :desc } config.columns[:is_affiliate_admin].description = "Set this to true to make the user an Administrator, and give them access to the Admin Center." config.columns[:is_affiliate].description = "Set this to true to make the user an Affiliate, and give them access to the Affiliate Center." @@ -13,10 +17,11 @@ class Admin::UsersController < Admin::AdminController config.actions.add :export config.actions.exclude :search config.actions.add :field_search - config.field_search.columns = %i(id email contact_name approval_status) + config.field_search.columns = %i[id email first_name last_name approval_status] - export.columns = %i(email contact_name affiliate_names last_login_at last_login_ip last_request_at - created_at updated_at organization_name is_affiliate_admin is_affiliate approval_status - welcome_email_sent) + export.columns = %i[email first_name last_name affiliate_names + last_login_at last_login_ip last_request_at + created_at updated_at organization_name is_affiliate_admin + is_affiliate approval_status welcome_email_sent] end end diff --git a/app/controllers/concerns/accountable.rb b/app/controllers/concerns/accountable.rb index 492bcdeb49..dbf0fb9d69 100644 --- a/app/controllers/concerns/accountable.rb +++ b/app/controllers/concerns/accountable.rb @@ -4,8 +4,10 @@ module Accountable def incomplete_account_error - if current_user&.contact_name.blank? - current_user.errors[:contact_name] << 'You must supply a contact name' + if current_user&.first_name.blank? + current_user.errors[:first_name] << 'You must supply a first name' + elsif current_user&.last_name.blank? + current_user.errors[:last_name] << 'You must supply a last name' elsif current_user&.organization_name.blank? current_user.errors[:organization_name] << 'You must supply an organization name' end @@ -19,7 +21,7 @@ def check_user_account_complete edit_account_path, flash: { error: - 'To complete your registration, please make sure Name, and '\ + 'To complete your registration, please make sure First name, Last name, and '\ 'Government agency are not empty' } ) diff --git a/app/controllers/sites/users_controller.rb b/app/controllers/sites/users_controller.rb index dc146dbb6e..8140f35393 100644 --- a/app/controllers/sites/users_controller.rb +++ b/app/controllers/sites/users_controller.rb @@ -42,6 +42,6 @@ def destroy private def user_params - @user_params ||= params.require(:user).permit(:contact_name, :email).to_h + @user_params ||= params.require(:user).permit(:first_name, :last_name, :email).to_h end end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 049294b35d..03224505c2 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -51,8 +51,7 @@ def update end end - def developer_redirect - end + def developer_redirect; end private @@ -65,7 +64,8 @@ def set_user end def user_params - params.require(:user).permit(:contact_name, + params.require(:user).permit(:first_name, + :last_name, :organization_name, :email).to_h end diff --git a/app/helpers/sites_helper.rb b/app/helpers/sites_helper.rb index 11713e659d..b3b2d9bbeb 100644 --- a/app/helpers/sites_helper.rb +++ b/app/helpers/sites_helper.rb @@ -2,7 +2,8 @@ module SitesHelper def site_data { user: { - contact_name: current_user.contact_name, + first_name: current_user.first_name, + last_name: current_user.last_name, email: current_user.email, id: current_user.id } diff --git a/app/mailers/emailer.rb b/app/mailers/emailer.rb index 7a3a634ffb..8a88789cc2 100644 --- a/app/mailers/emailer.rb +++ b/app/mailers/emailer.rb @@ -11,11 +11,10 @@ class Emailer < ApplicationMailer def new_user_to_admin(user) @user = user - @user_contact_name = user.contact_name.presence || user.email + @user_contact_name = get_contact_name(user) if @user.affiliates.any? - @user_inviter_contact_name = @user.inviter.contact_name.presence || - @user.inviter.email + @user_inviter_contact_name = get_contact_name(@user.inviter) end setup_email('usagov@search.gov', __method__) @@ -34,38 +33,38 @@ def new_feature_adoption_to_admin def account_deactivation_warning(user, date) @user = user @remaining_days = (date - 90.days.ago.to_date).to_i - @user_contact_name = user.contact_name.presence || user.email + @user_contact_name = get_contact_name(user) generic_user_html_email(user, __method__) end def user_approval_removed(user) @user = user - @user_contact_name = user.contact_name.presence || user.email + @user_contact_name = get_contact_name(user) setup_email("usagov@search.gov", __method__) send_mail(:text) end def account_deactivated(user) @user = user - @user_contact_name = user.contact_name.presence || user.email + @user_contact_name = get_contact_name(user) generic_user_html_email(user, __method__) end def welcome_to_new_user(user) @new_site_url = new_site_url - @user_contact_name = user.contact_name.presence || user.email + @user_contact_name = get_contact_name(user) generic_user_html_email(user, __method__) end def new_affiliate_site(affiliate, user) @affiliate = affiliate - @user_contact_name = user.contact_name.presence || user.email + @user_contact_name = get_contact_name(user) generic_user_text_email(user, __method__) end def new_affiliate_user(affiliate, user, current_user) - @added_by_contact_name = current_user.contact_name.presence || current_user.email - @added_user_contact_name = user.contact_name.presence || user.email + @added_by_contact_name = get_contact_name(current_user) + @added_user_contact_name = get_contact_name(user) @affiliate_display_name = affiliate.display_name @affiliate_name = affiliate.name @affiliate_site_url = site_url(affiliate) @@ -75,8 +74,8 @@ def new_affiliate_user(affiliate, user, current_user) def welcome_to_new_user_added_by_affiliate(affiliate, user, current_user) @account_url = account_url - @added_by_contact_name = current_user.contact_name.presence || current_user.email - @added_user_contact_name = user.contact_name.presence || user.email + @added_by_contact_name = get_contact_name(current_user) + @added_user_contact_name = get_contact_name(user) @added_user_email = user.email @affiliate_display_name = affiliate.display_name @affiliate_site_url = site_url(affiliate) @@ -200,4 +199,9 @@ def generic_user_html_email(user, method) setup_email(user.email, method) send_mail(:html) end + + def get_contact_name(user) + full_name = "#{user.first_name} #{user.last_name}" + full_name.presence || user.email + end end diff --git a/app/models/affiliate.rb b/app/models/affiliate.rb index ac7886c29c..b726a3ccb9 100644 --- a/app/models/affiliate.rb +++ b/app/models/affiliate.rb @@ -72,7 +72,7 @@ def make_unavailable(template_ids) end has_many :available_templates, through: :affiliate_templates, source: :template - has_many :users, -> { order 'contact_name' }, through: :memberships + has_many :users, -> { order 'first_name' }, through: :memberships has_many :default_users, class_name: 'User', diff --git a/app/models/user.rb b/app/models/user.rb index 11238053b0..051aed693a 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -5,7 +5,8 @@ class User < ApplicationRecord validates :email, presence: true validates :approval_status, inclusion: APPROVAL_STATUSES - validates :contact_name, presence: true, on: :update_account + validates :first_name, presence: true, on: :update_account + validates :last_name, presence: true, on: :update_account validates :organization_name, presence: true, on: :update_account has_many :memberships, dependent: :destroy has_many :affiliates, lambda { @@ -73,11 +74,11 @@ class User < ApplicationRecord # end def complete? - contact_name.present? && organization_name.present? + last_name.present? && first_name.present? && organization_name.present? end def to_label - "#{contact_name} <#{email}>" + "#{first_name} #{last_name} <#{email}>" end def is_affiliate_or_higher diff --git a/app/models/watcher.rb b/app/models/watcher.rb index f55a72dcd7..6e0e4f7321 100644 --- a/app/models/watcher.rb +++ b/app/models/watcher.rb @@ -102,15 +102,14 @@ def email_template end def metadata_hash - { - affiliate: affiliate.name, + { affiliate: affiliate.name, affiliate_id: affiliate.id, affiliate_homepage_url: affiliate.website, alert_name: name, user_email: user.email, user_id: user.id, - user_contact_name: user.contact_name, - watcher_type: self.class.name - } + user_first_name: user.first_name, + user_last_name: user.last_name, + watcher_type: self.class.name } end end diff --git a/app/views/sites/users/index.html.haml b/app/views/sites/users/index.html.haml index c54951fd54..8c427c9916 100644 --- a/app/views/sites/users/index.html.haml +++ b/app/views/sites/users/index.html.haml @@ -12,7 +12,8 @@ - @users.each do |user| %tr{ user_row_css_class_hash(user) } %td - %span #{user.contact_name} + %span #{user.first_name} + %span #{user.last_name} %br %span.muted #{user.email} diff --git a/app/views/sites/users/new.html.haml b/app/views/sites/users/new.html.haml index be20f0dc7c..d2e47da948 100644 --- a/app/views/sites/users/new.html.haml +++ b/app/views/sites/users/new.html.haml @@ -10,7 +10,9 @@ = render_flash_message = render_error_messages(@user) - = f.label :contact_name, 'Name', class: 'required' - = f.text_field :contact_name, class: 'required input-primary' + = f.label :first_name, 'First name', class: 'required' + = f.text_field :first_name, class: 'required input-primary' + = f.label :last_name, 'Last name', class: 'required' + = f.text_field :last_name, class: 'required input-primary' = f.label :email, 'Email', class: 'required' = f.text_field :email, class: 'required' diff --git a/app/views/users/_form.haml b/app/views/users/_form.haml index 18dbc43b8e..90b84e10ca 100644 --- a/app/views/users/_form.haml +++ b/app/views/users/_form.haml @@ -1,8 +1,12 @@ = render_flash_message = render_error_messages(@user) -= form.label :contact_name, 'Name', class: 'required' -= form.text_field :contact_name, class: 'required input-primary' += form.label :first_name, 'First name', class: 'required' += form.text_field :first_name, class: 'required input-primary' + += form.label :last_name, 'Last name', class: 'required' += form.text_field :last_name, class: 'required input-primary' + = form.label :organization_name, 'Government agency' = form.text_field :organization_name = form.label :email, 'Email', class: 'required' diff --git a/app/views/users/_new_form.haml b/app/views/users/_new_form.haml index 12ea7d7f04..c427cb3ffa 100644 --- a/app/views/users/_new_form.haml +++ b/app/views/users/_new_form.haml @@ -1,6 +1,10 @@ = render_error_messages(@user) -= form.label :contact_name, 'Your full name' -= form.text_field :contact_name, placeholder: 'Your full name' += form.label :first_name, 'First name' += form.text_field :first_name, 'First name', placeholder: 'Your first name' + += form.label :last_name, 'Last name' += form.text_field :last_name, 'Last name', placeholder: 'Your last name' + = form.label :organization_name, 'Federal government agency' = form.text_field :organization_name, placeholder: 'Federal government agency' = form.label :email diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml index fa2752f3f3..4d15949773 100644 --- a/app/views/users/show.html.haml +++ b/app/views/users/show.html.haml @@ -9,8 +9,11 @@ = render_flash_message %dl - %dt Name - %dd= @user.contact_name + %dt First name + %dd= @user.first_name +%dl + %dt Last name + %dd= @user.last_name %dl %dt Agency %dd= @user.organization_name diff --git a/db/email_templates/update_external_tracking_code.erb b/db/email_templates/update_external_tracking_code.erb index 00e8991649..5da0b9f865 100644 --- a/db/email_templates/update_external_tracking_code.erb +++ b/db/email_templates/update_external_tracking_code.erb @@ -1,5 +1,5 @@ Site: <%= @affiliate.display_name %> (<%= edit_admin_affiliate_url(@affiliate, :anchor => "record_external_tracking_code_#{@affiliate.id}") %>) -Requested by: <%= "#{@current_user.contact_name} <#{@current_user.email}>" %> +Requested by: <%= "#{@current_user.first_name} #{@current_user.last_name} <#{@current_user.email}>" %> External tracking code: diff --git a/features/admin.feature b/features/admin.feature index 02b36f8327..b10c50392f 100644 --- a/features/admin.feature +++ b/features/admin.feature @@ -24,8 +24,8 @@ Feature: Administration Scenario: Visiting the affiliate admin page as an admin Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | website | - | agency site | agency.gov | one@foo.gov | One Foo | http://beta.agency.gov | + | display_name | name | contact_email | first_name | last_name | website | + | agency site | agency.gov | one@foo.gov | One | Foo | http://beta.agency.gov | And the following "site domains" exist for the affiliate agency.gov: | domain | site_name | | www1.agency-site.gov | Agency Website | @@ -49,8 +49,8 @@ Feature: Administration @javascript Scenario: Editing an affiliate as an admin Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | website | - | agency site | agency.gov | one@foo.gov | One Foo | http://beta.agency.gov | + | display_name | name | contact_email | first_name | last_name | website | + | agency site | agency.gov | one@foo.gov | One | Foo | http://beta.agency.gov | When I go to the admin sites page When I follow "Edit" within the first scaffold row Then I should see "Settings (Show)" @@ -80,8 +80,8 @@ Feature: Administration Scenario: Viewing Boosted Content (both affiliate and Search.USA.gov) Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | - | bar site | bar.gov | aff@bar.gov | John Bar | + | display_name | name | contact_email | first_name | last_name | + | bar site | bar.gov | aff@bar.gov | John | Bar | And the following Boosted Content entries exist for the affiliate "bar.gov" | title | url | description | keywords | | Bar Emergency Page | http://www.bar.gov/911 | This should not show up in results | safety | @@ -95,9 +95,9 @@ Feature: Administration Scenario: Comparing Search Results Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | - | agency site | aff.gov | one@foo.gov | One Foo | - | agency site 2 | aff2.gov | two@foo.gov | Two Foo | + | display_name | name | contact_email | first_name | last_name | + | agency site | aff.gov | one@foo.gov | One | Foo | + | agency site 2 | aff2.gov | two@foo.gov | Two | Foo | And the following "site domains" exist for the affiliate aff.gov: | domain | site_name | | aff.gov | Agency Website | diff --git a/features/admin_center_activate_search.feature b/features/admin_center_activate_search.feature index ea627f74d4..54fa5845fe 100644 --- a/features/admin_center_activate_search.feature +++ b/features/admin_center_activate_search.feature @@ -2,8 +2,8 @@ Feature: Activate Search Scenario: Getting an embed code for my affiliate site search Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | - | aff site | aff.gov | aff@bar.gov | John Bar | + | display_name | name | contact_email | first_name | last_name | + | aff site | aff.gov | aff@bar.gov | John | Bar | And I am logged in with email "aff@bar.gov" When I go to the aff.gov's Activate Search page Then I should see "Form Snippet" @@ -12,16 +12,16 @@ Feature: Activate Search Scenario: Getting an embed code for my affiliate site search in Spanish Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | locale | - | aff site | aff.gov | aff@bar.gov | John Bar | es | + | display_name | name | contact_email | first_name | last_name | locale | + | aff site | aff.gov | aff@bar.gov | John | Bar | es | And I am logged in with email "aff@bar.gov" When I go to the aff.gov's Activate Search page Then I should see the code for Spanish language sites Scenario: Visiting the Site API Access Key Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | api_access_key | - | aff site | aff.gov | aff@bar.gov | John Bar | MY_AWESOME_KEY | + | display_name | name | contact_email | first_name | last_name | api_access_key | + | aff site | aff.gov | aff@bar.gov | John | Bar | MY_AWESOME_KEY | And I am logged in with email "aff@bar.gov" When I go to the aff.gov's Activate Search page And I follow "API Access Key" @@ -29,8 +29,8 @@ Feature: Activate Search Scenario: Visiting the Site API Instructions Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | - | aff site | aff.gov | aff@bar.gov | John Bar | + | display_name | name | contact_email | first_name | last_name | + | aff site | aff.gov | aff@bar.gov | John | Bar | And affiliate "aff.gov" has the following RSS feeds: | name | url | | News-1 | https://www.usa.gov/feed/news-1 | @@ -48,8 +48,8 @@ Feature: Activate Search Scenario: Visiting the Site i14y Content Indexing API Instructions Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | gets_i14y_results | - | aff site | aff.gov | aff@bar.gov | John Bar | true | + | display_name | name | contact_email | first_name | last_name | gets_i14y_results | + | aff site | aff.gov | aff@bar.gov | John Bar | Bar | true | And I am logged in with email "aff@bar.gov" When I go to the aff.gov's Activate Search page And I follow "i14y Content Indexing API Instructions" diff --git a/features/admin_center_clicks_and_queries.feature b/features/admin_center_clicks_and_queries.feature index c154c81ca8..08331869fc 100644 --- a/features/admin_center_clicks_and_queries.feature +++ b/features/admin_center_clicks_and_queries.feature @@ -5,8 +5,8 @@ Feature: Clicks and Queries stats Scenario: Viewing the Site's Analytics Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | - | aff site | aff.gov | aff@bar.gov | John Bar | + | display_name | name | contact_email | first_name | last_name | + | aff site | aff.gov | aff@bar.gov | John | Bar | And I am logged in with email "aff@bar.gov" When I go to the aff.gov's Analytics page And I follow "Queries" diff --git a/features/admin_center_dashboard.feature b/features/admin_center_dashboard.feature index 27cb2bc222..1ea0536e9d 100644 --- a/features/admin_center_dashboard.feature +++ b/features/admin_center_dashboard.feature @@ -2,9 +2,9 @@ Feature: Dashboard Scenario: Visiting /sites for user with existing sites Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | - | agency1 site | 1.agency.gov | manager@agency.gov | John Manager | - | agency3 site | 3.agency.gov | manager@agency.gov | John Manager | + | display_name | name | contact_email | first_name | last_name | + | agency1 site | 1.agency.gov | manager@agency.gov | John | Manager | + | agency3 site | 3.agency.gov | manager@agency.gov | John | Manager | And I am logged in with email "manager@agency.gov" When I go to the sites page Then I should see "agency1 site" @@ -82,8 +82,8 @@ Feature: Dashboard @javascript Scenario: Cloning a site Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | - | origin site | origin_site | john@agency.gov | John Manager | + | display_name | name | contact_email | first_name | last_name | + | origin site | origin_site | john@agency.gov | John | Manager | And I am logged in with email "john@agency.gov" When I go to the origin_site's Dashboard page And I follow "Clone Site" @@ -111,9 +111,9 @@ Feature: Dashboard Scenario: List users Given the following Users exist: - | contact_name | email | - | John Admin | admin1@fixtures.gov | - | Jane Admin | admin2@fixtures.gov | + | first_name | last_name | email | + | John | Admin | admin1@fixtures.gov | + | Jane | Admin | admin2@fixtures.gov | And the Affiliate "usagov" has the following users: | email | | admin1@fixtures.gov | @@ -122,9 +122,9 @@ Feature: Dashboard When I go to the usagov's Dashboard page And I follow "Manage Users" Then I should see the following table rows: - | Affiliate Manager affiliate_manager@fixtures.org | - | Jane Admin admin2@fixtures.gov | - | John Admin admin1@fixtures.gov | + | Affiliate Manager Smith affiliate_manager@fixtures.org | + | Jane Admin admin2@fixtures.gov | + | John Admin admin1@fixtures.gov | @javascript Scenario: Add/remove user @@ -133,14 +133,16 @@ Feature: Dashboard And I follow "Manage Users" And I follow "Add User" When I fill in the following: - | Name | Another Admin | - | Email | another_affiliate_manager@fixtures.org | + | First name | Another | + | Last name | Admin | + | Email | another_affiliate_manager@fixtures.org | And I submit the form by pressing "Add" Then I should see "You have added another_affiliate_manager@fixtures.org to this site" When I follow "Add User" And I fill in the following: - | Name | Admin Doe | - | Email | | + | First name | Admin | + | Last name | Doe | + | Email | | And I submit the form by pressing "Add" Then I should see "Email can't be blank" When I fill in "Email" with "admin@email.gov" @@ -157,8 +159,9 @@ Feature: Dashboard And I follow "Manage Users" And I follow "Add User" When I fill in the following: - | Name | Jane Admin | - | Email | jane@admin.org | + | First name | Jane | + | Last name | Doe | + | Email | jane@admin.org | And I submit the form by pressing "Add" And I sign out Then "jane@admin.org" should receive an email @@ -175,7 +178,8 @@ Feature: Dashboard And I follow "Manage Users" And I follow "Add User" When I fill in the following: - | Name | Marylin Admin | + | First name | Marylin | + | Last name | Admin | | Email | marilyn@fixtures.org | And I submit the form by pressing "Add" And I sign out @@ -186,9 +190,9 @@ Feature: Dashboard @javascript Scenario: Preview Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | has_staged_content | uses_managed_header_footer | staged_uses_managed_header_footer | header | staged_header | website | force_mobile_format | - | agency site | legacy.agency.gov | john@agency.gov | John Bar | true | false | false | live header text | staged header text | http://www.agency.gov | false | - | agency site | www.agency.gov | john@agency.gov | John Bar | true | false | false | live header text | staged header text | http://www.agency.gov | true | + | display_name | name | contact_email | first_name | last_name | has_staged_content | uses_managed_header_footer | staged_uses_managed_header_footer | header | staged_header | website | force_mobile_format | + | agency site | legacy.agency.gov | john@agency.gov | John | Bar | true | false | false | live header text | staged header text | http://www.agency.gov | false | + | agency site | www.agency.gov | john@agency.gov | John | Bar | true | false | false | live header text | staged header text | http://www.agency.gov | true | And I am logged in with email "john@agency.gov" When I go to the legacy.agency.gov's Dashboard page And I follow "Preview" within the Admin Center main navigation list @@ -243,8 +247,8 @@ Feature: Dashboard Scenario: Performing site autodiscovery Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | has_staged_content | uses_managed_header_footer | staged_uses_managed_header_footer | header | staged_header | force_mobile_format | - | agency site | agency.gov | john@agency.gov | John Bar | true | false | false | live header text | staged header text | false | + | display_name | name | contact_email | first_name | last_name | has_staged_content | uses_managed_header_footer | staged_uses_managed_header_footer | header | staged_header | force_mobile_format | + | agency site | agency.gov | john@agency.gov | John | Bar | true | false | false | live header text | staged header text | false | And I am logged in with email "john@agency.gov" When I go to the agency.gov's Manage Content page Then the "Discover and add the RSS feeds and social media accounts listed on the following page:" field should be empty diff --git a/features/admin_center_manage_content.feature b/features/admin_center_manage_content.feature index bc4063ff5d..3f66d8e9f5 100644 --- a/features/admin_center_manage_content.feature +++ b/features/admin_center_manage_content.feature @@ -9,8 +9,8 @@ Feature: Manage Content Scenario: View best bets graphics Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | - | agency site | agency.gov | john@agency.gov | John Bar | + | display_name | name | contact_email | first_name | last_name | + | agency site | agency.gov | john@agency.gov | John | Bar | And the following featured collections exist for the affiliate "agency.gov": | title | title_url | status | publish_start_on | publish_end_on | keywords | | Tornado Warning | http://agency.gov/tornado-warning | active | 2013-07-01 | | | @@ -29,8 +29,8 @@ Feature: Manage Content Scenario: Filtering best bets graphics Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | - | agency site | agency.gov | john@agency.gov | John Bar | + | display_name | name | contact_email | first_name | last_name | + | agency site | agency.gov | john@agency.gov | John | Bar | And the following featured collections exist for the affiliate "agency.gov": | title | title_url | status | publish_start_on | publish_end_on | keywords | | Tornado Warning | http://agency.gov/tornado-warning | active | 2013-07-01 | | | @@ -52,8 +52,8 @@ Feature: Manage Content Scenario: Add/edit/remove best bets graphics Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | - | agency site | agency.gov | john@agency.gov | John Bar | + | display_name | name | contact_email | first_name | last_name | + | agency site | agency.gov | john@agency.gov | John | Bar | And I am logged in with email "john@agency.gov" When I go to the agency.gov's Manage Content page And I follow "Best Bets: Graphics" within the Admin Center content @@ -119,8 +119,8 @@ Feature: Manage Content Scenario: View best bets texts Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | - | agency site | agency.gov | john@agency.gov | John Bar | + | display_name | name | contact_email | first_name | last_name | + | agency site | agency.gov | john@agency.gov | John | Bar | When the following Boosted Content entries exist for the affiliate "agency.gov" | url | title | description | status | publish_start_on | publish_end_on | | http://search.gov/releases/2013-05-31.html | Notes for Week Ending May 31, 2013 | multimedia gallery | active | 2013-08-01 | 2022-01-01 | @@ -136,8 +136,8 @@ Feature: Manage Content Scenario: Filtering best bets texts Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | - | agency site | agency.gov | john@agency.gov | John Bar | + | display_name | name | contact_email | first_name | last_name | + | agency site | agency.gov | john@agency.gov | John | Bar | When the following Boosted Content entries exist for the affiliate "agency.gov" | url | title | description | status | publish_start_on | publish_end_on | | http://search.gov/releases/2013-05-31.html | Notes for Week Ending May 31, 2013 | multimedia gallery | active | 2013-08-01 | 2022-01-01 | @@ -158,8 +158,8 @@ Feature: Manage Content Scenario: Add/edit/remove best bets texts Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | - | agency site | agency.gov | john@agency.gov | John Bar | + | display_name | name | contact_email | first_name | last_name | + | agency site | agency.gov | john@agency.gov | John | Bar | And I am logged in with email "john@agency.gov" When I go to the agency.gov's Manage Content page And I follow "Best Bets: Text" within the Admin Center content @@ -197,8 +197,8 @@ Feature: Manage Content Scenario: Bulk upload best bets texts Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | - | agency site | agency.gov | john@agency.gov | John Bar | + | display_name | name | contact_email | first_name | last_name | + | agency site | agency.gov | john@agency.gov | John | Bar | And I am logged in with email "john@agency.gov" When I go to the agency.gov's Manage Content page And I follow "Best Bets: Text" within the Admin Center content @@ -210,8 +210,8 @@ Feature: Manage Content Scenario: View Collections Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | - | agency site | agency.gov | john@agency.gov | John Bar | + | display_name | name | contact_email |first_name | last_name | + | agency site | agency.gov | john@agency.gov | John | Bar | And affiliate "agency.gov" has the following document collections: | name | prefixes | | News | agency1.gov/news/ | @@ -228,8 +228,8 @@ Feature: Manage Content Scenario: Add/edit/remove Collection Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | - | agency site | agency.gov | john@agency.gov | John Bar | + | display_name | name | contact_email | first_name | last_name | + | agency site | agency.gov | john@agency.gov | John | Bar | And I am logged in with email "john@agency.gov" When I go to the agency.gov's Manage Content page And I follow "Collection" within the Admin Center content @@ -264,8 +264,8 @@ Feature: Manage Content Scenario: View Routed Queries Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | - | agency site | agency.gov | john@agency.gov | John Bar | + | display_name | name | contact_email | first_name | last_name | + | agency site | agency.gov | john@agency.gov | John | Bar | And affiliate "agency.gov" has the following routed queries: | description | url | keywords | | Free Money | https://www.usa.gov/unclaimed-money | free money, unclaimed money | @@ -279,8 +279,8 @@ Feature: Manage Content Scenario: Add/Edit/Remove Routed Query Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | - | agency site | agency.gov | john@agency.gov | John Bar | + | display_name | name | contact_email | first_name | last_name | + | agency site | agency.gov | john@agency.gov | John | Bar | And I am logged in with email "john@agency.gov" When I go to the agency.gov's Manage Content page And I follow "Routed Queries" within the Admin Center content @@ -307,8 +307,8 @@ Feature: Manage Content Scenario: View domains Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | - | agency site | agency.gov | john@agency.gov | John Bar | + | display_name | name | contact_email | first_name | last_name | + | agency site | agency.gov | john@agency.gov | John | Bar | When the following "site domains" exist for the affiliate agency.gov: | domain | | whitehouse.gov | @@ -327,8 +327,8 @@ Feature: Manage Content Scenario: Add/edit/remove domains Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | - | agency site | agency.gov | john@agency.gov | John Bar | + | display_name | name | contact_email | first_name | last_name | + | agency site | agency.gov | john@agency.gov | John | Bar | And I am logged in with email "john@agency.gov" When I go to the agency.gov's Manage Content page And I follow "Domains" within the Admin Center content @@ -350,8 +350,8 @@ Feature: Manage Content Scenario: View i14y drawers Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | gets_i14y_results | - | agency site | agency.gov | john@agency.gov | John Bar | true | + | display_name | name | contact_email | first_name | last_name | gets_i14y_results | + | agency site | agency.gov | john@agency.gov | John | Bar | true | And the following "i14y drawers" exist for the affiliate agency.gov: | handle | token | description | | blog_posts | token 1 | All our blog posts | @@ -377,8 +377,8 @@ Feature: Manage Content Scenario: Add/edit/remove i14y drawers Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | gets_i14y_results | - | agency site | agency.gov | john@agency.gov | John Bar | true | + | display_name | name | contact_email | first_name | last_name | gets_i14y_results | + | agency site | agency.gov | john@agency.gov | John | Bar | true | And we don't want observers to run during these cucumber scenarios And I am logged in with email "john@agency.gov" When I go to the agency.gov's Manage Content page @@ -391,8 +391,8 @@ Feature: Manage Content And I fill in "Description" with "This is optional but nice to have" And I submit the form by pressing "Add" Then I should see the following table rows: - | Handle | Description | Document Total | Last Document Sent | - | another_one | This is optional but nice to have | | | + | Handle | Description | Document Total | Last Document Sent | + | another_one | This is optional but nice to have | | | And I should see "You have created the another_one i14y drawer." When I follow "Edit" within the first table body row And I fill in "Description" with "This describes it" @@ -404,9 +404,9 @@ Feature: Manage Content Scenario: Sharing i14y drawers Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | gets_i14y_results | - | agency site | agency.gov | john@agency.gov | John Bar | true | - | another site | another.gov | jane@another.gov | Jane Bar | true | + | display_name | name | contact_email | first_name | last_name | gets_i14y_results | + | agency site | agency.gov | john@agency.gov | John Bar | bar | true | + | another site | another.gov | jane@another.gov | Jane Bar | bar | true | And I am logged in with email "affiliate_admin@fixtures.org" And we don't want observers to run during these cucumber scenarios And the following "i14y drawers" exist for the affiliate agency.gov: @@ -424,8 +424,8 @@ Feature: Manage Content Scenario: View Filter URLs Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | - | agency site | agency.gov | john@agency.gov | John Bar | + | display_name | name | contact_email | first_name | last_name | + | agency site | agency.gov | john@agency.gov | John | Bar | And the following Excluded URLs exist for the site "agency.gov": | url | | http://aff.gov/bad-url1 | @@ -438,8 +438,8 @@ Feature: Manage Content Scenario: Add/remove Filter URL Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | - | agency site | agency.gov | john@agency.gov | John Bar | + | display_name | name | contact_email | first_name | last_name | + | agency site | agency.gov | john@agency.gov | John | Bar | And I am logged in with email "john@agency.gov" When I go to the agency.gov's Filter URLs page And I follow "Add Filter URL" @@ -453,8 +453,8 @@ Feature: Manage Content Scenario: Add/remove Filter Tag Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | gets_i14y_results | - | agency site | agency.gov | john@agency.gov | John Bar | true | + | display_name | name | contact_email | first_name | last_name | gets_i14y_results | + | agency site | agency.gov | john@agency.gov | John | Bar | true | And I am logged in with email "john@agency.gov" When I go to the agency.gov's Filter Tags page And I follow "Add Filter Tag" @@ -482,8 +482,8 @@ Feature: Manage Content Scenario: View Flickr URLs Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | - | agency site | agency.gov | john@agency.gov | John Bar | + | display_name | name | contact_email | first_name | last_name | + | agency site | agency.gov | john@agency.gov | John | Bar | When the following flickr URLs exist for the site "agency.gov": | url | | http://www.flickr.com/photos/whitehouse/ | @@ -497,8 +497,8 @@ Feature: Manage Content Scenario: Add/remove Flickr URL Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | - | agency site | agency.gov | john@agency.gov | John Bar | + | display_name | name | contact_email | first_name | last_name | + | agency site | agency.gov | john@agency.gov | John | Bar | And I am logged in with email "john@agency.gov" When I go to the agency.gov's Manage Content page And I follow "Flickr" within the Admin Center content @@ -511,8 +511,8 @@ Feature: Manage Content Scenario: View/Remove Instagram usernames Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | - | agency site | agency.gov | john@agency.gov | John Bar | + | display_name | name | contact_email | first_name | last_name | + | agency site | agency.gov | john@agency.gov | John | Bar | When the following Instagram usernames exist for the site "agency.gov": | username | | whitehouse | @@ -528,8 +528,8 @@ Feature: Manage Content Scenario: View RSS Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | - | agency site | agency.gov | john@agency.gov | John Bar | + | display_name | name | contact_email | first_name | last_name | + | agency site | agency.gov | john@agency.gov | John | Bar | And affiliate "agency.gov" has the following RSS feeds: | name | url | last_crawl_status | last_crawled_at | show_only_media_content | is_managed | | News | search.gov/all.atom | OK | 2013-01-01 | | | @@ -555,8 +555,8 @@ Feature: Manage Content Scenario: Add/edit/remove RSS Feed Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | - | agency site | agency.gov | john@agency.gov | John Bar | + | display_name | name | contact_email | first_name | last_name | + | agency site | agency.gov | john@agency.gov | John | Bar | And I am logged in with email "john@agency.gov" And www.fda.gov has valid RSS feeds When I go to the agency.gov's Manage Content page @@ -586,8 +586,8 @@ Feature: Manage Content Scenario: Edit/remove Supplemental Feed Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | - | agency site | agency.gov | john@agency.gov | John Bar | + | display_name | name | contact_email | first_name | last_name | + | agency site | agency.gov | john@agency.gov | John | Bar | And I am logged in with email "john@agency.gov" When I go to the agency.gov's Supplemental URLs page And I access the "Advanced" dropdown menu @@ -607,8 +607,8 @@ Feature: Manage Content Scenario: View Supplemental URLs Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | - | agency site | agency.gov | john@agency.gov | John Bar | + | display_name | name | contact_email | first_name | last_name | + | agency site | agency.gov | john@agency.gov | John | Bar | And the following IndexedDocuments exist: | url | title | description | affiliate | last_crawled_at | last_crawl_status | source | | http://aff.gov/extremelysuperlongurl/space-suit | Space Suit Evolution | description text for space suit | agency.gov | 11/02/2011 | OK | manual | @@ -624,8 +624,8 @@ Feature: Manage Content Scenario: Filtering Supplemental URLs Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | - | agency site | agency.gov | john@agency.gov | John Bar | + | display_name | name | contact_email | first_name | last_name | + | agency site | agency.gov | john@agency.gov | John | Bar | And the following IndexedDocuments exist: | url | title | description | affiliate | last_crawled_at | last_crawl_status | source | | http://aff.gov/extremelysuperlongurl/space-suit | Space Suit Evolution | description text for space suit | agency.gov | 11/02/2011 | OK | manual | @@ -646,8 +646,8 @@ Feature: Manage Content Scenario: Add/edit/remove Supplemental URL Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | - | agency site | agency.gov | john@agency.gov | John Bar | + | display_name | name | contact_email | first_name | last_name | + | agency site | agency.gov | john@agency.gov | John | Bar | And I am logged in with email "john@agency.gov" When I go to the agency.gov's Supplemental URLs page And I follow "Add Supplemental URL" @@ -668,8 +668,8 @@ Feature: Manage Content Scenario: View Twitter Handles Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | - | agency site | agency.gov | john@agency.gov | John Bar | + | display_name | name | contact_email | first_name | last_name | + | agency site | agency.gov | john@agency.gov | John | Bar | When the following Twitter handles exist for the site "agency.gov": | screen_name | | usasearch | @@ -683,8 +683,8 @@ Feature: Manage Content Scenario: Add/remove Twitter Handle Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | - | agency site | agency.gov | john@agency.gov | John Bar | + | display_name | name | contact_email | first_name | last_name | + | agency site | agency.gov | john@agency.gov | John | Bar | And I am logged in with email "john@agency.gov" When I go to the agency.gov's Manage Content page And I follow "Twitter" within the Admin Center content @@ -704,8 +704,8 @@ Feature: Manage Content Scenario: View YouTube Channels Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | - | agency site | agency.gov | john@agency.gov | John Bar | + | display_name | name | contact_email | first_name | last_name | + | agency site | agency.gov | john@agency.gov | John | Bar | And the following YouTube channels exist for the site "agency.gov": | title | channel_id | | USGovernment | usgovernment_channel_id | @@ -719,8 +719,8 @@ Feature: Manage Content Scenario: Add/remove YouTube Channel Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | - | agency site | agency.gov | john@agency.gov | John Bar | + | display_name | name | contact_email | first_name | last_name | + | agency site | agency.gov | john@agency.gov | John | Bar | And I am logged in with email "john@agency.gov" When I go to the agency.gov's Manage Content page And I follow "YouTube" within the Admin Center content diff --git a/features/admin_center_manage_display.feature b/features/admin_center_manage_display.feature index 441a93f7e3..214bb2d04f 100644 --- a/features/admin_center_manage_display.feature +++ b/features/admin_center_manage_display.feature @@ -3,8 +3,8 @@ Feature: Manage Display @javascript Scenario: Editing Sidebar Settings on a legacy site Given the following legacy Affiliates exist: - | display_name | name | contact_email | contact_name | left_nav_label | - | agency site | agency.gov | john@agency.gov | John Bar | This label is w | + | display_name | name | contact_email | first_name | last_name | left_nav_label | + | agency site | agency.gov | john@agency.gov | John | Bar | This label is w | And affiliate "agency.gov" has the following document collections: | name | prefixes | | Blog | agency.gov/blog/ | @@ -72,8 +72,8 @@ Feature: Manage Display Scenario: Editing Sidebar Settings on a new site Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | - | agency site | agency.gov | john@agency.gov | John Bar | + | display_name | name | contact_email | first_name | last_name | + | agency site | agency.gov | john@agency.gov | John | Bar | And I am logged in with email "john@agency.gov" When I go to the agency.gov's Manage Display page Then I should see "Image Search Label 0" @@ -97,8 +97,8 @@ Feature: Manage Display And I should see "Rss Feed 1" When the following Affiliates exist: - | display_name | name | contact_email | contact_name | is_bing_image_search_enabled | - | agency site | bingimageenabled | john@agency.gov | John Bar | true | + | display_name | name | contact_email | first_name | last_name | is_bing_image_search_enabled | + | agency site | bingimageenabled | john@agency.gov | John | Bar | true | And affiliate "bingimageenabled" has the following RSS feeds: | name | url | show_only_media_content | position | oasis_mrss_name | | Media | photos.gov/all.atom | true | 200 | 100 | @@ -108,8 +108,8 @@ Feature: Manage Display And I should not see "Rss Feed 1" When the following Affiliates exist: - | display_name | name | contact_email | contact_name | is_bing_image_search_enabled | - | agency site | bing-image-disabled | john@agency.gov | John Bar | false | + | display_name | name | contact_email | first_name | last_name | is_bing_image_search_enabled | + | agency site | bing-image-disabled | john@agency.gov | John | Bar | false | And affiliate "bing-image-disabled" has the following RSS feeds: | name | url | show_only_media_content | position | oasis_mrss_name | | Photos | photos.gov/all.atom | true | 200 | 100 | @@ -123,8 +123,8 @@ Feature: Manage Display @javascript Scenario: Editing GovBoxes Settings Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | agency_abbreviation | gets_i14y_results | - | agency site | agency.gov | john@agency.gov | John Bar | DOC | true | + | display_name | name | contact_email | first_name | last_name | agency_abbreviation | gets_i14y_results | + | agency site | agency.gov | john@agency.gov | John |Bar | DOC | true | And affiliate "agency.gov" has the following document collections: | name | prefixes | | Blog | agency.gov/blog/ | @@ -183,10 +183,10 @@ Feature: Manage Display @javascript Scenario: Editing Related Sites Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | - | agency site 1 | 1.agency.gov | john@agency.gov | John Bar | - | agency site 2 | 2.agency.gov | john@agency.gov | John Bar | - | agency site 3 | 3.agency.gov | john@agency.gov | John Bar | + | display_name | name | contact_email | first_name | last_name | + | agency site 1 | 1.agency.gov | john@agency.gov | John | Bar | + | agency site 2 | 2.agency.gov | john@agency.gov | John | Bar | + | agency site 3 | 3.agency.gov | john@agency.gov | John | Bar | And I am logged in with email "john@agency.gov" When I go to the 1.agency.gov's Manage Display page And I fill in the following: @@ -215,8 +215,8 @@ Feature: Manage Display @javascript Scenario: Editing Font & Colors on Affiliate Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | - | agency site | agency.gov | john@agency.gov | John Bar | + | display_name | name | contact_email | first_name | last_name | + | agency site | agency.gov | john@agency.gov | John | Bar | And I am logged in with email "john@agency.gov" When I go to the agency.gov's Font & Colors page Then the "Font Family" field should contain "Default" @@ -256,8 +256,8 @@ Feature: Manage Display @javascript Scenario: Editing Font & Colors on legacy Affiliate Given the following legacy Affiliates exist: - | display_name | name | contact_email | contact_name | - | agency site | agency.gov | john@agency.gov | John Bar | + | display_name | name | contact_email | first_name | last_name | + | agency site | agency.gov | john@agency.gov | John | Bar | And I am logged in with email "john@agency.gov" When I go to the agency.gov's Font & Colors page Then the "Font Family" field should contain "Default" @@ -309,8 +309,8 @@ Feature: Manage Display @javascript Scenario: Editing Font & Colors on a search consumer Affiliate Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | website | search_consumer_search_enabled | - | agency site | agency.gov | one@foo.gov | One Foo | http://beta.agency.gov | true | + | display_name | name | contact_email | first_name | last_name | website | search_consumer_search_enabled | + | agency site | agency.gov | one@foo.gov | One | Foo | http://beta.agency.gov | true | And I am logged in with email "one@foo.gov" When I go to the agency.gov's Templated Font & Colors page Then I should see "Templated Font & Colors (Classic)" @@ -321,8 +321,8 @@ Feature: Manage Display @javascript Scenario: Editing search consumer templates Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | website | search_consumer_search_enabled | - | agency site | agency.gov | one@foo.gov | One Foo | http://beta.agency.gov | true | + | display_name | name | contact_email | first_name | last_name | website | search_consumer_search_enabled | + | agency site | agency.gov | one@foo.gov | One | Foo | http://beta.agency.gov | true | And the following templates are available for the affiliate agency.gov: | name | | Rounded Header Links | @@ -339,8 +339,8 @@ Feature: Manage Display @javascript Scenario: Editing Image Assets on legacy Affiliate Given the following legacy Affiliates exist: - | display_name | name | contact_email | contact_name | uses_managed_header_footer | website | - | agency site | agency.gov | john@agency.gov | John Bar | true | http://main.agency.gov | + | display_name | name | contact_email | first_name | last_name | uses_managed_header_footer | website | + | agency site | agency.gov | john@agency.gov | John | Bar | true | http://main.agency.gov | And I am logged in with email "john@agency.gov" When I go to the agency.gov's Image Assets page Then the "Logo Alignment" field should contain "center" @@ -395,8 +395,8 @@ Feature: Manage Display @javascript Scenario: Editing Image Assets on non legacy Affiliate Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | uses_managed_header_footer | website | - | agency site | agency.gov | john@agency.gov | John Bar | true | http://main.agency.gov | + | display_name | name | contact_email | first_name | last_name | uses_managed_header_footer | website | + | agency site | agency.gov | john@agency.gov | John | Bar | true | http://main.agency.gov | And I am logged in with email "john@agency.gov" When I go to the agency.gov's Image Assets page And I fill in "Favicon URL" with "https://d3qcdigd1fhos0.cloudfront.net/blog/img/favicon.ico" @@ -434,8 +434,8 @@ Feature: Manage Display @javascript Scenario: Editing Managed Header & Footer Given the following legacy Affiliates exist: - | display_name | name | contact_email | contact_name | footer_fragment | - | agency site | agency.gov | john@agency.gov | John Bar | my HTML fragment | + | display_name | name | contact_email | first_name | last_name | footer_fragment | + | agency site | agency.gov | john@agency.gov | John | Bar | my HTML fragment | And affiliate "agency.gov" has the following document collections: | name | prefixes | position | is_navigable | | Active site search | http://apps.usa.gov/ | 3 | true | @@ -537,8 +537,8 @@ Feature: Manage Display @javascript Scenario: Error when Editing Managed Header & Footer Given the following legacy Affiliates exist: - | display_name | name | contact_email | contact_name | - | agency site | agency.gov | john@agency.gov | John Bar | + | display_name | name | contact_email | first_name | last_name | + | agency site | agency.gov | john@agency.gov | John | Bar | And I am logged in with email "john@agency.gov" And no emails have been sent When I go to the agency.gov's Header & Footer page @@ -552,8 +552,8 @@ Feature: Manage Display @javascript Scenario: Editing Custom Header & Footer Given the following legacy Affiliates exist: - | display_name | name | contact_email | contact_name | staged_header | - | agency site | agency.gov | john@agency.gov | John Bar | header | + | display_name | name | contact_email | first_name | last_name | staged_header | + | agency site | agency.gov | john@agency.gov | John | Bar | header | And I am logged in with email "john@agency.gov" And no emails have been sent When I go to the agency.gov's Header & Footer page @@ -593,8 +593,8 @@ Feature: Manage Display @javascript Scenario: Error when Editing Custom Header & Footer Given the following legacy Affiliates exist: - | display_name | name | contact_email | contact_name | - | agency site | agency.gov | john@agency.gov | John Bar | + | display_name | name | contact_email | first_name | last_name | + | agency site | agency.gov | john@agency.gov | John | Bar | And I am logged in with email "john@agency.gov" And no emails have been sent When I go to the agency.gov's Header & Footer page @@ -611,8 +611,8 @@ Feature: Manage Display @javascript Scenario: Editing No Results Page on non legacy Affiliate Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | uses_managed_header_footer | website | - | agency site | agency.gov | john@agency.gov | John Bar | true | http://main.agency.gov | + | display_name | name | contact_email | first_name | last_name | uses_managed_header_footer | website | + | agency site | agency.gov | john@agency.gov | John | Bar | true | http://main.agency.gov | And I am logged in with email "john@agency.gov" And no emails have been sent When I go to the agency.gov's No Results Page page @@ -671,8 +671,8 @@ Feature: Manage Display @javascript Scenario: Errors when Editing No Results Page on non legacy Affiliate Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | uses_managed_header_footer | website | - | agency site | agency.gov | john@agency.gov | John Bar | true | http://main.agency.gov | + | display_name | name | contact_email | first_name | last_name | uses_managed_header_footer | website | + | agency site | agency.gov | john@agency.gov | John | Bar | true | http://main.agency.gov | And I am logged in with email "john@agency.gov" And no emails have been sent When I go to the agency.gov's No Results Page page @@ -705,8 +705,8 @@ Feature: Manage Display @javascript Scenario: Add/edit/remove search page alert Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | - | agency site | agency.gov | john@agency.gov | John Bar | + | display_name | name | contact_email | first_name | last_name | + | agency site | agency.gov | john@agency.gov | John | Bar | And I am logged in with email "john@agency.gov" When I go to the agency.gov's Manage Display page And I follow "Search Page Alert" @@ -744,8 +744,8 @@ Feature: Manage Display @javascript Scenario: Search Consumer advanced search settings Given the following search consumer Affiliates exist: - | display_name | name | contact_email | contact_name | - | agency site | agency.gov | john@agency.gov | John Bar | + | display_name | name | contact_email | first_name | last_name | + | agency site | agency.gov | john@agency.gov | John | Bar | And affiliate "agency.gov" has the following document collections: | name | prefixes | advanced_search_enabled | | Passports | travel.state.gov/passports | true | diff --git a/features/admin_center_referrer_analytics.feature b/features/admin_center_referrer_analytics.feature index b6cb3a17f3..588f55bc3d 100644 --- a/features/admin_center_referrer_analytics.feature +++ b/features/admin_center_referrer_analytics.feature @@ -5,8 +5,8 @@ Feature: Referrer stats Scenario: Viewing the Site's Referrer Stats page Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | - | aff site | aff.gov | aff@bar.gov | John Bar | + | display_name | name | contact_email | first_name | last_name | + | aff site | aff.gov | aff@bar.gov | John | Bar | And I am logged in with email "aff@bar.gov" When I go to the aff.gov's Analytics page And I follow "Referrers" diff --git a/features/admin_center_third_party_tracking.feature b/features/admin_center_third_party_tracking.feature index d79e0d8a9c..4cad564116 100644 --- a/features/admin_center_third_party_tracking.feature +++ b/features/admin_center_third_party_tracking.feature @@ -6,8 +6,8 @@ Feature: Affiliate 3rd party tracking @javascript Scenario: Setting 3rd Party Tracking Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | - | aff site | aff.gov | aff@bar.gov | John Bar | + | display_name | name | contact_email | first_name | last_name | + | aff site | aff.gov | aff@bar.gov | John | Bar | And I am logged in with email "aff@bar.gov" When I go to the aff.gov's Analytics page And I follow "3rd Party Tracking" diff --git a/features/admin_center_watchers.feature b/features/admin_center_watchers.feature index 3b186c032c..afd618980d 100644 --- a/features/admin_center_watchers.feature +++ b/features/admin_center_watchers.feature @@ -5,11 +5,11 @@ Feature: Watchers (aka Analytics Alerts) Scenario: View watchers Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | - | agency site | agency.gov | john@agency.gov | John Bar | + | display_name | name | contact_email | first_name | last_name | + | agency site | agency.gov | john@agency.gov | John | Bar | And the following Users exist: - | contact_name | email | - | John Admin | admin1@fixtures.gov | + | first_name | last_name | email | + | John | Admin | admin1@fixtures.gov | And the Affiliate "agency.gov" has the following users: | email | | admin1@fixtures.gov | @@ -40,8 +40,8 @@ Feature: Watchers (aka Analytics Alerts) @javascript Scenario: Add/edit/remove watchers Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | - | agency site | agency.gov | john@agency.gov | John Bar | + | display_name | name | contact_email | first_name | last_name | + | agency site | agency.gov | john@agency.gov | John | Bar | And the following Hints exist: | name | value | | watcher.name | Enter a short, meaningful name. | @@ -53,22 +53,22 @@ Feature: Watchers (aka Analytics Alerts) When I follow "Create a No Results alert" And I fill in the following: - | Name | | - | Time between alerts | 1w | - | Check interval | 1h | - | Time window for each check | 1d | - | Ignored query terms | brandon, jobs | - | Minimum number of queries | 50 | + | Name | | + | Time between alerts | 1w | + | Check interval | 1h | + | Time window for each check | 1d | + | Ignored query terms | brandon, jobs | + | Minimum number of queries | 50 | And I submit the form by pressing "Add" Then I should see "There were problems with the following fields" When I fill in the following: - | Name | First One | - | Time between alerts | 1w | - | Check interval | 1h | - | Time window for each check | 1d | - | Ignored query terms | brandon, jobs | - | Minimum number of queries | 50 | + | Name | First One | + | Time between alerts | 1w | + | Check interval | 1h | + | Time window for each check | 1d | + | Ignored query terms | brandon, jobs | + | Minimum number of queries | 50 | And I submit the form by pressing "Add" Then I should see the following table rows: | Name | Type | Alert Threshold | Time Window | Check Every... | Time Between Alerts | diff --git a/features/blended_search.feature b/features/blended_search.feature index 8f095d7c9e..f5af5137df 100644 --- a/features/blended_search.feature +++ b/features/blended_search.feature @@ -5,8 +5,8 @@ Feature: Blended Search Scenario: Simple search across news and indexed documents Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | gets_blended_results | is_rss_govbox_enabled | - | bar site | bar.gov | aff@bar.gov | John Bar | true | false | + | display_name | name | contact_email | first_name | last_name | gets_blended_results | is_rss_govbox_enabled | + | bar site | bar.gov | aff@bar.gov | John | Bar | true | false | And affiliate "bar.gov" has the following RSS feeds: | name | url | is_navigable | | Press | http://www.whitehouse.gov/feed/press | true | @@ -123,9 +123,9 @@ Feature: Blended Search Scenario: Custom date range blended search Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | locale | gets_blended_results | is_rss_govbox_enabled | - | English site | en.agency.gov | admin@agency.gov | John Bar | en | true | false | - | Spanish site | es.agency.gov | admin@agency.gov | John Bar | es | true | false | + | display_name | name | contact_email | first_name | last_name | locale | gets_blended_results | is_rss_govbox_enabled | + | English site | en.agency.gov | admin@agency.gov | John | Bar | en | true | false | + | Spanish site | es.agency.gov | admin@agency.gov | John | Bar | es | true | false | And affiliate "en.agency.gov" has the following RSS feeds: | name | url | is_navigable | | Press | http://www.whitehouse.gov/feed/press | true | @@ -255,8 +255,8 @@ Feature: Blended Search Scenario: User misspells a query Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | gets_blended_results | is_rss_govbox_enabled | - | bar site | bar.gov | aff@bar.gov | John Bar | true | false | + | display_name | name | contact_email | first_name | last_name | gets_blended_results | is_rss_govbox_enabled | + | bar site | bar.gov | aff@bar.gov | John | Bar | true | false | And the following IndexedDocuments exist: | title | description | url | affiliate | last_crawled_at | last_crawl_status | | First petition article | This is an article item on barack obama | http://p.whitehouse.gov/p-1.html | bar.gov | 11/02/2011 | OK | @@ -268,8 +268,8 @@ Feature: Blended Search Scenario: Custom page 1 results pointer Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | locale | page_one_more_results_pointer | gets_blended_results | - | Blended site | blended.agency.gov | admin@agency.gov | John Bar | en | Wherever. Try your search again to see results | true | + | display_name | name | contact_email | first_name | last_name | locale | page_one_more_results_pointer | gets_blended_results | + | Blended site | blended.agency.gov | admin@agency.gov | John | Bar | en | Wherever. Try your search again to see results | true | And affiliate "blended.agency.gov" has the following RSS feeds: | name | url | is_navigable | | Press | http://www.whitehouse.gov/feed/press | true | @@ -284,8 +284,8 @@ Feature: Blended Search Scenario: A site without commercial results Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | gets_blended_results | gets_commercial_results_on_blended_search | - | Blended site | blended.agency.gov | admin@agency.gov | John Bar | true | false | + | display_name | name | contact_email | first_name | last_name | gets_blended_results | gets_commercial_results_on_blended_search | + | Blended site | blended.agency.gov | admin@agency.gov | John | Bar | true | false | And affiliate "blended.agency.gov" has the following RSS feeds: | name | url | is_navigable | | Press | http://www.whitehouse.gov/feed/press | true | @@ -297,8 +297,8 @@ Feature: Blended Search Scenario: A site that gets commercial results Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | gets_blended_results | gets_commercial_results_on_blended_search | - | Blended site | blended.agency.gov | admin@agency.gov | John Bar | true | true | + | display_name | name | contact_email | first_name | last_name | gets_blended_results | gets_commercial_results_on_blended_search | + | Blended site | blended.agency.gov | admin@agency.gov | John | Bar | true | true | And affiliate "blended.agency.gov" has the following RSS feeds: | name | url | is_navigable | | Press | http://www.whitehouse.gov/feed/press | true | @@ -313,8 +313,8 @@ Feature: Blended Search Scenario: Search with only stopwords Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | gets_blended_results | - | Blended site | blended.agency.gov | admin@agency.gov | John Bar | true | + | display_name | name | contact_email | first_name | last_name | gets_blended_results | + | Blended site | blended.agency.gov | admin@agency.gov | John | Bar | true | And affiliate "blended.agency.gov" has the following RSS feeds: | name | url | is_navigable | | Press | http://www.whitehouse.gov/feed/press | true | @@ -329,8 +329,8 @@ Feature: Blended Search Scenario: Display an Alert on search page Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | gets_blended_results | - | Blended site | blended.agency.gov | admin@agency.gov | John Bar | true | + | display_name | name | contact_email | first_name | last_name | gets_blended_results | + | Blended site | blended.agency.gov | admin@agency.gov | John | Bar | true | And the following Alert exists: | affiliate | text | status | title | | blended.agency.gov | New alert for the test aff | Active | Test Title | diff --git a/features/image_search.feature b/features/image_search.feature index 7f9a457693..dfa8bdc28f 100644 --- a/features/image_search.feature +++ b/features/image_search.feature @@ -5,8 +5,8 @@ Feature: Image search Scenario: English Image search Given the following legacy Affiliates exist: - | display_name | name | contact_email | contact_name | header | domains | - | USA.gov | usagov | aff@bar.gov | John Bar | USA.gov Header | whitehouse.gov | + | display_name | name | contact_email | first_name | last_name | header | domains | + | USA.gov | usagov | aff@bar.gov | John | Bar | USA.gov Header | whitehouse.gov | When I am on usagov's image search page When I fill in "query" with "White House" And I press "Search" @@ -15,8 +15,8 @@ Feature: Image search Scenario: Image search with spelling suggestion Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | - | USA.gov | usagov | aff@bar.gov | John Bar | + | display_name | name | contact_email | first_name | last_name | + | USA.gov | usagov | aff@bar.gov | John | Bar | And the following Suggestion Blocks exist: | query | | ebuy | @@ -27,8 +27,8 @@ Feature: Image search Scenario: Spanish image search Given the following legacy Affiliates exist: - | display_name | name | contact_email | contact_name | header | locale | - | GobiernoUSA.gov | gobiernousa | aff@bar.gov | John Bar | Gobierno.USA.gov Header | es | + | display_name | name | contact_email | first_name | last_name | header | locale | + | GobiernoUSA.gov | gobiernousa | aff@bar.gov | John | Bar | Gobierno.USA.gov Header | es | When I am on gobiernousa's image search page When I fill in "query" with "Barcelona" And I press "Buscar" @@ -37,8 +37,8 @@ Feature: Image search Scenario: Image search using BingV6 Given the following legacy Affiliates exist: - | display_name | name | contact_email | contact_name | locale | search_engine | domains | is_image_search_navigable | - | English site | en.agency.gov | admin@agency.gov | John Bar | en | BingV6 | .gov | true | + | display_name | name | contact_email | first_name | last_name | locale | search_engine | domains | is_image_search_navigable | + | English site | en.agency.gov | admin@agency.gov | John | Bar | en | BingV6 | .gov | true | When I am on en.agency.gov's image search page And I fill in "query" with "agency" And I press "Search" diff --git a/features/legacy_search.feature b/features/legacy_search.feature index d2192be5fe..47c458c021 100644 --- a/features/legacy_search.feature +++ b/features/legacy_search.feature @@ -5,16 +5,16 @@ Feature: Legacy Search Scenario: Search with a blank query on an affiliate page Given the following legacy Affiliates exist: - | display_name | name | contact_email | contact_name | - | bar site | bar.gov | aff@bar.gov | John Bar | + | display_name | name | contact_email | first_name | last_name | + | bar site | bar.gov | aff@bar.gov | John | Bar | When I am on bar.gov's search page And I press "Search" in the legacy search box Then I should see "Please enter a search term" Scenario: Search with no results Given the following legacy Affiliates exist: - | display_name | name | contact_email | contact_name | - | bar site | bar.gov | aff@bar.gov | John Bar | + | display_name | name | contact_email | first_name | last_name | + | bar site | bar.gov | aff@bar.gov | John | Bar | When I am on bar.gov's search page And I fill in "Enter your search term" with "foobarbazbiz" And I press "Search" in the legacy search box @@ -22,9 +22,9 @@ Feature: Legacy Search Scenario: Searching with active RSS feeds Given the following legacy Affiliates exist: - | display_name | name | contact_email | contact_name | locale | youtube_handles | is_image_search_navigable | - | bar site | bar.gov | aff@bar.gov | John Bar | en | en_agency | true | - | Spanish bar site | es.bar.gov | aff@bar.gov | John Bar | es | es_agency | true | + | display_name | name | contact_email | first_name | last_name | locale | youtube_handles | is_image_search_navigable | + | bar site | bar.gov | aff@bar.gov | John | Bar | en | en_agency | true | + | Spanish bar site | es.bar.gov | aff@bar.gov | John | Bar | es | es_agency | true | And affiliate "bar.gov" has the following RSS feeds: | name | url | is_navigable | is_managed | | Press | http://www.whitehouse.gov/feed/press | true | | @@ -221,9 +221,9 @@ Feature: Legacy Search Scenario: Searching news items using time filters Given the following legacy Affiliates exist: - | display_name | name | contact_email | contact_name | locale | youtube_handles | - | bar site | bar.gov | aff@bar.gov | John Bar | en | en_agency | - | Spanish bar site | es.bar.gov | aff@bar.gov | John Bar | es | es_agency | + | display_name | name | contact_email | first_name | last_name | locale | youtube_handles | + | bar site | bar.gov | aff@bar.gov | John | Bar | en | en_agency | + | Spanish bar site | es.bar.gov | aff@bar.gov | John | Bar | es | es_agency | And affiliate "bar.gov" has the following RSS feeds: | name | url | is_navigable | is_managed | | Press | http://www.whitehouse.gov/feed/press | true | | @@ -406,9 +406,9 @@ Feature: Legacy Search Scenario: Searching news items with default dublin core mappings Given the following legacy Affiliates exist: - | display_name | name | contact_email | contact_name | locale | - | bar site | en.bar.gov | aff@bar.gov | John Bar | en | - | Spanish bar site | es.bar.gov | aff@bar.gov | John Bar | es | + | display_name | name | contact_email | first_name | last_name | locale | + | bar site | en.bar.gov | aff@bar.gov | John | Bar | en | + | Spanish bar site | es.bar.gov | aff@bar.gov | John | Bar | es | And affiliate "en.bar.gov" has the following RSS feeds: | name | url | is_navigable | | Press | http://www.whitehouse.gov/feed/press | true | @@ -598,8 +598,8 @@ Feature: Legacy Search # So if it breaks, check the urls in the VCR cassette recording from the search: # features/vcr_cassettes/Legacy_Search/Searching_a_domain_with_Bing_results_that_match_a_specific_news_item.yml Given the following legacy Affiliates exist: - | display_name | name | contact_email | contact_name | domains | - | bar site | bar.gov | aff@bar.gov | John Bar | whitehouse.gov | + | display_name | name | contact_email | first_name | last_name | domains | + | bar site | bar.gov | aff@bar.gov | John | Bar | whitehouse.gov | And affiliate "bar.gov" has the following RSS feeds: | name | url | is_navigable | | Press | http://www.whitehouse.gov/feed/press | true | @@ -613,8 +613,8 @@ Feature: Legacy Search Scenario: No results when searching with active RSS feeds Given the following legacy Affiliates exist: - | display_name | name | contact_email | contact_name | - | bar site | bar.gov | aff@bar.gov | John Bar | + | display_name | name | contact_email | first_name | last_name | + | bar site | bar.gov | aff@bar.gov | John |Bar | And affiliate "bar.gov" has the following RSS feeds: | name | url | is_navigable | | Press | http://www.whitehouse.gov/feed/press | true | @@ -644,8 +644,8 @@ Feature: Legacy Search Scenario: No results when searching on Spanish site with active RSS feeds Given the following legacy Affiliates exist: - | display_name | name | contact_email | contact_name | locale | - | bar site | bar.gov | aff@bar.gov | John Bar | es | + | display_name | name | contact_email | first_name | last_name | locale | + | bar site | bar.gov | aff@bar.gov | John | Bar | es | And affiliate "bar.gov" has the following RSS feeds: | name | url | is_navigable | | Press | http://www.whitehouse.gov/feed/press | true | @@ -674,8 +674,8 @@ Feature: Legacy Search Scenario: Searching on a site with media RSS Given the following legacy Affiliates exist: - | display_name | name | contact_email | contact_name | - | bar site | bar.gov | aff@bar.gov | John Bar | + | display_name | name | contact_email | first_name | last_name | + | bar site | bar.gov | aff@bar.gov | John | Bar | And affiliate "bar.gov" has the following RSS feeds: | name | url | is_navigable | show_only_media_content | | Photos | http://www.whitehouse.gov/feed/photos | true | true | @@ -691,8 +691,8 @@ Feature: Legacy Search Scenario: Visiting English affiliate search with multiple domains Given the following legacy Affiliates exist: - | display_name | name | contact_email | contact_name | domains | - | bar site | bar.gov | aff@bar.gov | John Bar | whitehouse.gov,usa.gov | + | display_name | name | contact_email | first_name | last_name | domains | + | bar site | bar.gov | aff@bar.gov | John | Bar | whitehouse.gov,usa.gov | When I am on bar.gov's search page And I fill in "Enter your search term" with "president" And I press "Search" in the legacy search box @@ -701,8 +701,8 @@ Feature: Legacy Search Scenario: Visiting Spanish affiliate search with multiple domains Given the following legacy Affiliates exist: - | display_name | name | contact_email | contact_name | domains | locale | is_image_search_navigable | - | bar site | bar.gov | aff@bar.gov | John Bar | whitehouse.gov,usa.gov | es | true | + | display_name | name | contact_email | first_name | last_name | domains | locale | is_image_search_navigable | + | bar site | bar.gov | aff@bar.gov | John | Bar | whitehouse.gov,usa.gov | es | true | When I am on bar.gov's search page And I fill in "Ingrese su bĆŗsqueda" with "president" And I press "Buscar" in the legacy search box @@ -716,8 +716,8 @@ Feature: Legacy Search @javascript Scenario: Searchers see English Medline Govbox Given the following legacy Affiliates exist: - | display_name | name | contact_email | contact_name | domains | is_medline_govbox_enabled | - | english site | english-nih | aff@bar.gov | John Bar | nih.gov | true | + | display_name | name | contact_email | first_name | last_name | domains | is_medline_govbox_enabled | + | english site | english-nih | aff@bar.gov | John | Bar | nih.gov | true | And the following Medline Topics exist: | medline_title | medline_tid | locale | summary_html | | Hippopotomonstrosesquippedaliophobia | 67890 | es | Hippopotomonstrosesquippedaliophobia y otros miedos irracionales | @@ -751,8 +751,8 @@ Feature: Legacy Search @javascript Scenario: Searchers see Spanish Medline Govbox Given the following legacy Affiliates exist: - | display_name | name | contact_email | contact_name | domains | is_medline_govbox_enabled | locale | - | spanish site | spanish-nih | aff@bar.gov | John Bar | nih.gov | true | es | + | display_name | name | contact_email | first_name | last_name | domains | is_medline_govbox_enabled | locale | + | spanish site | spanish-nih | aff@bar.gov | John | Bar | nih.gov | true | es | And the following Medline Topics exist: | medline_title | medline_tid | locale | summary_html | | Hippopotomonstrosesquippedaliophobia | 12345 | en | Hippopotomonstrosesquippedaliophobia and Other Irrational Fears | @@ -781,8 +781,8 @@ Feature: Legacy Search Scenario: When a searcher enters a query with invalid Lucene character Given the following legacy Affiliates exist: - | display_name | name | contact_email | contact_name | domains | - | agency site | agency.gov | aff@bar.gov | John Bar | .gov | + | display_name | name | contact_email | first_name | last_name | domains | + | agency site | agency.gov | aff@bar.gov | John |Bar | .gov | And I am on agency.gov's search page And I fill in "query" with "++health it" And I press "Search" in the legacy search box @@ -795,8 +795,8 @@ Feature: Legacy Search Scenario: When a searcher clicks on a collection on sidebar and the query is blank Given the following legacy Affiliates exist: - | display_name | name | contact_email | contact_name | - | aff site | aff.gov | aff@bar.gov | John Bar | + | display_name | name | contact_email | first_name | last_name | + | aff site | aff.gov | aff@bar.gov | John | Bar | And affiliate "aff.gov" has the following document collections: | name | prefixes | is_navigable | | Topics | http://aff.gov/topics/ | true | @@ -806,8 +806,8 @@ Feature: Legacy Search Scenario: When a searcher on an English site clicks on an RSS Feed on sidebar and the query is blank Given the following legacy Affiliates exist: - | display_name | name | contact_email | contact_name | locale | youtube_handles | - | bar site | bar.gov | aff@bar.gov | John Bar | en | en_agency | + | display_name | name | contact_email | first_name | last_name | locale | youtube_handles | + | bar site | bar.gov | aff@bar.gov | John | Bar | en | en_agency | And affiliate "bar.gov" has the following RSS feeds: | name | url | is_navigable | is_managed | | Press | http://www.whitehouse.gov/feed/press | true | | @@ -837,8 +837,8 @@ Feature: Legacy Search Scenario: When a searcher on a Spanish site clicks on an RSS Feed on sidebar and the query is blank Given the following legacy Affiliates exist: - | display_name | name | contact_email | contact_name | locale | youtube_handles | - | Spanish bar site | es.bar.gov | aff@bar.gov | John Bar | es | es_agency | + | display_name | name | contact_email | first_name | last_name | locale | youtube_handles | + | Spanish bar site | es.bar.gov | aff@bar.gov | John | Bar | es | es_agency | And affiliate "es.bar.gov" has the following RSS feeds: | name | url | is_navigable | is_managed | | Press | http://www.whitehouse.gov/feed/press | true | | @@ -868,9 +868,9 @@ Feature: Legacy Search Scenario: When there are relevant Tweets from Twitter profiles associated with the affiliate Given the following legacy Affiliates exist: - | display_name | name | contact_email | contact_name | locale | - | bar site | bar.gov | aff@bar.gov | John Bar | en | - | spanish site | es.bar.gov | aff@bar.gov | John Bar | es | + | display_name | name | contact_email | first_name | last_name | locale | + | bar site | bar.gov | aff@bar.gov | John | Bar | en | + | spanish site | es.bar.gov | aff@bar.gov | John | Bar | es | And the following Twitter Profiles exist: | screen_name | name | twitter_id | affiliate | | USAgov | USA.gov | 123 | bar.gov | @@ -903,8 +903,8 @@ Feature: Legacy Search Scenario: Searching document collections Given the following legacy Affiliates exist: - | display_name | name | contact_email | contact_name | domains | - | agency site | agency.gov | aff@bar.gov | John Bar | whitehouse.gov | + | display_name | name | contact_email | first_name | last_name | domains | + | agency site | agency.gov | aff@bar.gov | John | Bar | whitehouse.gov | And affiliate "agency.gov" has the following document collections: | name | prefixes | is_navigable | | Petitions | petitions.whitehouse.gov | true | @@ -921,8 +921,8 @@ Feature: Legacy Search Scenario: Searching on non navigable document collection Given the following legacy Affiliates exist: - | display_name | name | contact_email | contact_name | domains | - | agency site | agency.gov | aff@bar.gov | John Bar | usa.gov | + | display_name | name | contact_email | first_name | last_name | domains | + | agency site | agency.gov | aff@bar.gov | John | Bar | usa.gov | And affiliate "agency.gov" has the following document collections: | name | prefixes | is_navigable | | Blog | http://www.sba.gov/blogs | false | @@ -941,15 +941,15 @@ Feature: Legacy Search Scenario: Searching with malformed query Given the following legacy Affiliates exist: - | display_name | name | contact_email | contact_name | is_image_search_navigable | - | agency site | agency.gov | aff@bar.gov | John Bar | true | + | display_name | name | contact_email | first_name | last_name | is_image_search_navigable | + | agency site | agency.gov | aff@bar.gov | John | Bar | true | When I am on agency.gov's search page with unsanitized "hello" query Then I should see a link to "Images" with sanitized "hello" query Scenario: Searching for site specific results using query Given the following legacy Affiliates exist: - | display_name | name | contact_email | contact_name | domains | - | agency site | agency.gov | aff@bar.gov | John Bar | usa.gov | + | display_name | name | contact_email | first_name | last_name | domains | + | agency site | agency.gov | aff@bar.gov | John | Bar | usa.gov | When I am on agency.gov's search page And I fill in "query" with "jobs site:www.usa.gov" And I press "Search" in the legacy search box @@ -960,8 +960,8 @@ Feature: Legacy Search Scenario: Searching for site specific results using sitelimit Given the following legacy Affiliates exist: - | display_name | name | contact_email | contact_name | domains | is_image_search_navigable | - | agency site | agency.gov | aff@bar.gov | John Bar | .gov | true | + | display_name | name | contact_email | first_name | last_name | domains | is_image_search_navigable | + | agency site | agency.gov | aff@bar.gov | John | Bar | .gov | true | And affiliate "agency.gov" has the following document collections: | name | prefixes | is_navigable | | Blog | http://search.gov/blog/ | true | @@ -998,8 +998,8 @@ Feature: Legacy Search Scenario: Visiting affiliate with strictui parameters Given the following legacy Affiliates exist: - | display_name | name | contact_email | contact_name | external_css_url | header | footer | - | aff site | aff.gov | aff@bar.gov | John Bar | http://cdn.aff.gov/external.css |

header

|

footer

| + | display_name | name | contact_email | first_name | last_name | external_css_url | header | footer | + | aff site | aff.gov | aff@bar.gov | John | Bar | http://cdn.aff.gov/external.css |

header

|

footer

| When I go to aff.gov's strictui search page Then I should not see the page with external affiliate stylesheet "http://cdn.aff.gov/external.css" And I should not see tainted SERP header @@ -1007,9 +1007,9 @@ Feature: Legacy Search Scenario: Affiliate search on affiliate with connections Given the following legacy Affiliates exist: - | display_name | name | contact_email | contact_name | domains | - | agency site | agency.gov | aff@bar.gov | John Bar | .gov | - | other site | other.gov | aff@bad.gov | John Bad | .gov | + | display_name | name | contact_email | first_name | last_name | domains | + | agency site | agency.gov | aff@bar.gov | John | Bar | .gov | + | other site | other.gov | aff@bad.gov | John | Bad | .gov | And the following Connections exist for the affiliate "agency.gov": | connected_affiliate | display_name | | other.gov | Other Site | @@ -1022,8 +1022,8 @@ Feature: Legacy Search Scenario: Searching on sites with Featured Collections Given the following legacy Affiliates exist: - | display_name | name | contact_email | contact_name | locale | - | agency site | agency.gov | john@agency.gov | John Bar | en | + | display_name | name | contact_email | first_name | last_name | locale | + | agency site | agency.gov | john@agency.gov | John | Bar | en | And the following featured collections exist for the affiliate "agency.gov": | title | title_url | status | publish_start_on | publish_end_on | | Tornado Warning | http://agency.gov/tornado-warning | active | 2013-07-01 | | @@ -1043,9 +1043,9 @@ Feature: Legacy Search Scenario: Searching on sites with Boosted Contents Given the following legacy Affiliates exist: - | display_name | name | contact_email | contact_name | locale | - | agency site | agency.gov | john@agency.gov | John Bar | en | - | es agency site | es.agency.gov | john@agency.gov | John Bar | es | + | display_name | name | contact_email | first_name| last_name | locale | + | agency site | agency.gov | john@agency.gov | John | Bar | en | + | es agency site | es.agency.gov | john@agency.gov | John | Bar | es | And the following Boosted Content entries exist for the affiliate "agency.gov" | url | title | description | status | publish_start_on | publish_end_on | | http://search.gov/releases/2013-05-31.html | Notes for Week Ending May 31, 2013 | multimedia gallery | active | 2013-08-01 | 2022-01-01 | @@ -1066,8 +1066,8 @@ Feature: Legacy Search Scenario: Searching news items with custom dublin core mappings Given the following legacy Affiliates exist: - | display_name | name | contact_email | contact_name | locale | dc_contributor | dc_publisher | dc_subject | - | bar site | en.bar.gov | aff@bar.gov | John Bar | en | Administration Official | Briefing Room Section | Issue | + | display_name | name | contact_email | first_name | last_name | locale | dc_contributor | dc_publisher | dc_subject | + | bar site | en.bar.gov | aff@bar.gov | John | Bar | en | Administration Official | Briefing Room Section | Issue | And affiliate "en.bar.gov" has the following RSS feeds: | name | url | is_navigable | shown_in_govbox | | Press | http://www.whitehouse.gov/feed/press | true | true | @@ -1091,8 +1091,8 @@ Feature: Legacy Search Scenario: Entering a blank advanced search Given the following legacy Affiliates exist: - | display_name | name | contact_email | contact_name | header | - | USA.gov | usagov | aff@bar.gov | John Bar | USA.gov Header | + | display_name | name | contact_email | first_name | last_name | header | + | USA.gov | usagov | aff@bar.gov | John | Bar | USA.gov Header | When I am on usagov's advanced search page And I press "Search" Then I should be on the search page @@ -1101,8 +1101,8 @@ Feature: Legacy Search Scenario: When using tablet device on advanced search Given I am using an tabletPC device And the following Affiliates exist: - | display_name | name | contact_email | contact_name | - | bar site | bar.gov | aff@bar.gov | John Bar | + | display_name | name | contact_email | first_name | last_name | + | bar site | bar.gov | aff@bar.gov | John | Bar | When I am on bar.gov's advanced search page And I press "Search" Then I should be on the search page diff --git a/features/mobile_image_searches.feature b/features/mobile_image_searches.feature index c048780ff2..c0a9e5f922 100644 --- a/features/mobile_image_searches.feature +++ b/features/mobile_image_searches.feature @@ -8,8 +8,8 @@ Feature: Image search using mobile template Scenario: English Image search on a legacy site Given the following legacy Affiliates exist: - | display_name | name | contact_email | contact_name | is_image_search_navigable | - | USA.gov | usagov | aff@bar.gov | John Bar | true | + | display_name | name | contact_email | first_name | last_name | is_image_search_navigable | + | USA.gov | usagov | aff@bar.gov | John | Bar | true | When I am on usagov's search page And I fill in "Enter your search term" with "sunset" And I press "Search" diff --git a/features/mobile_searches.feature b/features/mobile_searches.feature index 7ba7fe614c..d1c067b8c2 100644 --- a/features/mobile_searches.feature +++ b/features/mobile_searches.feature @@ -5,10 +5,10 @@ Feature: Searches using mobile device Scenario: Web search Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | locale | domains | - | English site | en.agency.gov | admin@agency.gov | John Bar | en | | - | Spanish site | es.agency.gov | admin@agency.gov | John Bar | es | | - | Hippo site | hippo | admin@agency.gov | John Bar | en | hippo.whitehouse.gov | + | display_name | name | contact_email | first_name | last_name | locale | domains | + | English site | en.agency.gov | admin@agency.gov | John | Bar | en | | + | Spanish site | es.agency.gov | admin@agency.gov | John | Bar | es | | + | Hippo site | hippo | admin@agency.gov | John | Bar | en | hippo.whitehouse.gov | And the following Boosted Content entries exist for the affiliate "en.agency.gov" | url | title | description | | http://http://www.whitehouse.gov/administration/president-obama | President Barack Obama | the 44th President of the United States | @@ -93,9 +93,9 @@ Feature: Searches using mobile device Scenario: News search Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | locale | - | English site | en.agency.gov | admin@agency.gov | John Bar | en | - | Spanish site | es.agency.gov | admin@agency.gov | John Bar | es | + | display_name | name | contact_email | first_name | last_name | locale | + | English site | en.agency.gov | admin@agency.gov | John | Bar | en | + | Spanish site | es.agency.gov | admin@agency.gov | John | Bar | es | And affiliate "en.agency.gov" has the following RSS feeds: | name | url | @@ -161,14 +161,14 @@ Feature: Searches using mobile device Scenario: Custom date range news search Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | locale | - | English site | en.agency.gov | admin@agency.gov | John Bar | en | - | Spanish site | es.agency.gov | admin@agency.gov | John Bar | es | + | display_name | name | contact_email | first_name | last_name | locale | + | English site | en.agency.gov | admin@agency.gov | John | Bar | en | + | Spanish site | es.agency.gov | admin@agency.gov | John | Bar | es | And affiliate "en.agency.gov" has the following RSS feeds: | name | url | is_navigable | | Press | http://www.whitehouse.gov/feed/press | true | And affiliate "es.agency.gov" has the following RSS feeds: - | name | url | is_navigable | + | name | url | is_navigable | | Noticias | https://www.usa.gov/gobiernousa/rss/actualizaciones-articulos.xml | true | And feed "Press" has the following news items: | link | title | guid | published_ago | published_at | description | contributor | publisher | subject | @@ -277,8 +277,8 @@ Feature: Searches using mobile device Scenario: Media RSS search Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | - | English site | en.agency.gov | admin@agency.gov | John Bar | + | display_name | name | contact_email | first_name | last_name | + | English site | en.agency.gov | admin@agency.gov | John | Bar | And affiliate "en.agency.gov" has the following RSS feeds: | name | url | is_navigable | show_only_media_content | | Images | http://en.agency.gov/feed/images | true | true | @@ -291,9 +291,9 @@ Feature: Searches using mobile device Scenario: Video news search Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | locale | youtube_handles | - | English site | en.agency.gov | admin@agency.gov | John Bar | en | usgovernment,whitehouse | - | Spanish site | es.agency.gov | admin@agency.gov | John Bar | es | gobiernousa | + | display_name | name | contact_email | first_name | last_name | locale | youtube_handles | + | English site | en.agency.gov | admin@agency.gov | John | Bar | en | usgovernment,whitehouse | + | Spanish site | es.agency.gov | admin@agency.gov | John | Bar | es | gobiernousa | And affiliate "en.agency.gov" has the following RSS feeds: | name | url | is_navigable | is_managed | | Videos | | true | true | @@ -349,9 +349,9 @@ Feature: Searches using mobile device Scenario: Site search Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | locale | - | English site | en.agency.gov | admin@agency.gov | John Bar | en | - | Spanish site | es.agency.gov | admin@agency.gov | John Bar | es | + | display_name | name | contact_email | first_name | last_name | locale | + | English site | en.agency.gov | admin@agency.gov | John | Bar | en | + | Spanish site | es.agency.gov | admin@agency.gov | John | Bar | es | And affiliate "en.agency.gov" has the following document collections: | name | prefixes | @@ -375,8 +375,8 @@ Feature: Searches using mobile device Scenario: Site navigations without dropdown menu Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | locale | - | English site | en.agency.gov | admin@agency.gov | John Bar | en | + | display_name | name | contact_email | first_name | last_name | locale | + | English site | en.agency.gov | admin@agency.gov | John | Bar | en | And affiliate "en.agency.gov" has the following document collections: | name | prefixes | | Blog | http://blog.usa.gov/ | @@ -403,8 +403,8 @@ Feature: Searches using mobile device Scenario: Site navigations with dropdown menu Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | locale | navigation_dropdown_label | - | English site | en.agency.gov | admin@agency.gov | John Bar | en | My-awesome-label | + | display_name | name | contact_email | first_name | last_name | locale | navigation_dropdown_label | + | English site | en.agency.gov | admin@agency.gov | John | Bar | en | My-awesome-label | And affiliate "en.agency.gov" has the following document collections: | name | prefixes | position | is_navigable | | FAQs | http://answers.usa.gov/ | 0 | true | @@ -448,9 +448,9 @@ Feature: Searches using mobile device Scenario: Job search Given the following Affiliates exist: - | display_name | name | contact_email | contact_name |locale | jobs_enabled | - | English site | en.agency.gov | admin@agency.gov | John Bar | en | 1 | - | Spanish site | es.agency.gov | admin@agency.gov | John Bar | es | 1 | + | display_name | name | contact_email | first_name | last_name |locale | jobs_enabled | + | English site | en.agency.gov | admin@agency.gov | John | Bar | en | 1 | + | Spanish site | es.agency.gov | admin@agency.gov | John | Bar | es | 1 | When I am on en.agency.gov's mobile search page And I fill in "Enter your search term" with "jobs" @@ -479,8 +479,8 @@ Feature: Searches using mobile device Scenario: When using tablet device Given I am using a mobile device And the following Affiliates exist: - | display_name | name | contact_email | contact_name | - | bar site | bar.gov | aff@bar.gov | John Bar | + | display_name | name | contact_email | first_name | last_name | + | bar site | bar.gov | aff@bar.gov | John | Bar | When I am on bar.gov's search page And I fill in "Enter your search term" with "bar" And I press "Search" @@ -488,23 +488,23 @@ Feature: Searches using mobile device Scenario: Searching with matching med topic query Given the following Medline Topics exist: - | medline_tid | medline_title | medline_url | locale | summary_html | + | medline_tid | medline_title | medline_url | locale | summary_html | | 1558 | Alcohol | https://www.nlm.nih.gov/medlineplus/alcohol.html | en |

If you are like many Americans, you drink alcohol at least occasionally. For many people, moderate drinking is probably safe. It may even have health benefits, including reducing your risk of certain heart problems.

| | 1313 | Underage Drinking | https://www.nlm.nih.gov/medlineplus/underagedrinking.html | en |

It is possible to drink legally and safely - when you're over 21. But if you're under 21, or if you drink too much at any age, alcohol can be especially risky.

| | 1732 | Alcohol | https://www.nlm.nih.gov/medlineplus/spanish/alcohol.html | es |

Si usted es como muchos estadounidenses, quizĆ”s consuma bebidas alcohĆ³licas por lo menos ocasionalmente. Para muchas personas, beber moderadamente probablemente sea sano. QuizĆ” hasta puede tener beneficios para la salud, entre los que se incluye disminuir el riesgo de padecer algunos problemas cardiacos. | And the following Related Medline Topics for "Alcohol" in English exist: - | medline_title | medline_tid | url | + | medline_title | medline_tid | url | | Underage drinking | 1313 | https://www.nlm.nih.gov/medlineplus/underagedrinking.html | And the following Related Medline Topics for "Alcohol" in Spanish exist: - | medline_title | medline_tid | url | + | medline_title | medline_tid | url | | Alcoholismo | 1733 | https://www.nlm.nih.gov/medlineplus/spanish/alcoholism.html | And the following Medline Sites exist: | medline_title | locale | title | url | | Alcohol | en | Alcoholism | http://clinicaltrials.gov/search/open/condition=%22Alcoholism%22 | And the following Affiliates exist: - | display_name | name | contact_email | contact_name | locale | is_medline_govbox_enabled | - | English site | en.agency.gov | admin@agency.gov | John Bar | en | true | - | Spanish site | es.agency.gov | admin@agency.gov | John Bar | es | true | + | display_name | name | contact_email | first_name | last_name | locale | is_medline_govbox_enabled | + | English site | en.agency.gov | admin@agency.gov | John | Bar | en | true | + | Spanish site | es.agency.gov | admin@agency.gov | John | Bar | es | true | When I am on en.agency.gov's mobile search page And I fill in "Enter your search term" with "alcohol" And I press "Search" @@ -520,9 +520,9 @@ Feature: Searches using mobile device Scenario: Searching with sitelimit Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | locale | domains | - | English site | en.agency.gov | admin@agency.gov | John Bar | en | .gov | - | Spanish site | es.agency.gov | admin@agency.gov | John Bar | es | .gov | + | display_name | name | contact_email | first_name | last_name | locale | domains | + | English site | en.agency.gov | admin@agency.gov | John | Bar | en | .gov | + | Spanish site | es.agency.gov | admin@agency.gov | John | Bar | es | .gov | When I am on en.agency.gov's search page with site limited to "usa.gov" And I fill in "Enter your search term" with "gov" And I press "Search" @@ -541,9 +541,9 @@ Feature: Searches using mobile device Scenario: Searching with matching results on news govbox Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | locale | - | English site | en.agency.gov | admin@agency.gov | John Bar | en | - | Spanish site | es.agency.gov | admin@agency.gov | John Bar | es | + | display_name | name | contact_email | first_name | last_name | locale | + | English site | en.agency.gov | admin@agency.gov | John | Bar | en | + | Spanish site | es.agency.gov | admin@agency.gov | John | Bar | es | And affiliate "en.agency.gov" has the following RSS feeds: | name | url | is_navigable | | Press | http://en.agency.gov/feed/press | true | @@ -581,10 +581,10 @@ Feature: Searches using mobile device Scenario: Searching on sites with related sites Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | locale | related_sites_dropdown_label | - | English site | en.agency.gov | admin@agency.gov | John Bar | en | Search On | - | All sites | all.agency.gov | admin@agency.gov | John Bar | en | | - | Spanish site | es.agency.gov | admin@agency.gov | John Bar | es | | + | display_name | name | contact_email | first_name | last_name | locale | related_sites_dropdown_label | + | English site | en.agency.gov | admin@agency.gov | John | Bar | en | Search On | + | All sites | all.agency.gov | admin@agency.gov | John | Bar | en | | + | Spanish site | es.agency.gov | admin@agency.gov | John | Bar | es | | And the following Connections exist for the affiliate "en.agency.gov": | connected_affiliate | display_name | | es.agency.gov | Este tema en espaƱol | @@ -600,8 +600,8 @@ Feature: Searches using mobile device Scenario: Searching on sites with federal register documents And the following Affiliates exist: - | display_name | name | contact_email | contact_name | agency_abbreviation | is_federal_register_document_govbox_enabled | domains | - | English site | en.agency.gov | admin@agency.gov | John Bar | DOC | true | noaa.gov | + | display_name | name | contact_email | first_name | last_name | agency_abbreviation | is_federal_register_document_govbox_enabled | domains | + | English site | en.agency.gov | admin@agency.gov | John | Bar | DOC | true | noaa.gov | And the following Federal Register Document entries exist: | federal_register_agencies | document_number | document_type | title | publication_date | comments_close_in_days | start_page | end_page | page_length | html_url | | DOC,IRS,ITA,NOAA | 2014-13420 | Notice | Proposed Information Collection; Comment Request | 2014-06-09 | 7 | 33040 | 33041 | 2 | https://www.federalregister.gov/articles/2014/06/09/2014-13420/proposed-information-collection-comment-request | @@ -621,8 +621,8 @@ Feature: Searches using mobile device Scenario: English search on a legacy site Given the following legacy Affiliates exist: - | display_name | name | contact_email | contact_name | - | USA.gov | usagov | aff@bar.gov | John Bar | + | display_name | name | contact_email | first_name | last_name | + | USA.gov | usagov | aff@bar.gov | John | Bar | When I am on usagov's overridden search page And I fill in "query" with "jobs" And I press "Search" in the legacy search box @@ -630,9 +630,9 @@ Feature: Searches using mobile device Scenario: Advanced search Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | locale | - | English site | en.agency.gov | admin@agency.gov | John Bar | en | - | Spanish site | es.agency.gov | admin@agency.gov | John Bar | es | + | display_name | name | contact_email | first_name | last_name | locale | + | English site | en.agency.gov | admin@agency.gov | John | Bar | en | + | Spanish site | es.agency.gov | admin@agency.gov | John | Bar | es | And affiliate "en.agency.gov" has the following RSS feeds: | name | url | is_navigable | | Articles | http://en.agency.gov/feed/articles | true | @@ -653,9 +653,9 @@ Feature: Searches using mobile device Scenario: SEC Edgar sitelinks Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | domains | - | Edgar site | sec-edgar | admin@agency.gov | John Bar | www.sec.gov/archives/edgar | - | News site | sec-news | admin@agency.gov | John Bar | www.sec.gov/news | + | display_name | name | contact_email | first_name | last_name | domains | + | Edgar site | sec-edgar | admin@agency.gov | John | Bar | www.sec.gov/archives/edgar | + | News site | sec-news | admin@agency.gov | John | Bar | www.sec.gov/news | And affiliate "sec-news" has the following document collections: | name | prefixes | is_navigable | | Edgar | sec.gov/archives/edgar | true | @@ -674,8 +674,8 @@ Feature: Searches using mobile device Scenario: Custom page 1 results pointer Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | locale | page_one_more_results_pointer | - | English site | en.agency.gov | admin@agency.gov | John Bar | en | Wherever. Try your search again to see results | + | display_name | name | contact_email | first_name | last_name | locale | page_one_more_results_pointer | + | English site | en.agency.gov | admin@agency.gov | John | Bar | en | Wherever. Try your search again to see results | When I am on en.agency.gov's search page And I fill in "Enter your search term" with "gov" And I press "Search" @@ -686,8 +686,8 @@ Feature: Searches using mobile device Scenario: Custom no results pointer Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | locale | no_results_pointer | - | English site | en.agency.gov | admin@agency.gov | John Bar | en | NORESULTS. Try your search again to see results | + | display_name | name | contact_email | first_name | last_name | locale | no_results_pointer | + | English site | en.agency.gov | admin@agency.gov | John | Bar | en | NORESULTS. Try your search again to see results | When I am on en.agency.gov's search page And I fill in "Enter your search term" with "lkssldfkjsldfkjsldkfjsldkjflsdkjflskdjfwer" And I press "Search" @@ -695,15 +695,15 @@ Feature: Searches using mobile device Scenario: Web search on Kalaallisut site Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | locale | domains | - | Kalaallisut site | kl.agency.gov | admin@agency.gov | John Bar | kl | | + | display_name | name | contact_email | first_name | last_name | locale | domains | + | Kalaallisut site | kl.agency.gov | admin@agency.gov | John | Bar | kl | | When I am on kl.agency.gov's mobile search page Then I should see "Ujarniakkat ataani allaffissamut allaguk" Scenario: Web search using Bing engine Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | locale | search_engine | domains | - | English site | en.agency.gov | admin@agency.gov | John Bar | en | BingV6 | .gov | + | display_name | name | contact_email | first_name | last_name | locale | search_engine | domains | + | English site | en.agency.gov | admin@agency.gov | John | Bar | en | BingV6 | .gov | And affiliate "en.agency.gov" has the following document collections: | name | prefixes | | USA.gov | https://www.usa.gov | @@ -720,8 +720,8 @@ Feature: Searches using mobile device Scenario: Active facet display using SearchGov Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | locale | search_engine | domains | - | English site | en.agency.gov | admin@agency.gov | John Bar | en | SearchGov | .gov | + | display_name | name | contact_email | first_name | last_name | locale | search_engine | domains | + | English site | en.agency.gov | admin@agency.gov | John | Bar | en | SearchGov | .gov | And affiliate "en.agency.gov" has the following document collections: | name | prefixes | | USA.gov | https://www.usa.gov | @@ -731,15 +731,15 @@ Feature: Searches using mobile device Scenario: Display an Alert on search page Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | locale | domains | - | English site | en.agency.gov | admin@agency.gov | John Bar | en | | + | display_name | name | contact_email | first_name | last_name | locale | domains | + | English site | en.agency.gov | admin@agency.gov | John | Bar | en | | Given the following Alert exists: | affiliate | text | status | title | - | en.agency.gov| New alert for the test aff | Active | Test Title | + | en.agency.gov| New alert for the test aff | Active | Test Title | When I am on en.agency.gov's search page Then I should see "New alert for the test aff" Given the following Alert exists: - | affiliate | text | status | title | + | affiliate | text | status | title | | en.agency.gov| New alert for the test aff | Inactive | Test Title | When I am on en.agency.gov's search page Then I should not see "New alert for the test aff" diff --git a/features/mobile_searches_bing_v7.feature b/features/mobile_searches_bing_v7.feature index 8db2ae03ca..5c38f7eec4 100644 --- a/features/mobile_searches_bing_v7.feature +++ b/features/mobile_searches_bing_v7.feature @@ -8,10 +8,10 @@ Feature: Searches using mobile device Scenario: Web search Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | locale | domains | search_engine | - | English site | en.agency.gov | admin@agency.gov | John Bar | en | | BingV7 | - | Spanish site | es.agency.gov | admin@agency.gov | John Bar | es | | BingV7 | - | Hippo site | hippo | admin@agency.gov | John Bar | en | hippo.whitehouse.gov | BingV7 | + | display_name | name | contact_email | first_name | last_name | locale | domains | search_engine | + | English site | en.agency.gov | admin@agency.gov | John | Bar | en | | BingV7 | + | Spanish site | es.agency.gov | admin@agency.gov | John | Bar | es | | BingV7 | + | Hippo site | hippo | admin@agency.gov | John | Bar | en | hippo.whitehouse.gov | BingV7 | And the following Boosted Content entries exist for the affiliate "en.agency.gov" | url | title | description | | http://http://www.whitehouse.gov/administration/president-obama | President Barack Obama | the 44th President of the United States | @@ -96,9 +96,9 @@ Feature: Searches using mobile device Scenario: News search Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | locale | search_engine | - | English site | en.agency.gov | admin@agency.gov | John Bar | en | BingV7 | - | Spanish site | es.agency.gov | admin@agency.gov | John Bar | es | BingV7 | + | display_name | name | contact_email | first_name | last_name | locale | search_engine | + | English site | en.agency.gov | admin@agency.gov | John | Bar | en | BingV7 | + | Spanish site | es.agency.gov | admin@agency.gov | John | Bar | es | BingV7 | And affiliate "en.agency.gov" has the following RSS feeds: | name | url | @@ -164,9 +164,9 @@ Feature: Searches using mobile device Scenario: Custom date range news search Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | locale | search_engine | - | English site | en.agency.gov | admin@agency.gov | John Bar | en | BingV7 | - | Spanish site | es.agency.gov | admin@agency.gov | John Bar | es | BingV7 | + | display_name | name | contact_email | first_name | last_name | locale | search_engine | + | English site | en.agency.gov | admin@agency.gov | John | Bar | en | BingV7 | + | Spanish site | es.agency.gov | admin@agency.gov | John | Bar | es | BingV7 | And affiliate "en.agency.gov" has the following RSS feeds: | name | url | is_navigable | | Press | http://www.whitehouse.gov/feed/press | true | @@ -280,8 +280,8 @@ Feature: Searches using mobile device Scenario: Media RSS search Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | search_engine | - | English site | en.agency.gov | admin@agency.gov | John Bar | BingV7 | + | display_name | name | contact_email | first_name | last_name | search_engine | + | English site | en.agency.gov | admin@agency.gov | John | Bar | BingV7 | And affiliate "en.agency.gov" has the following RSS feeds: | name | url | is_navigable | show_only_media_content | | Images | http://en.agency.gov/feed/images | true | true | @@ -294,9 +294,9 @@ Feature: Searches using mobile device Scenario: Video news search Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | locale | youtube_handles | search_engine | - | English site | en.agency.gov | admin@agency.gov | John Bar | en | usgovernment,whitehouse | BingV7 | - | Spanish site | es.agency.gov | admin@agency.gov | John Bar | es | gobiernousa | BingV7 | + | display_name | name | contact_email | first_name | last_name | locale | youtube_handles | search_engine | + | English site | en.agency.gov | admin@agency.gov | John | Bar | en | usgovernment,whitehouse | BingV7 | + | Spanish site | es.agency.gov | admin@agency.gov | John | Bar | es | gobiernousa | BingV7 | And affiliate "en.agency.gov" has the following RSS feeds: | name | url | is_navigable | is_managed | | Videos | | true | true | @@ -352,9 +352,9 @@ Feature: Searches using mobile device Scenario: Site search Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | locale | search_engine | - | English site | en.agency.gov | admin@agency.gov | John Bar | en | BingV7 | - | Spanish site | es.agency.gov | admin@agency.gov | John Bar | es | BingV7 | + | display_name | name | contact_email | first_name | last_name | locale | search_engine | + | English site | en.agency.gov | admin@agency.gov | John | Bar | en | BingV7 | + | Spanish site | es.agency.gov | admin@agency.gov | John | Bar | es | BingV7 | And affiliate "en.agency.gov" has the following document collections: | name | prefixes | @@ -378,8 +378,8 @@ Feature: Searches using mobile device Scenario: Site navigations without dropdown menu Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | locale | search_engine | - | English site | en.agency.gov | admin@agency.gov | John Bar | en | BingV7 | + | display_name | name | contact_email | first_name | last_name | locale | search_engine | + | English site | en.agency.gov | admin@agency.gov | John | Bar | en | BingV7 | And affiliate "en.agency.gov" has the following document collections: | name | prefixes | | Blog | http://blog.usa.gov/ | @@ -406,8 +406,8 @@ Feature: Searches using mobile device Scenario: Site navigations with dropdown menu Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | locale | navigation_dropdown_label | search_engine | - | English site | en.agency.gov | admin@agency.gov | John Bar | en | My-awesome-label | BingV7 | + | display_name | name | contact_email | first_name | last_name | locale | navigation_dropdown_label | search_engine | + | English site | en.agency.gov | admin@agency.gov | John | Bar | en | My-awesome-label | BingV7 | And affiliate "en.agency.gov" has the following document collections: | name | prefixes | position | is_navigable | | FAQs | http://answers.usa.gov/ | 0 | true | @@ -451,8 +451,8 @@ Feature: Searches using mobile device Scenario: Job search Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | jobs_enabled | search_engine | - | English site | usagov | admin@agency.gov | John Bar | 1 | BingV7 | + | display_name | name | contact_email | first_name | last_name | jobs_enabled | search_engine | + | English site | usagov | admin@agency.gov | John | Bar | 1 | BingV7 | When I am on usagov's mobile search page And I fill in "Enter your search term" with "jobs" And I press "Search" @@ -463,8 +463,8 @@ Feature: Searches using mobile device Scenario: When using tablet device Given I am using a mobile device And the following Affiliates exist: - | display_name | name | contact_email | contact_name | search_engine | - | bar site | bar.gov | aff@bar.gov | John Bar | BingV7 | + | display_name | name | contact_email | first_name | last_name | search_engine | + | bar site | bar.gov | aff@bar.gov | John | Bar | BingV7 | When I am on bar.gov's search page And I fill in "Enter your search term" with "bar" And I press "Search" @@ -486,9 +486,9 @@ Feature: Searches using mobile device | medline_title | locale | title | url | | Alcohol | en | Alcoholism | http://clinicaltrials.gov/search/open/condition=%22Alcoholism%22 | And the following Affiliates exist: - | display_name | name | contact_email | contact_name | locale | is_medline_govbox_enabled | search_engine | - | English site | en.agency.gov | admin@agency.gov | John Bar | en | true | BingV7 | - | Spanish site | es.agency.gov | admin@agency.gov | John Bar | es | true | BingV7 | + | display_name | name | contact_email | first_name | last_name | locale | is_medline_govbox_enabled | search_engine | + | English site | en.agency.gov | admin@agency.gov | John | Bar | en | true | BingV7 | + | Spanish site | es.agency.gov | admin@agency.gov | John | Bar | es | true | BingV7 | When I am on en.agency.gov's mobile search page And I fill in "Enter your search term" with "alcohol" And I press "Search" @@ -504,9 +504,9 @@ Feature: Searches using mobile device Scenario: Searching with sitelimit Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | locale | domains | search_engine | - | English site | en.agency.gov | admin@agency.gov | John Bar | en | .gov | BingV7 | - | Spanish site | es.agency.gov | admin@agency.gov | John Bar | es | .gov | BingV7 | + | display_name | name | contact_email | first_name | last_name | locale | domains | search_engine | + | English site | en.agency.gov | admin@agency.gov | John | Bar | en | .gov | BingV7 | + | Spanish site | es.agency.gov | admin@agency.gov | John | Bar | es | .gov | BingV7 | When I am on en.agency.gov's search page with site limited to "usa.gov" And I fill in "Enter your search term" with "gov" And I press "Search" @@ -526,9 +526,9 @@ Feature: Searches using mobile device Scenario: Searching with matching results on news govbox Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | locale | search_engine | - | English site | en.agency.gov | admin@agency.gov | John Bar | en | BingV7 | - | Spanish site | es.agency.gov | admin@agency.gov | John Bar | es | BingV7 | + | display_name | name | contact_email | first_name | last_name | locale | search_engine | + | English site | en.agency.gov | admin@agency.gov | John | Bar | en | BingV7 | + | Spanish site | es.agency.gov | admin@agency.gov | John | Bar | es | BingV7 | And affiliate "en.agency.gov" has the following RSS feeds: | name | url | is_navigable | | Press | http://en.agency.gov/feed/press | true | @@ -566,10 +566,10 @@ Feature: Searches using mobile device Scenario: Searching on sites with related sites Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | locale | related_sites_dropdown_label | search_engine | - | English site | en.agency.gov | admin@agency.gov | John Bar | en | Search On | BingV7 | - | All sites | all.agency.gov | admin@agency.gov | John Bar | en | | BingV7 | - | Spanish site | es.agency.gov | admin@agency.gov | John Bar | es | | BingV7 | + | display_name | name | contact_email | first_name | last_name | locale | related_sites_dropdown_label | search_engine | + | English site | en.agency.gov | admin@agency.gov | John | Bar | en | Search On | BingV7 | + | All sites | all.agency.gov | admin@agency.gov | John | Bar | en | | BingV7 | + | Spanish site | es.agency.gov | admin@agency.gov | John | Bar | es | | BingV7 | And the following Connections exist for the affiliate "en.agency.gov": | connected_affiliate | display_name | | es.agency.gov | Este tema en espaƱol | @@ -585,8 +585,8 @@ Feature: Searches using mobile device Scenario: Searching on sites with federal register documents And the following Affiliates exist: - | display_name | name | contact_email | contact_name | agency_abbreviation | is_federal_register_document_govbox_enabled | domains | search_engine | - | English site | en.agency.gov | admin@agency.gov | John Bar | DOC | true | noaa.gov | BingV7 | + | display_name | name | contact_email | first_name | last_name | agency_abbreviation | is_federal_register_document_govbox_enabled | domains | search_engine | + | English site | en.agency.gov | admin@agency.gov | John | Bar | DOC | true | noaa.gov | BingV7 | And the following Federal Register Document entries exist: | federal_register_agencies | document_number | document_type | title | publication_date | comments_close_in_days | start_page | end_page | page_length | html_url | | DOC,IRS,ITA,NOAA | 2014-13420 | Notice | Proposed Information Collection; Comment Request | 2014-06-09 | 7 | 33040 | 33041 | 2 | https://www.federalregister.gov/articles/2014/06/09/2014-13420/proposed-information-collection-comment-request | @@ -606,9 +606,9 @@ Feature: Searches using mobile device Scenario: Advanced search Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | locale | search_engine | - | English site | en.agency.gov | admin@agency.gov | John Bar | en | BingV7 | - | Spanish site | es.agency.gov | admin@agency.gov | John Bar | es | BingV7 | + | display_name | name | contact_email | first_name | last_name | locale | search_engine | + | English site | en.agency.gov | admin@agency.gov | John | Bar | en | BingV7 | + | Spanish site | es.agency.gov | admin@agency.gov | John | Bar | es | BingV7 | And affiliate "en.agency.gov" has the following RSS feeds: | name | url | is_navigable | | Articles | http://en.agency.gov/feed/articles | true | @@ -629,9 +629,9 @@ Feature: Searches using mobile device Scenario: SEC Edgar sitelinks Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | domains | search_engine | - | Edgar site | sec-edgar | admin@agency.gov | John Bar | www.sec.gov/archives/edgar | BingV7 | - | News site | sec-news | admin@agency.gov | John Bar | www.sec.gov/news | BingV7 | + | display_name | name | contact_email | first_name | last_name | domains | search_engine | + | Edgar site | sec-edgar | admin@agency.gov | John | Bar | www.sec.gov/archives/edgar | BingV7 | + | News site | sec-news | admin@agency.gov | John | Bar | www.sec.gov/news | BingV7 | And affiliate "sec-news" has the following document collections: | name | prefixes | is_navigable | | Edgar | sec.gov/archives/edgar | true | @@ -650,8 +650,8 @@ Feature: Searches using mobile device Scenario: Custom page 1 results pointer Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | locale | search_engine | page_one_more_results_pointer | - | English site | en.agency.gov | admin@agency.gov | John Bar | en | BingV7 | Wherever. Try your search again to see results | + | display_name | name | contact_email | first_name | last_name | locale | search_engine | page_one_more_results_pointer | + | English site | en.agency.gov | admin@agency.gov | John | Bar | en | BingV7 | Wherever. Try your search again to see results | When I am on en.agency.gov's search page And I fill in "Enter your search term" with "gov" And I press "Search" @@ -662,8 +662,8 @@ Feature: Searches using mobile device Scenario: Custom no results pointer Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | locale | search_engine | no_results_pointer | - | English site | en.agency.gov | admin@agency.gov | John Bar | en | BingV7 | NORESULTS. Try your search again to see results | + | display_name | name | contact_email | first_name | last_name | locale | search_engine | no_results_pointer | + | English site | en.agency.gov | admin@agency.gov | John | Bar | en | BingV7 | NORESULTS. Try your search again to see results | When I am on en.agency.gov's search page And I fill in "Enter your search term" with "lkssldfkjsldfkjsldkfjsldkjflsdkjflskdjfwer" And I press "Search" @@ -671,15 +671,15 @@ Feature: Searches using mobile device Scenario: Web search on Kalaallisut site Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | locale | search_engine | - | Kalaallisut site | kl.agency.gov | admin@agency.gov | John Bar | kl | BingV7 | + | display_name | name | contact_email | first_name | last_name | locale | search_engine | + | Kalaallisut site | kl.agency.gov | admin@agency.gov | John | Bar | kl | BingV7 | When I am on kl.agency.gov's mobile search page Then I should see "Ujarniakkat ataani allaffissamut allaguk" Scenario: Web search using Bing engine Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | locale | search_engine | domains | - | English site | en.agency.gov | admin@agency.gov | John Bar | en | BingV7 | .gov | + | display_name | name | contact_email | first_name | last_name | locale | search_engine | domains | + | English site | en.agency.gov | admin@agency.gov | John | Bar | en | BingV7 | .gov | And affiliate "en.agency.gov" has the following document collections: | name | prefixes | | USA.gov | https://www.usa.gov | @@ -697,8 +697,8 @@ Feature: Searches using mobile device Scenario: Display an Alert on search page Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | locale | search_engine | - | English site | en.agency.gov | admin@agency.gov | John Bar | en | BingV7 | + | display_name | name | contact_email | first_name | last_name | locale | search_engine | + | English site | en.agency.gov | admin@agency.gov | John | Bar | en | BingV7 | Given the following Alert exists: | affiliate | text | status | title | | en.agency.gov| New alert for the test aff | Active | Test Title | @@ -712,8 +712,8 @@ Feature: Searches using mobile device Scenario: English Image search Given the following legacy Affiliates exist: - | display_name | name | contact_email | contact_name | header | domains | search_engine | - | USA.gov | usagov | aff@bar.gov | John Bar | USA.gov Header | whitehouse.gov | BingV7 | + | display_name | name | contact_email | first_name | last_name | header | domains | search_engine | + | USA.gov | usagov | aff@bar.gov | John | Bar | USA.gov Header | whitehouse.gov | BingV7 | When I am on usagov's image search page When I fill in "query" with "White House" And I press "Search" @@ -723,8 +723,8 @@ Feature: Searches using mobile device Scenario: Image search with spelling suggestion Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | search_engine | - | USA.gov | usagov | aff@bar.gov | John Bar | BingV7 | + | display_name | name | contact_email | first_name | last_name | search_engine | + | USA.gov | usagov | aff@bar.gov | John | Bar | BingV7 | And the following Suggestion Blocks exist: | query | | ebuy | @@ -735,8 +735,8 @@ Feature: Searches using mobile device Scenario: Spanish image search Given the following legacy Affiliates exist: - | display_name | name | contact_email | contact_name | header | locale | search_engine | - | GobiernoUSA.gov | gobiernousa | aff@bar.gov | John Bar | Gobierno.USA.gov Header | es | BingV7 | + | display_name | name | contact_email | first_name | last_name | header | locale | search_engine | + | GobiernoUSA.gov | gobiernousa | aff@bar.gov | John | Bar | Gobierno.USA.gov Header | es | BingV7 | When I am on gobiernousa's image search page When I fill in "query" with "Barcelona" And I press "Buscar" diff --git a/features/responsive_search.feature b/features/responsive_search.feature index 24317e5952..72bd670a68 100644 --- a/features/responsive_search.feature +++ b/features/responsive_search.feature @@ -5,17 +5,17 @@ Feature: Affiliate Search Scenario: Search with a blank query on an affiliate page Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | - | bar site | bar.gov | aff@bar.gov | John Bar | + | display_name | name | contact_email | first_name | last_name | + | bar site | bar.gov | aff@bar.gov | John | Bar | When I am on bar.gov's search page And I press "Search" Then I should see "Please enter a search term in the box above." Scenario: Searching news items using time filters Given the following Affiliates exist: - | display_name | name | contact_email | contact_name | locale | youtube_handles | - | bar site | bar.gov | aff@bar.gov | John Bar | en | en_agency | - | Spanish bar site | es.bar.gov | aff@bar.gov | John Bar | es | es_agency | + | display_name | name | contact_email | first_name | last_name | locale | youtube_handles | + | bar site | bar.gov | aff@bar.gov | John | Bar | en | en_agency | + | Spanish bar site | es.bar.gov | aff@bar.gov | John | Bar | es | es_agency | When I am on bar.gov's search page And I fill in "query" with "item" And I press "Search" diff --git a/features/searchgov_search.feature b/features/searchgov_search.feature index 994338b083..e88e353471 100644 --- a/features/searchgov_search.feature +++ b/features/searchgov_search.feature @@ -5,8 +5,8 @@ Feature: SearchGov search Background: Given the following SearchGov Affiliates exist: - | display_name | name | contact_email | contact_name | header | domains | youtube_handles | - | EPA | epa | aff@epa.gov | Jane Bar | EPA.gov Header | www.epa.gov,archive.epa.gov | usgovernment | + | display_name | name | contact_email | first_name | last_name | header | domains | youtube_handles | + | EPA | epa | aff@epa.gov | Jane | Bar | EPA.gov Header | www.epa.gov,archive.epa.gov | usgovernment | Scenario: Everything search When I am on epa's search page diff --git a/features/step_definitions/affiliate_steps.rb b/features/step_definitions/affiliate_steps.rb index dca5ec7516..affc19a8fe 100644 --- a/features/step_definitions/affiliate_steps.rb +++ b/features/step_definitions/affiliate_steps.rb @@ -3,14 +3,15 @@ table.hashes.each do |hash| valid_options = { email: hash[:contact_email], - contact_name: hash[:contact_name], + first_name: hash[:first_name], + last_name: hash[:last_name], organization_name: 'Agency' } user = User.find_by_email(hash[:contact_email]) || User.create!( valid_options) user.update_attribute(:is_affiliate, true) user.update_attribute(:approval_status, 'approved') - excluded_keys = %w(agency_abbreviation contact_email contact_name domains youtube_handles is_image_search_navigable) + excluded_keys = %w[agency_abbreviation contact_email first_name last_name domains youtube_handles is_image_search_navigable] affiliate_attributes = hash.except *excluded_keys affiliate_attributes['force_mobile_format'] ||= (affiliate_type !~ /legacy/) affiliate_attributes['search_consumer_search_enabled'] ||= (/search consumer/ === affiliate_type) diff --git a/features/step_definitions/user_steps.rb b/features/step_definitions/user_steps.rb index 05af500343..e71de0b445 100644 --- a/features/step_definitions/user_steps.rb +++ b/features/step_definitions/user_steps.rb @@ -22,7 +22,8 @@ Given /^the following Users exist:$/ do |table| table.hashes.each do |hash| - User.create!(hash.merge(organization_name: 'Agency')) + @user = User.create!(hash.merge(organization_name: 'Agency')) + @user.update!(approval_status: hash[:approval_status]) if hash[:approval_status].present? end end diff --git a/features/trending_urls.feature b/features/trending_urls.feature index ba9824a257..993e139162 100644 --- a/features/trending_urls.feature +++ b/features/trending_urls.feature @@ -6,9 +6,9 @@ Feature: Trending URLs Snapshot Scenario: Viewing the trending URLs page when data is available Given I am logged in with email "affiliate_admin@fixtures.org" And the following Affiliates exist: - | name | display_name | contact_email | contact_name | - | aff1 | bureau.gov | two@bar.gov | Two Bar | - | aff2 | otheraff.govy | two@bar.gov | Two Bar | + | name | display_name | contact_email | first_name | last_name | + | aff1 | bureau.gov | two@bar.gov | Two | Bar | + | aff2 | otheraff.govy | two@bar.gov | Two | Bar | And the following trending URLs exist: | affiliate_name | trending_urls | | aff1 | http://www.aff1.gov/url1.html,http://www.aff1.gov/url2.html | diff --git a/features/user_sessions.feature b/features/user_sessions.feature index 27914e03f6..d762f850fc 100644 --- a/features/user_sessions.feature +++ b/features/user_sessions.feature @@ -39,10 +39,10 @@ Feature: User sessions @wip Scenario: User's session expires after 1 hour Given the following Users exist: - | contact_name | email | approval_status | - | Jane | jane@example.com | approved | + | first_name | last_name | email | approval_status | + | Jane | doe | jane@example.com | approved | And the time is 2017-03-30 10:55 And I am logged in with email "jane@example.com" And the time becomes 2017-03-30 12:00 And I follow "Add Site" - Then I should be on the login page \ No newline at end of file + Then I should be on the login page diff --git a/features/users.feature b/features/users.feature index 8ba9d2d8b8..1f69b5f0f5 100644 --- a/features/users.feature +++ b/features/users.feature @@ -6,7 +6,8 @@ Feature: Users When I go to the user account page Then I should see the browser page titled "My Account" And I should see "Contact Information" - And I should see "Name" + And I should see "First name" + And I should see "Last name" And I should see "Agency" And I should see "Email" @@ -22,12 +23,14 @@ Feature: Users Scenario: Registering as a new affiliate user who is a government employee or contractor with .gov email address Given I am on the sign up page When I fill in the following: - | Your full name | Lorem Ipsum | - | Email | lorem.ipsum@agency.gov | + | Your first name | Lorem | + | Your last name | Ipsum | + | Email | lorem.ipsum@agency.gov | And I press "Sign up" And I should see "Federal government agency can't be blank" When I fill in the following: - | Your full name | Lorem Ipsum | + | Your first name | Lorem | + | Your last name | Ipsum | | Email | lorem.ipsum@agency.gov | | Federal government agency | Agency | And I press "Sign up" @@ -41,8 +44,8 @@ Feature: Users @javascript Scenario: Registering as a new affiliate user without government affiliated email address Given the following Users exist: - | contact_name | email | - | Joe Schmo | jschmo@random.com | + | first_name | last_name | email | + | Joe | Schno | jschmo@random.com | And I am logged in with email "jschmo@random.com" Then I should be on the user account page And I should see "Because you don't have a .gov or .mil email address, we need additional information." @@ -50,8 +53,8 @@ Feature: Users @javascript Scenario: Logging in as a new approved affiliate user without government affiliated email address Given the following Users exist: - | contact_name | email | approval_status | - | Joe Schmo | jschmo@random.com | approved | + | first_name | last_name | email | approval_status | + | Joe | Schmo | jschmo@random.com | approved | And I am logged in with email "jschmo@random.com" Then I should be on the user account page @@ -65,14 +68,17 @@ Feature: Users Then I should see the browser page titled "Edit My Account" And I should see "Edit My Account" When I fill in the following: - | Name | | + | First name | | + | Last name | | | Government agency | | | Email | elvis@cia.gov | And I press "Save" And I should see "Organization name can't be blank" - And I should see "Contact name can't be blank" + And I should see "First name can't be blank" + And I should see "Last name can't be blank" When I fill in the following: - | Name | Elvis | + | First name | Elvis | + | Last name | Presley | | Government agency | CIA | | Email | elvis@cia.gov | And I press "Save" diff --git a/spec/controllers/sites/users_controller_spec.rb b/spec/controllers/sites/users_controller_spec.rb index 21b2111b89..4f40b0e6e9 100644 --- a/spec/controllers/sites/users_controller_spec.rb +++ b/spec/controllers/sites/users_controller_spec.rb @@ -51,7 +51,7 @@ before do expect(User).to receive(:find_by_email).with('john@email.gov').and_return nil expect(User).to receive(:new_invited_by_affiliate). - with(current_user, site, { 'contact_name' => 'John Doe', 'email' =>'john@email.gov' }). + with(current_user, site, { 'first_name': 'John', 'last_name': 'Doe', 'email': 'john@email.gov' }). and_return(new_user) expect(new_user).to receive(:save).and_return(true) @@ -61,7 +61,8 @@ post :create, params: { site_id: site.id, - user: { contact_name: 'John Doe', + user: { first_name: 'John', + last_name: 'Doe', email: 'john@email.gov', not_allowed_key: 'not allowed value' } } @@ -78,14 +79,15 @@ before do expect(User).to receive(:find_by_email).with('john@email.gov').and_return nil expect(User).to receive(:new_invited_by_affiliate). - with(current_user, site, { 'contact_name' => '', 'email' =>'john@email.gov' }). + with(current_user, site, { 'first_name': '', 'last_name': 'Doe', 'email': 'john@email.gov' }). and_return(new_user) expect(new_user).to receive(:save).and_return(false) post :create, params: { site_id: site.id, - user: { contact_name: '', + user: { first_name: '', + last_name: 'Doe', email: 'john@email.gov', not_allowed_key: 'not allowed value' } } @@ -110,7 +112,8 @@ post :create, params: { site_id: site.id, - user: { contact_name: 'John Doe', + user: { first_name: 'John', + last_name: 'Doe', email: 'john@email.gov' } } end @@ -130,13 +133,14 @@ expect(site).to receive(:users).and_return(site_users) expect(site_users).to receive(:exists?).with(id: existing_user.id).and_return(true) expect(User).to receive(:new). - with({ 'contact_name' => 'John Doe', 'email' => 'john@email.gov' }). + with({ 'first_name': 'John', 'last_name': 'Doe', 'email': 'john@email.gov' }). and_return(new_user) post :create, params: { site_id: site.id, - user: { contact_name: 'John Doe', + user: { first_name: 'John', + last_name: 'Doe', email: 'john@email.gov' } } end diff --git a/spec/controllers/users_controller_spec.rb b/spec/controllers/users_controller_spec.rb index ea4e16694b..adb288f04d 100644 --- a/spec/controllers/users_controller_spec.rb +++ b/spec/controllers/users_controller_spec.rb @@ -3,12 +3,13 @@ describe UsersController do fixtures :users let(:user_params) do - { contact_name: 'Barack', + { first_name: 'Obama', + last_name: 'Barack', organization_name: 'White House', email: 'barack@whitehouse.gov' } end - let(:permitted_params) { %i[contact_name organization_name email] } + let(:permitted_params) { %i[first_name last_name organization_name email] } describe '#create' do it do @@ -96,12 +97,13 @@ let(:update_account) do post :update_account, params: { use_route: user_update_account_path(user_id: current_user.id), - user: { 'contact_name': 'BAR', + user: { 'first_name': 'BAR', + 'last_name': 'FOO', 'email': 'foo@bar.com' } } end let(:update_params) do - { 'contact_name': 'Foo BAR', 'email': 'foo@bar.com' } + { 'first_name': 'Foo', 'last_name': 'Bar', 'email': 'foo@bar.com' } end context 'when logged in as affiliate' do @@ -148,7 +150,7 @@ end let(:update_params) do - { 'contact_name': 'BAR', 'email': 'changed@foo.com' } + { 'first_name': 'Foo', 'last_name': 'BAR', 'email': 'changed@foo.com' } end context 'when logged in as affiliate' do diff --git a/spec/fixtures/json/hints.json b/spec/fixtures/json/hints.json index 11eca11ab0..50d72c0a48 100644 --- a/spec/fixtures/json/hints.json +++ b/spec/fixtures/json/hints.json @@ -2,6 +2,7 @@ "document_collection.name": null, "document_collection.url_prefixes.prefix": "Enter the folder where the files to be searched are stored. Don't add an index page.", "site_domain.domain": "Leave off www to include all subdomains. Use www for results from www.agency.gov only.", - "user.contact_name": "Please enter first and last name.", + "user.first_name": "Please enter first name.", + "user.last_name": "Please enter last name", "user.email": "Users you add will receive an email to complete their registration." } diff --git a/spec/fixtures/json/watcher/low_query_ctr_watcher_body.json b/spec/fixtures/json/watcher/low_query_ctr_watcher_body.json index f3ab0f450b..46f3138875 100644 --- a/spec/fixtures/json/watcher/low_query_ctr_watcher_body.json +++ b/spec/fixtures/json/watcher/low_query_ctr_watcher_body.json @@ -135,7 +135,8 @@ "alert_name": "low CTR", "user_email": "affiliate_manager@fixtures.org", "user_id": 667152013, - "user_contact_name": "Affiliate Manager", + "user_first_name": "Affiliate Manager", + "user_last_name": "Smith", "watcher_type": "LowQueryCtrWatcher" } } diff --git a/spec/fixtures/json/watcher/no_results_watcher_body.json b/spec/fixtures/json/watcher/no_results_watcher_body.json index 735b074577..025e325d8c 100644 --- a/spec/fixtures/json/watcher/no_results_watcher_body.json +++ b/spec/fixtures/json/watcher/no_results_watcher_body.json @@ -114,7 +114,8 @@ "alert_name": "no rez", "user_email": "affiliate_manager@fixtures.org", "user_id": 667152013, - "user_contact_name": "Affiliate Manager", + "user_first_name": "Affiliate Manager", + "user_last_name": "Smith", "watcher_type": "NoResultsWatcher" } } diff --git a/spec/fixtures/users.yml b/spec/fixtures/users.yml index 82e0322885..db738397f5 100644 --- a/spec/fixtures/users.yml +++ b/spec/fixtures/users.yml @@ -2,14 +2,16 @@ DEFAULTS: &DEFAULTS organization_name: Agency persistence_token: cedf2dac3e2d0e7223d8d1ae126c5a18e021ad9bc6dd0a2f01677e907b3e0a1802d82273fe3ac061b5fd80209ea39632c0a9e3081a1d43bb7ced9884d7754b62 approval_status: approved - contact_name: Jane Doe + first_name: Jane + last_name: Doe affiliate_admin: <<: *DEFAULTS email: affiliate_admin@fixtures.org is_affiliate_admin: true is_affiliate: false - contact_name: Affiliate Administrator + first_name: Affiliate Administrator + last_name: Smith welcome_email_sent: true affiliate_added_by_another_affiliate: @@ -17,7 +19,8 @@ affiliate_added_by_another_affiliate: email: affiliate_added_by_another_affiliate@fixtures.org is_affiliate_admin: false is_affiliate: true - contact_name: Invited Affiliate Manager + first_name: Invited Affiliate Manager + last_name: Smith approval_status: approved requires_manual_approval: false @@ -26,7 +29,8 @@ non_affiliate_admin: email: non_affiliate_admin@fixtures.org is_affiliate_admin: false is_affiliate: false - contact_name: Not An Affiliate + first_name: Not An Affiliate + last_name: Smith welcome_email_sent: true affiliate_manager: @@ -34,7 +38,8 @@ affiliate_manager: email: affiliate_manager@fixtures.org is_affiliate_admin: false is_affiliate: true - contact_name: Affiliate Manager + first_name: Affiliate Manager + last_name: Smith welcome_email_sent: true another_affiliate_manager: @@ -42,7 +47,8 @@ another_affiliate_manager: email: another_affiliate_manager@fixtures.org is_affiliate_admin: false is_affiliate: true - contact_name: Another Manager + first_name: Another Manager + last_name: Smith welcome_email_sent: true affiliate_manager_with_no_affiliates: @@ -50,7 +56,8 @@ affiliate_manager_with_no_affiliates: email: affiliate_manager_with_no_affiliates@fixtures.org is_affiliate_admin: false is_affiliate: true - contact_name: A New Manager + first_name: A New Manager + last_name: Smith welcome_email_sent: true affiliate_manager_with_one_site: @@ -58,7 +65,8 @@ affiliate_manager_with_one_site: email: affiliate_manager_with_one_site@fixtures.org is_affiliate_admin: false is_affiliate: true - contact_name: A New Manager with one site + first_name: A New Manager with one site + last_name: Smith welcome_email_sent: true approval_status: approved @@ -67,14 +75,16 @@ affiliate_without_contact_info: email: affiliate_with_no_contact_info@fixtures.org is_affiliate_admin: false is_affiliate: true - contact_name: A New Affiliate + first_name: A New Affiliate + last_name: Smith welcome_email_sent: true marilyn: <<: *DEFAULTS email: marilyn@fixtures.org is_affiliate_admin: true - contact_name: Analyst With Full Privileges + first_name: Analyst With Full Privileges + last_name: Smith welcome_email_sent: true developer: @@ -82,7 +92,8 @@ developer: email: developer@fixtures.org is_affiliate_admin: false is_affiliate: false - contact_name: A New Developer + first_name: A New Developer + last_name: Smith welcome_email_sent: true active_user: @@ -141,7 +152,8 @@ affiliate_manager_with_pending_contact_information_status: email: affiliate_manager_with_pending_contact_information_status@fixtures.org is_affiliate_admin: false is_affiliate: true - contact_name: Pending Contact Information Affiliate Manager + first_name: Pending Contact Information Affiliate Manager + last_name: Smith approval_status: pending_contact_information requires_manual_approval: true @@ -150,7 +162,8 @@ affiliate_manager_with_pending_approval_status: email: affiliate_manager_with_pending_approval_status@fixtures.org is_affiliate_admin: false is_affiliate: true - contact_name: Pending Approval Affiliate Manager + first_name: Pending Approval Affiliate Manager + last_name: Smith approval_status: pending_approval requires_manual_approval: true @@ -159,7 +172,8 @@ affiliate_manager_requires_manual_approval: email: affiliate_manager_requires_manual_approval@fixtures.org is_affiliate_admin: false is_affiliate: true - contact_name: Requires Manual Approval Affiliate Manager + first_name: Requires Manual Approval Affiliate Manager + last_name: Smith approval_status: pending_approval requires_manual_approval: true @@ -168,7 +182,8 @@ affiliate_manager_with_not_approved_status: email: affiliate_manager_with_not_approved_status@fixtures.org is_affiliate_admin: false is_affiliate: true - contact_name: Not Approved Affiliate Manager + first_name: Not Approved Affiliate Manager + last_name: Smith approval_status: not_approved requires_manual_approval: true @@ -178,16 +193,26 @@ affiliate_requiring_manual_approval: requires_manual_approval: true approval_status: pending_approval -no_contact_name: - email: no_contact_name@email.gov - contact_name: '' +no_first_name: + email: no_first_name@email.gov + first_name: '' + last_name: 'Smith' + organization_name: Agency + persistence_token: cedf2dac3e2d0e7223d8d1ae126c5a18e021ad9bc6dd0a2f01677e907b3e0a1802d82273fe3ac061b5fd80209ea39632c0a9e3081a1d43bb7ced9884d7754b62 + approval_status: approved + +no_last_name: + email: no_last_name@email.gov + first_name: 'Bob' + last_name: '' organization_name: Agency persistence_token: cedf2dac3e2d0e7223d8d1ae126c5a18e021ad9bc6dd0a2f01677e907b3e0a1802d82273fe3ac061b5fd80209ea39632c0a9e3081a1d43bb7ced9884d7754b62 approval_status: approved no_organization_name: email: no_organization_name@email.gov - contact_name: Jane Doe + first_name: Jane + last_name: Doe organization_name: '' persistence_token: cedf2dac3e2d0e7223d8d1ae126c5a18e021ad9bc6dd0a2f01677e907b3e0a1802d82273fe3ac061b5fd80209ea39632c0a9e3081a1d43bb7ced9884d7754b62 approval_status: approved diff --git a/spec/lib/importers/hint_data_spec.rb b/spec/lib/importers/hint_data_spec.rb index 461c79bd4f..2c3d976e27 100644 --- a/spec/lib/importers/hint_data_spec.rb +++ b/spec/lib/importers/hint_data_spec.rb @@ -9,7 +9,7 @@ expect(DocumentFetcher).to receive(:fetch).and_return(body: json_str) HintData.reload - expect(Hint.count).to eq(5) + expect(Hint.count).to eq(6) hint = Hint.find_by_name('document_collection.name') expect(hint.value).to be_nil @@ -17,8 +17,12 @@ hint = Hint.find_by_name('site_domain.domain') expect(hint.value).to match(/Use www for results from www\.agency\.gov only/) - hint = Hint.find_by_name('user.contact_name') - expect(hint.value).to match(/Please enter first and last name/) + hint = Hint.find_by_name('user.first_name') + expect(hint.value).to match(/Please enter first name/) + expect(Hint.find_by_name('obsolete_key')).to be_nil + + hint = Hint.find_by_name('user.last_name') + expect(hint.value).to match(/Please enter last name/) expect(Hint.find_by_name('obsolete_key')).to be_nil end diff --git a/spec/mailers/emailer_spec.rb b/spec/mailers/emailer_spec.rb index eb0025af32..04b461fa09 100644 --- a/spec/mailers/emailer_spec.rb +++ b/spec/mailers/emailer_spec.rb @@ -18,7 +18,8 @@ it { is_expected.to deliver_to(user.email) } it { is_expected.to have_body_text message } - it { is_expected.to have_body_text user.contact_name } + it { is_expected.to have_body_text user.first_name } + it { is_expected.to have_body_text user.last_name } end describe '#account_deactivated' do @@ -31,7 +32,8 @@ it { is_expected.to deliver_to(user.email) } it { is_expected.to have_body_text message } - it { is_expected.to have_body_text user.contact_name } + it { is_expected.to have_body_text user.first_name } + it { is_expected.to have_body_text user.last_name } end describe '#user_approval_removed' do @@ -41,7 +43,8 @@ it { is_expected.to deliver_to("usagov@search.gov") } it { is_expected.to have_body_text "The following user is no longer associated with any sites" } - it { is_expected.to have_body_text user.contact_name } + it { is_expected.to have_body_text user.first_name } + it { is_expected.to have_body_text user.last_name } it { is_expected.to have_body_text user.email } it { is_expected.to have_body_text user.organization_name } end @@ -104,28 +107,30 @@ context "affiliate user has .com email address" do let(:user) do double(User, - :email => 'not.gov.user@agency.com', - :contact_name => 'Contractor Joe', - :affiliates => [], - :organization_name => 'Agency', - :requires_manual_approval? => true) + email: 'not.gov.user@agency.com', + first_name: 'Contractor Joe', + last_name: 'Shmoe', + affiliates: [], + organization_name: 'Agency', + requires_manual_approval?: true) end subject { Emailer.new_user_to_admin(user) } it { is_expected.to deliver_to('usagov@search.gov') } it { is_expected.to have_subject(/New user sign up/) } - it { is_expected.to have_body_text(/Name: Contractor Joe\nEmail: not.gov.user@agency.com\nOrganization name: Agency\n\n\n This person doesn't have a .gov or .mil email address/) } + it { is_expected.to have_body_text(/Name: Contractor Joe Shmoe\nEmail: not.gov.user@agency.com\nOrganization name: Agency\n\n\n This person doesn't have a .gov or .mil email address/) } end context "affiliate user has .gov email address" do let(:user) do double(User, - :email => 'not.com.user@agency.gov', - :contact_name => 'Gov Employee Joe', - :affiliates => [], - :organization_name => 'Gov Agency', - :requires_manual_approval? => false) + email: 'not.com.user@agency.gov', + first_name: 'Gov Employee Joe', + last_name: 'Shmoe', + affiliates: [], + organization_name: 'Gov Agency', + requires_manual_approval?: false) end subject { Emailer.new_user_to_admin(user) } @@ -149,18 +154,18 @@ subject { Emailer.new_user_to_admin(user) } it { is_expected.to deliver_to('usagov@search.gov') } - it { is_expected.to have_body_text /Name: Invited Affiliate Manager\nEmail: affiliate_added_by_another_affiliate@fixtures.org\nOrganization name: Agency\n\n\n Affiliate Manager added this person to 'Noaa Site'. They will be approved after verifying their email./ } + it { is_expected.to have_body_text /Name: Invited Affiliate Manager Smith\nEmail: affiliate_added_by_another_affiliate@fixtures.org\nOrganization name: Agency\n\n\n Affiliate Manager Smith added this person to 'Noaa Site'. They will be approved after verifying their email./ } end context "user didn't get invited by another customer (and thus has no affiliates either)" do let(:user) do double(User, - :email => 'not.com.user@agency.gov', - :contact_name => 'Gov Employee Joe', - :organization_name => 'Gov Agency', - :affiliates => [], - :requires_manual_approval? => false) - + email: 'not.com.user@agency.gov', + first_name: 'Gov Employee Joe', + last_name: 'Shmoe', + organization_name: 'Gov Agency', + affiliates: [], + requires_manual_approval?: false) end subject { Emailer.new_user_to_admin(user) } @@ -174,10 +179,14 @@ let(:user) do mock_model(User, email: 'invitee@agency.com', - contact_name: 'Invitee Joe') + first_name: 'Invitee Joe', + last_name: 'shmoe') end - let(:current_user) { mock_model(User, :email => "inviter@agency.com", :contact_name => 'Inviter Jane') } + let(:current_user) { mock_model(User, + email: "inviter@agency.com", + first_name: 'Inviter Jane', + last_name: 'Doe') } let(:affiliate) { affiliates(:basic_affiliate) } subject { Emailer.welcome_to_new_user_added_by_affiliate(affiliate, user, current_user) } @@ -330,7 +339,14 @@ end context "when a template is missing" do - let(:user) { double(User, :email => "invitee@agency.com", :contact_name => 'Invitee Joe', affiliates: []) } + let(:user) do + double(User, + email: 'invitee@agency.com', + first_name: 'Invitee Joe', + last_name: 'Shmoe', + affiliates: []) + end + let(:report_date) { Date.today } before { EmailTemplate.destroy_all } diff --git a/spec/models/affiliate_spec.rb b/spec/models/affiliate_spec.rb index 02047e8fe1..fce70f3e45 100644 --- a/spec/models/affiliate_spec.rb +++ b/spec/models/affiliate_spec.rb @@ -965,22 +965,29 @@ end end - describe "#recent_user_activity" do + describe '#recent_user_activity' do let(:affiliate) { affiliates(:basic_affiliate) } let(:another_affiliate_manager) { users(:another_affiliate_manager) } let(:affiliate_manager_with_one_site) { users(:affiliate_manager_with_one_site) } - let(:recent_time) { Time.now } + let(:recent_time) { Time.now.utc } before do - affiliate.users.first.update_attribute(:last_request_at, recent_time) + @au = affiliate.users.first + @au.last_request_at = recent_time + @au.save! + + another_affiliate_manager.last_request_at = recent_time - 1.hour + another_affiliate_manager.save! + + affiliate_manager_with_one_site.last_request_at = nil + affiliate_manager_with_one_site.save! + affiliate.users << another_affiliate_manager - affiliate.users.last.update_attribute(:last_request_at, recent_time - 1.hour) affiliate.users << affiliate_manager_with_one_site - affiliate.users.last.update_attribute(:last_request_at, nil) end it 'should show the max last_request_at date for the site users' do - expect(affiliate.recent_user_activity.utc.to_s).to eq(recent_time.utc.to_s) + expect(affiliate.recent_user_activity.utc.to_s).to eq(recent_time.to_s) end end @@ -1248,7 +1255,10 @@ describe '#user_emails' do it 'returns comma delimited user emails' do affiliate = affiliates(:non_existent_affiliate) - expect(affiliate.user_emails).to eq('Another Manager ,Requires Manual Approval Affiliate Manager ') + expect(affiliate.user_emails). + to eq('Another Manager Smith ,' \ + 'Requires Manual Approval Affiliate Manager Smith '\ + '') end end diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 34e2f16d47..d2c8877a6d 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -4,16 +4,18 @@ fixtures :users, :affiliates, :memberships let(:valid_attributes) do - { email: "unique_login@agency.gov", - contact_name: "Some One", - organization_name: "Agency", + { email: 'unique_login@agency.gov', + first_name: 'Some', + last_name: 'One', + organization_name: 'Agency', }.freeze end before do @valid_affiliate_attributes = { email: 'some.guy@usa.gov', - contact_name: 'Some Guy', + first_name: 'Some', + last_name: 'Guy', organization_name: 'Agency' } @emailer = double(Emailer) @@ -45,31 +47,36 @@ end it do - is_expected.to validate_presence_of(:contact_name).on(:update_account) + is_expected.to validate_presence_of(:first_name).on(:update_account) end - it "should create a new instance given valid attributes" do + it do + is_expected.to validate_presence_of(:last_name).on(:update_account) + end + + it 'should create a new instance given valid attributes' do User.create!(valid_attributes) end - it "should create a user with a minimal set of attributes if the user is an affiliate" do + it 'should create a user with a minimal set of + attributes if the user is an affiliate' do affiliate_user = User.new(@valid_affiliate_attributes) expect(affiliate_user.save).to be true expect(affiliate_user.is_affiliate?).to be true end - it "should send the admins a notification email about the new user" do + it 'should send the admins a notification email about the new user' do expect(Emailer).to receive(:new_user_to_admin).with(an_instance_of(User)).and_return @emailer User.create!(valid_attributes) end - it "should not receive welcome to new user added by affiliate" do + it 'should not receive welcome to new user added by affiliate' do expect(Emailer).to_not receive(:welcome_to_new_user_added_by_affiliate) User.create!(valid_attributes) end - context "when the flag to not send an email is set to true" do - it "should not send any emails" do + context 'when the flag to not send an email is set to true' do + it 'should not send any emails' do User.create!(valid_attributes.merge(:skip_welcome_email => true)) end end @@ -148,8 +155,14 @@ describe '.complete?' do subject(:incomplete_account) { user.complete? } - context 'when the user contact name is empty' do - let(:user) { users(:no_contact_name) } + context 'when the user first name is empty' do + let(:user) { users(:no_first_name) } + + it { is_expected.to eq(false) } + end + + context 'when the user last name is empty' do + let(:user) { users(:no_last_name) } it { is_expected.to eq(false) } end @@ -275,7 +288,7 @@ describe "#to_label" do it "should return the user's contact name" do u = users(:affiliate_admin) - expect(u.to_label).to eq('Affiliate Administrator ') + expect(u.to_label).to eq('Affiliate Administrator Smith ') end end @@ -367,16 +380,19 @@ let(:inviter) { users(:affiliate_manager) } let(:affiliate) { affiliates(:basic_affiliate) } - context 'when contact_name and email are provided' do + context 'when first_name, last_name and email are provided' do - it 'initializes new user with assign affiliate, contact_name, and email' do - new_user = User.new_invited_by_affiliate(inviter, - affiliate, - { contact_name: 'New User Name', - email: 'newuser@approvedagency.com' }) + it 'initializes new user with assign affiliate, first_name, last_name, and email' do + new_user = User. + new_invited_by_affiliate(inviter, + affiliate, + { first_name: 'New User Name', + last_name: 'New User Last Name', + email: 'newuser@approvedagency.com' }) new_user.save! expect(new_user.affiliates.first).to eq(affiliate) - expect(new_user.contact_name).to eq('New User Name') + expect(new_user.first_name).to eq('New User Name') + expect(new_user.last_name).to eq('New User Last Name') expect(new_user.email).to eq('newuser@approvedagency.com') expect(new_user.is_affiliate?).to be true expect(new_user.requires_manual_approval).to be false @@ -387,10 +403,12 @@ it 'receives the welcome new user' do expect(Emailer).to receive(:welcome_to_new_user_added_by_affiliate).and_return @emailer - new_user = User.new_invited_by_affiliate(inviter, - affiliate, - { contact_name: 'New User Name', - email: 'newuser@approvedagency.com' }) + new_user = User. + new_invited_by_affiliate(inviter, + affiliate, + { first_name: 'New User Name', + last_name: 'New User Name', + email: 'newuser@approvedagency.com' }) new_user.save! end end diff --git a/spec/support/shared_concern_accountable.rb b/spec/support/shared_concern_accountable.rb index 7dcf65b7c0..7850bf527d 100644 --- a/spec/support/shared_concern_accountable.rb +++ b/spec/support/shared_concern_accountable.rb @@ -1,7 +1,7 @@ shared_examples 'require complete account' do |request_method, action, parameters = nil| - context 'when user did not supply contact_name' do - let(:current_user) { users(:no_contact_name) } + context 'when user did not supply contact info' do + let(:current_user) { users(:no_first_name) } before do UserSession.create current_user @@ -13,12 +13,19 @@ expect(response).to redirect_to('/account/edit') end - context 'when the user has no contact_name' do - let(:current_user) { users(:no_contact_name) } + context 'when the user has no first_name' do + it 'returns error for user to supply contact name' do + expect(current_user.errors.messages[:first_name].first). + to eq('You must supply a first name') + end + end + + context 'when the user has no last_name' do + let(:current_user) { users(:no_last_name) } it 'returns error for user to supply contact name' do - expect(current_user.errors.messages[:contact_name].first). - to eq('You must supply a contact name') + expect(current_user.errors.messages[:last_name].first). + to eq('You must supply a last name') end end @@ -31,4 +38,4 @@ end end end -end \ No newline at end of file +end