mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-26 09:42:46 +08:00
Fix tests
This commit is contained in:
parent
e934e08c17
commit
eca0c84bbd
3 changed files with 5 additions and 3 deletions
|
@ -80,7 +80,7 @@ class RepositoryCell < ApplicationRecord
|
|||
private
|
||||
|
||||
def repository_column_data_type
|
||||
if !repository_column || value_type != repository_column.data_type
|
||||
if !repository_column || value.class.name != repository_column.data_type
|
||||
errors.add(:value_type, 'must match column data type')
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
FactoryBot.define do
|
||||
factory :repository_date_time_value do
|
||||
factory :repository_date_time_value_base do
|
||||
created_by { create :user }
|
||||
last_modified_by { created_by }
|
||||
data { Time.zone.now }
|
||||
end
|
||||
|
||||
factory :repository_date_time_value, parent: :repository_date_time_value_base, class: 'RepositoryDateTimeValue' do
|
||||
after(:build) do |value|
|
||||
value.repository_cell ||= build(:repository_cell, :date_time_value, repository_date_time_value: value)
|
||||
end
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
require 'rails_helper'
|
||||
|
||||
describe RepositoryDateTimeValue, type: :model do
|
||||
let(:repository_date_time_value) { create :repository_date_time_value }
|
||||
let(:repository_date_time_value) { build :repository_date_time_value }
|
||||
|
||||
it 'is valid' do
|
||||
expect(repository_date_time_value).to be_valid
|
||||
|
|
Loading…
Reference in a new issue