Today is 04-01-2021
I was writing a callback test in RoR with RSpec.
When I noticed that I forgot the standard how should I write the description
for after_create
and this is the answer.
describe "#after_create"
end
The convention for class methods
says, they should be writing prefixed with .
.
The convention for instance methods
says, they should be writing prefixed with #
.
Example.
# class methods
User.actives
description ".actives"
end
# instance methods
current_user.send_welcome_notification
description "#send_welcome_notification"
end
I hope this will be helpful, see you tomorrow!
Top comments (0)