Use a regex pattern to avoid flaky timestamp spec (#12827)
This commit is contained in:
parent
01d8818e9e
commit
7fa46683aa
1 changed files with 3 additions and 3 deletions
|
|
@ -63,9 +63,9 @@ RSpec.describe "User index", type: :system, stub_elasticsearch: true do
|
|||
|
||||
def shows_comment_timestamp
|
||||
within("#substories .profile-comment-card .profile-comment-row:first-of-type") do
|
||||
ts = comment.decorate.published_timestamp
|
||||
timestamp_selector = ".comment-date time[datetime='#{ts}']"
|
||||
expect(page).to have_selector(timestamp_selector)
|
||||
iso8601_date_time = /^((\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})Z)$/
|
||||
timestamp = page.find(".comment-date time")[:datetime]
|
||||
expect(timestamp).to match(iso8601_date_time)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue