Monday, 26 August 2013

How to write rspec testing without database in ruby for this ruby code

How to write rspec testing without database in ruby for this ruby code

I am creating a ruby project with the class which is the inheritance of
ActiveRecord::Base. How can i write rspec testing and simple coverage for
the following code sample without using database.
class Person < ActiveRecord::Base
validates_length_of :name, within: 10..40
end
person = Person.create(:name => "aungaung")
person.save

No comments:

Post a Comment