diff --git a/db/migrate/0000_create_schema.rb b/db/migrate/0000_create_schema.rb index b9437c0..8860203 100644 --- a/db/migrate/0000_create_schema.rb +++ b/db/migrate/0000_create_schema.rb @@ -92,7 +92,7 @@ class CreateSchema < ActiveRecord::Migration[5.2] end create_table :scores do |t| - t.integer :score, null: false + t.integer :score, default: 0 t.belongs_to :match, index: true, null: false, foreign_key: { on_delete: :cascade } t.belongs_to :team, index: true, null: false, foreign_key: { on_delete: :cascade } diff --git a/spec/models/score_spec.rb b/spec/models/score_spec.rb index 06ff6f0..4d68364 100644 --- a/spec/models/score_spec.rb +++ b/spec/models/score_spec.rb @@ -3,10 +3,6 @@ require 'rails_helper' RSpec.describe Score, type: :model do - describe 'validation' do - it { should validate_presence_of :score } - end - describe 'association' do it { should belong_to :match } it { should belong_to :team }