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

Describe more use cases of 'subject' in RSpec #128

Open
holywyvern opened this issue Jul 4, 2018 · 0 comments
Open

Describe more use cases of 'subject' in RSpec #128

holywyvern opened this issue Jul 4, 2018 · 0 comments

Comments

@holywyvern
Copy link

In the Slack channel of #ruby-rails-basics we were discussing about the use case of subject in RSpec tests.

In the tech guide about subject, it recommends using it when you are creating an instance of the described class.

As some people check out, they also recommend to use subject when describing an element we are currently testing witch makes sense.

To be more clear, when a controller is being tested, and we make a request, our subject should be request instead of an instance of the controller.

It probably is a really basic thing to clarify, but it may be helpful to specify that to avoid confusion.

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

No branches or pull requests

1 participant