Skip to content
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

Refactor RSpec Controller Specs to Request Specs #1815

Closed
24 of 25 tasks
bennpham opened this issue Aug 24, 2020 · 4 comments
Closed
24 of 25 tasks

Refactor RSpec Controller Specs to Request Specs #1815

bennpham opened this issue Aug 24, 2020 · 4 comments

Comments

@bennpham
Copy link
Member

bennpham commented Aug 24, 2020

Description

Looking through the project, I notice that we use controller specs rather than request specs. Since we're on Rails 6 and reading through this Stackoverflow discussion in regards to controller specs vs request specs, it seems that controller specs are obsolete now.

Some pros and cons listed in this medium article mentions that controller specs methods such as assigns and assert_template are deprecated now as well and request spec is what is recommended by Rspec and test the entire stack. Request spec since Rails 5 are now faster as well.

Refactoring all the controller specs would be a large PR on its own though.

Request spec documentation on RelishApp: https://relishapp.com/rspec/rspec-rails/v/4-0/docs/request-specs/request-spec



Please assign yourself (via the Assignees dropdown), if you do want to work on this issue. Can't find yourself? You need to join our organization.

Check out our Picking Up Issues guide if you haven't already!

@welcome
Copy link

welcome bot commented Aug 24, 2020

Thank you for opening this issue with us! If you haven't already, please follow these next steps to officially join our contributor community.

@bennpham bennpham added refactoring ruby Pull requests that update Ruby code tests ruby on rails and removed ruby Pull requests that update Ruby code labels Aug 24, 2020
@julianguyen
Copy link
Member

Hey @bennpham, thanks for calling this out! I think we should go ahead with your suggestion and look into refactoring to request specs! I recommend creating issues for all the different files so people can easily assign them to themselves.

@bennpham
Copy link
Member Author

@julianguyen Sounds good. Should I make a handful of issues for each file and link it to this issue or rename this issue into one of the file and copy the description for each separate new issue?

@julianguyen
Copy link
Member

Yeah I think you can just link it to this main issue to save time! Thanks!

This was referenced Aug 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants