Fix failing tests (sorry)

pull/260/head
Rick Carlino 2016-08-12 17:33:25 -05:00
parent a6f92384bd
commit 573ec9e961
2 changed files with 7 additions and 5 deletions

View File

@ -1,12 +1,14 @@
class Regimen
include Mongoid::Document
field :color, type: String, default: -> { Sequence::COLORS.sample }
field :name
has_many :regimen_items
has_many :regimen_items
belongs_to :device, dependent: :destroy
validates_uniqueness_of :name, scope: :device_id
validates_presence_of :next_time
validates_inclusion_of :color, in: Sequence::COLORS
validates_presence_of :name
validates_uniqueness_of :name, scope: :device_id
validates_inclusion_of :color, in: Sequence::COLORS
end

View File

@ -1,6 +1,6 @@
FactoryGirl.define do
factory :regimen, :class => 'Regimen' do
name { Faker::Pokemon.name + Faker::Pokemon.name}
end
end