-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Render the proper value so that the table sorts correctly by last edi…
…ted (#443) * Render the proper value so that the table sorts correctly by last edited * Add pointer to Dataset documentation for future reference
- Loading branch information
1 parent
3f66d7f
commit 85cb196
Showing
3 changed files
with
20 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# frozen_string_literal: true | ||
require "rails_helper" | ||
RSpec.describe "User dashboard" do | ||
describe "Sort by last edited uses the proper value" do | ||
let(:user_admin) { FactoryBot.create :super_admin_user } | ||
let(:work) { FactoryBot.create(:draft_work) } | ||
|
||
it "renders the proper date value for sorting by last edited", js: true do | ||
work_last_edited = work.updated_at.strftime("%Y-%m-%d %H:%M:%S %Z") | ||
sort_value = '<td class="last-edited" data-sort="' + work_last_edited + '">' | ||
sign_in user_admin | ||
visit user_path(user_admin) | ||
expect(page.html.include?(sort_value)).to be true | ||
end | ||
end | ||
end |