Created
October 13, 2021 13:59
-
-
Save norman/8904e48cd4d2dd1b71f070202dbddc76 to your computer and use it in GitHub Desktop.
Test the validity of your Rails fixtures
This file contains hidden or 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
# frozen_string_literal: true | |
require "rails_helper" | |
describe "Fixtures" do | |
fixture_table_names.each do |table_name| | |
model_class = table_name.singularize.classify.constantize | |
it "has valid #{table_name}" do | |
expect(model_class.all).to all be_valid | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment