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

Ruby on Rails testing lessons #214

Open
linkonsat opened this issue Aug 2, 2022 · 5 comments
Open

Ruby on Rails testing lessons #214

linkonsat opened this issue Aug 2, 2022 · 5 comments
Labels

Comments

@linkonsat
Copy link
Contributor

linkonsat commented Aug 2, 2022

Title Author Date
ROR TESTING mmincorporated today

IDEA NAME

Summary

Currently, the Rails section of the Ruby on Rails path does not have any testing content. The goal of this issue is to outline a structure and provide a single issue to discuss and keep track of ideas surrounding it.

Motivation

Testing is important both when applying and on the job. Having this knowledge will empower learners.

Suggested implementation

Testing lessons will consist of two parts. Standalone lessons that cover important aspects of testing and then additions to current lessons that briefly cover testing for that aspect of Rails. If a topic has a ? then this means it's still an idea and not an active item yet.

Standalone lessons

  • System testing.
  • Unit testing.
  • TDD in a Rails context? I.e. a refresher and what to prioritize when testing?
  • Other testing topics: Integration testing, Functional testing ?
  • Small TDD project for testing section?
    **Additional content **
  • Request specs (API lesson)
  • Mailers (Mailer lesson)
  • Controllers testing (Controller lesson)
  • Action cable testing( Action cable lesson)
  • Stimulus controller testing? (stimulus controller section)

Drawbacks

N/A

Alternatives

N/A

Additional

This can be any unanswered questions, things that still need to considered or solved about the implementation, any reference links to the initial ideation such as a Discourse Forum, discussions or anything else.

@ChargrilledChook
Copy link
Member

ChargrilledChook commented Aug 2, 2022

I think the MVP for a testing section should cover unit / model specs and system specs.

All the other things would be great additions, but would be relatively easy to add on later in a modular way

@KevinMulhern
Copy link
Member

Great write up @linkonsat, thanks for putting this together.

I agree with @ChargrilledChook, system testing and model unit tests would be the MVP. Jason Swett's types of tests article 100% aligns with all the testing experience I've had at various Rails jobs. It boils down to lots of unit tests, some system tests and rarely anything else.

The only things I'd add to the list are

  • Factory bot - could be rolled into the model testing lesson
  • VCR - as part of a api testing lesson (this lesson would also cover integration testing)

The only things I'd remove from the list are

  • Controller testing - these were depreciated by the Rails team during the Rails 5(?) release.
  • Stimulus testing - Theres no accepted best practice Rails ™️ way for testing stimulus controllers that I'm aware of. I've seen it done with Jest before but that may be out of scope of the Rails course. I usually have system tests that provide test coverage for stimulus behaviour.

@linkonsat
Copy link
Contributor Author

@KevinMulhern pretty much agree with all your points. For the stimulus controller would it be worth letting users know that there isn't a best way and that it can be rolled into system test then? Just so if a learner is asked that or something they are just aware of it.

@JuanVqz
Copy link

JuanVqz commented Oct 27, 2022

@KevinMulhern Request testing is the replacement for Controller testing, so, we can add them.

What do we want here?

  • adding a section on the existing pages talking about tests or it will be one section in the ruby-on-rails path talking about tests types

@KevinMulhern
Copy link
Member

@JuanVqz yeah thats a good point. We're planning on covering request specs in an API testing lesson: TheOdinProject/curriculum#24492 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants