DEV Community

hmza
hmza

Posted on

πŸ§ͺ Part 8 β€” Testing in Rails: Built-in and Battle-Tested

πŸ§ͺ Part 8 β€” Testing in Rails: Built-in and Battle-Tested

RSpec model test example:


RSpec.describe Post, type: :model do  
  it "is valid with a title" do  
    post = Post.new(title: "Hello")  
    expect(post).to be_valid  
  end  
end  

Enter fullscreen mode Exit fullscreen mode

Controller and integration tests are also built-in.

Top comments (0)