DEV Community

Cover image for Today I learned - more about rspec.
Juan Vasquez
Juan Vasquez

Posted on • Edited on

1

Today I learned - more about rspec.

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
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode
# instance methods

current_user.send_welcome_notification

description "#send_welcome_notification"
end
Enter fullscreen mode Exit fullscreen mode

I hope this will be helpful, see you tomorrow!

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more