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).
This commit is contained in:
Kristina Lim
2019-02-02 01:43:48 +08:00
parent cf744bb663
commit 4bff256f6d

View File

@@ -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