-
Notifications
You must be signed in to change notification settings - Fork 0
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
Milestone: #Capybara specs-pair programming #9
Conversation
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.
Hi @cosywasswa and @manzitresor,
Highlights
✔️ Passing tests
Good job so far!
There are some issues that you still need to work on to go to the next project but you are almost there!
Required Changes ♻️
Check the comments under the review.
Optional suggestions
Every comment with the [OPTIONAL] prefix is not crucial enough to stop the approval of this PR. However, I strongly recommend you to take them into account as they can make your code better.
Cheers and Happy coding!👏👏👏
Feel free to leave any questions or comments in the PR thread if something is not 100% clear.
Please, do not open a new Pull Request for re-reviews. You should use the same Pull Request submitted for the first review, either valid or invalid unless it is requested otherwise.
As described in the Code reviews limits policy you have a limited number of reviews per project (check the exact number in your Dashboard). If you think that the code review was not fair, you can request a second opinion using this form.
spec/features/user_show_spec.rb
Outdated
describe 'show page' do | ||
before(:each) do | ||
visit user_path(@user1) | ||
end | ||
|
||
it 'can see the user profile picture.' do | ||
expect(page).to have_css("img[src='#{@user1.photo}']") | ||
end | ||
|
||
it 'can see the user username' do | ||
expect(page).to have_content(@user1.name.to_s) | ||
end | ||
|
||
it 'I can see the number of posts the user has written.' do | ||
expect(page).to have_content("Number of posts: #{@user1.posts_counter}") | ||
end | ||
|
||
it 'I can see the user bio.' do | ||
expect(page).to have_content(@user1.bio.to_s) | ||
end | ||
|
||
it 'I can see the user first 3 posts.' do | ||
@user1.recent_posts.each do |post| | ||
expect(page).to have_content(post.text) | ||
end | ||
end | ||
|
||
it 'can see a button to view all user posts' do | ||
expect(page).to have_selector('button', text: 'See all posts') | ||
end | ||
end | ||
describe 'GET/posts/show' do | ||
it 'When I click a user post, it redirects me to that post show page' do | ||
visit user_path(@user1) | ||
|
||
post = @user1.recent_posts.first | ||
click_link(post.id) | ||
expect(page).to have_current_path(user_post_path(@user1, post)) | ||
end | ||
end |
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.
- Kindly add test that when we click the "See all posts" button it takes the user to the posts index page.
spec/features/post_show_spec.rb
Outdated
it 'should see title of the post' do | ||
@posts.each do |post| | ||
expect(page).to have_content(post.title.to_s) | ||
end | ||
end | ||
it 'I can see who wrote the post.' do | ||
expect(page).to have_content(@user_one.name.to_s) | ||
end | ||
it 'I can see how many comments it has' do | ||
@posts.each do |post| | ||
expect(page).to have_content("Comments:#{post.comments_counter}") | ||
end | ||
end | ||
it 'I can see how many likes a post has' do | ||
@posts.each do |post| | ||
expect(page).to have_content("Likes:#{post.likes_counter}") | ||
end | ||
end | ||
|
||
it 'I can see the username of each commentor' do | ||
@posts.each do |post| | ||
post.recent_comments.each do |comment| | ||
expect(page).to have_content(comment.user.name) | ||
end | ||
end | ||
end | ||
it 'I can see the comment each commentor left.' do | ||
@posts.each do |post| | ||
post.recent_comments.each do |comment| | ||
expect(page).to have_content(comment.user.text) | ||
end | ||
end | ||
end |
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.
- Kindly add the tast to check that you can the post body. It is missing here.
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.
Hi @cosywasswa and @manzitresor,
Highlights
✔️ Passing tests
Great work on making the changes requested 👏
You've done well implementing some of the requested changes, but there are still some which aren't addressed yet.
Required Changes ♻️
Check the comments under the review.
Optional suggestions
Every comment with the [OPTIONAL] prefix won't stop the approval of this PR. However, I strongly recommend you to take them into account as they can make your code better. Some of them were simply missed by the previous reviewer and addressing them will really improve your application.
Cheers and Happy coding!👏👏👏
Feel free to leave any questions or comments in the PR thread if something is not 100% clear.
Please, do not open a new Pull Request for re-reviews. You should use the same Pull Request submitted for the first review, either valid or invalid unless it is requested otherwise.
As described in the Code reviews limits policy you have a limited number of reviews per project (check the exact number in your Dashboard). If you think that the code review was not fair, you can request a second opinion using this form.
spec/features/user_show_spec.rb
Outdated
it 'When I click to see all posts, it redirects me to the user posts index page.' do | ||
visit user_posts_path(@user1) | ||
expect(page).to have_current_path(user_posts_path(@user1)) | ||
end |
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.
-
This test does not verify what is expected. You are visiting the post index page on line 70 and on line 71 you are expecting that the path is the index page path. That is redundant, don't you think so?
You need to CLICK the "See all posts" button and ensure it redirects to the user's post index page. Take note of the click and redirect requirement
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.
Hi @cosywasswa ,
Approved 🟢 🟢
Your project is complete! There is nothing else to say other than... it's time to merge it
Congratulations! 🎉
Highlights
- All tests are passing💯
- Covers all required test cases👍
- fixed n+1 problems🟢 👍
Optional suggestions
Every comment with the [OPTIONAL] prefix won't stop the approval of this PR. However, I strongly recommend you to take them into account as they can make your code better. Some of them were simply missed by the previous reviewer and addressing them will really improve your application.
Cheers and Happy coding!👏👏👏
Feel free to leave any questions or comments in the PR thread if something is not 100% clear.
Please, remember to tag me in your question so I can receive the notification.
As described in the Code reviews limits policy you have a limited number of reviews per project (check the exact number in your Dashboard). If you think that the code review was not fair, you can request a second opinion using this form.
👇 In this milestone, we implemented the following.
Note: attached are N+1 screenshots.