From 4bff256f6d06f85bd382ecf342490d7a46ecace3 Mon Sep 17 00:00:00 2001 From: Kristina Lim Date: Sat, 2 Feb 2019 01:43:48 +0800 Subject: [PATCH] Match date format in spec with import date filter This was failing if the current day of month only has one digit. The test could not find the date in the import date filter. Before this commit, the resulting string in the test replaced " " with " ", so "February 2" was being changed to "February 2". The import date filter however uses two spaces in this case, even if the browser shows only one (HTML inline text renders two spaces as just one). --- spec/features/admin/product_import_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/features/admin/product_import_spec.rb b/spec/features/admin/product_import_spec.rb index d196a686e0..c44ac21a26 100644 --- a/spec/features/admin/product_import_spec.rb +++ b/spec/features/admin/product_import_spec.rb @@ -164,7 +164,7 @@ feature "Product Import", js: true do end expect(page).to have_selector 'div#s2id_import_date_filter' - import_time = carrots.import_date.to_date.to_formatted_s(:long).gsub(' ', ' ') + import_time = carrots.import_date.to_date.to_formatted_s(:long) select2_select import_time, from: "import_date_filter" expect(page).to have_field "product_name", with: carrots.name