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.
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.