AO3-2312 admin post kudos#3082
Conversation
4d3f84b to
8c8e3fa
Compare
ariana-paris
left a comment
There was a problem hiding this comment.
I'd like someone from front-end to okay the class names and CSS changes, but I made some comments about the tests and aside from that, it looks good to me.
14410f0 to
b56fdf1
Compare
c8c0b9e to
660b74a
Compare
6703061 to
a280e6a
Compare
|
So this has lots of merge conflicts. And now Kudo is given by a users rather than psueds. |
|
The kudos button should also only be available on an individual admin post's show page, like the comment form is only available there. |
a280e6a to
6368e72
Compare
| Given /^I have posted an admin post$/ do | ||
| step(%{I am logged in as a "communications" admin}) | ||
| step("I make an admin post") | ||
| step("I am on the homepage") |
There was a problem hiding this comment.
Without this, the JS-enabled tests fail as we land on example.com after making the admin post. I don't know why that is...is it related to this default URL value? I can't repro manually 😕
Please suggest a better fix if you know one!
There was a problem hiding this comment.
It's been a while, but there is a better fix now:
In AdminPostsController#create change the redirect_to(@admin_post) to redirect_to admin_post_path(@admin_post).
Explanation:
The controller calls redirect_to on a model object (instead of a path). When you call redirect_to on a model, Rails automatically tries to convert it to a full URL, instead of a path, and when the host is set to example.com, that means that it tries to redirect to example.com.
| And I follow "Default Admin Post" | ||
| And I press "Kudos ♥" |
There was a problem hiding this comment.
If master is merged into this branch (which would be nice), then this test needs an update:
| And I follow "Default Admin Post" | |
| And I press "Kudos ♥" | |
| And I follow "Default Admin Post" | |
| And all emails have been delivered | |
| And I press "Kudos ♥" |
So the email from creating the admin wont mess up the test.
|
Adopted at #5931 |
Issue
https://otwarchive.atlassian.net/browse/AO3-2312
Purpose
Lets guests and users leave kudos on admin posts.
Testing
Note: I found that a kudo left while logged in as a admin counts as having been left by a guest. I assume that is expected as admins are not users. Let me know in review if that's not what's desired.