Skip to content

Check model validity #119

@choosen

Description

@choosen

Content below exists in guide from the initial version

Add an example ensuring that the model created with FactoryBot.create is valid.

describe Article do
  it 'is valid with valid attributes' do
    expect(article).to be_valid
  end
end

I would not add additional code to spec factory validity if factory bot is delivering that one (also with traits: true)
see: https://github.com/thoughtbot/factory_bot/blob/master/GETTING_STARTED.md#linting-factories

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions