Last active
December 25, 2015 15:19
-
-
Save psylone/6997215 to your computer and use it in GitHub Desktop.
RSpec Unit test template.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# RSpec Unit Template | |
describe Model do | |
# Factories | |
describe "has facttories" do | |
it "model factory" do | |
end | |
it "another model factory" do | |
end | |
end | |
# Validations | |
describe "has validations" do | |
context "for field" do | |
it "should present" do | |
end | |
it "should be numericality" do | |
end | |
end | |
context "for another field" do | |
it "should be uniq" do | |
end | |
end | |
end | |
# Callbacks | |
describe "has callbacks" do | |
describe "callback type" do | |
context "#set_initial_value" do | |
it "do something" do | |
end | |
it "do something else" do | |
end | |
end | |
end | |
end | |
# Class methods | |
describe "has class methods" do | |
context ".class_method" do | |
it "return result" do | |
end | |
end | |
context ".another_class_method" do | |
it "return another result" do | |
end | |
end | |
end | |
# Instance methods | |
describe "has instance methods" do | |
context "#instance_method" do | |
it "return result" do | |
end | |
it "return another result" do | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment