-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sort published drafts by last updated #9995
Conversation
Codecov Report
@@ Coverage Diff @@
## main #9995 +/- ##
==========================================
+ Coverage 82.13% 82.19% +0.05%
==========================================
Files 98 98
Lines 5968 5971 +3
==========================================
+ Hits 4902 4908 +6
+ Misses 1066 1063 -3
|
@jywarren None of the tests are failing |
Nice @TildaDares! Is there a way we can get this tested in some way before merging? Screenshots, or even with a scrubbed database? That seems important for the original issue at #9985. |
Thank you for writing this @TildaDares !!!! |
We discussed using Timecop on the weekly call, i think that could be a nice test -- maybe a functional test? Or integration test? |
This is awesome though, thank you!!! |
@jywarren Is it how notes on the activity feed are sorted I'm supposed to test? Currently, I'm testing this by changing the timestamp of an old note to a time far in the future so that it will appear as the first item in the activity feed but this line sorts the items in the activity feed by newly created. plots2/app/controllers/home_controller.rb Line 155 in cff3581
|
So as to the test, it looks like we actually have one here! plots2/test/functional/notes_controller_test.rb Lines 840 to 866 in cff3581
But are we not testing enough? We want to:
It does look like that line 155 is sorting a second time by created_at, but for nodes, created_at is just a function which formats the timestamp, i believe? see def created_at in node.rb to confirm. Hope this helps! |
ce374d1
to
1bea55d
Compare
assert_equal 1, node.status | ||
end | ||
|
||
assert_not_equal revision_timestamp, node.latest['timestamp'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here could we assert what it should be equal to? Also, we could assert the wrong (original) timestamp before we publish the draft, to show that it was different before vs after.
This looks great! Thanks Tilda!!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jywarren I've made the changes
1bea55d
to
6ac3a98
Compare
Code Climate has analyzed commit 6ac3a98 and detected 0 issues on this pull request. View more on Code Climate. |
This is fantastic. Great job!!!! |
* sort published drafts by last updated * added functional test
* sort published drafts by last updated * added functional test
Fixes #9985