User factory failing on Terms of Services
I'm working on a system spec that is failing with the error
1) ExistingUserLogins existing user login and see their dashboard
Failure/Error: @user = FactoryBot.create(:user)
ActiveRecord::RecordInvalid:
Validation failed: Terms of service can't be blank
My users factory is:
require 'faker'
FactoryBot.define do
factory :user, class: 'User' do
email { Faker::Internet.email }
password { "password" }
name { Faker::Movies::Lebowski.character }
accepted_terms_at { Time.current }
accepted_privacy_at { Time.current }
time_zone { "America/Chicago" }
end
endMy system spec is pretty basic too
require 'rails_helper'
RSpec.describe "ExistingUserLogins", type: :system do
before do
driven_by(:rack_test)
@user = FactoryBot.create(:user)
end
scenario "existing user login and see their dashboard" do
login_as(@user)
visit "/"
expect(page).to have_content "dashboard"
end
endWhat am I doing wrong? Any pointers appreciated :)
Notifications
You’re not receiving notifications from this thread.