Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ GEM
racc (~> 1.4)
nokogiri (1.13.7-x64-mingw-ucrt)
racc (~> 1.4)
nokogiri (1.13.7-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.13.7-x86_64-linux)
racc (~> 1.4)
parallel (1.22.1)
Expand Down Expand Up @@ -260,6 +262,7 @@ GEM
PLATFORMS
arm64-darwin-21
x64-mingw-ucrt
x86_64-darwin-21
x86_64-linux

DEPENDENCIES
Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,12 @@ This project is build with:
- Twitter: [@Evans_22J](https://twitter.com/Evans_22J)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • It would be better if we write test for the Users Index page to test for Tests that redirects to the user's show page when you click on a user.

Note:

I find it strange that there is no file change for a project you are suppose to work on ie. Integration specs for view and only see a file change for a README, this could be the reason why the other code reviewer invalidated your project

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @addod19 ,
The previous reviewer just commented about the wrong pull request. Thank you for your concern.

- LinkedIn: [@Evans Sitibekiso](https://www.linkedin.com/in/evans-sitibekiso/)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • It would be better if we write the redirect test for our User Show page as shown in the screenshot below

Screenshot from 2022-08-04 17-00-27

👤 **Edward Odhiambo**

- GitHub: [@whit3d](https://github.com/white3d)
- Twitter: [@odhiambo_ed](https://twitter.com/odhiambo_ed)
- LinkedIn: [Edward Odhiambo](https://www.linkedin.com/in/edward-odhiambo-6a462a21b/)

## 🤝 Contributor

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • It would be better if we write featured test for our User post index page as show in the screenshot below

Screenshot from 2022-08-04 17-03-40

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @addod19 ,
I have include all the test state in the picture above. See this please code


Expand All @@ -192,4 +198,4 @@ Give a ⭐️ if you like this project!

## 📝 License
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • It would be better if we implement test for User post show page as show in the screenshot below

Screenshot from 2022-08-04 17-05-45

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @addod19 ,
I have include all the test state in the picture above. See this please code


This project is [MIT](https://github.com/microverseinc/readme-template/blob/master/MIT.md) licensed.
This project is [MIT](https://github.com/microverseinc/readme-template/blob/master/MIT.md) licensed
7 changes: 7 additions & 0 deletions spec/integration/user_index_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,12 @@
expect(page).to have_content('3')
expect(page).to have_content('5')
end

it 'redirects to users show page' do
visit root_path
click_link @first_user.name
expect(page).to have_content(@first_user.name)
expect(page).to have_content(@first_user.bio)
end
end
end
13 changes: 13 additions & 0 deletions spec/integration/user_show_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,18 @@
it 'should have button to show all posts' do
expect(page).to have_link('See all posts')
end

it "redirects me to that post's show page." do
first('.post > a').click
expect(page).to have_content('Add a new comment')
find_button('like post')
expect(page).to have_content('Comments: 0 Likes: 0')
end

it 'redirects me to the user post index page' do
click_button('See all posts')
expect(page).to have_content(@user.bio)
expect(page).to have_content("Number of posts: #{@user.posts_counter}")
end
end
end