0
brief.rbRSpec проверки с, если
# encoding: utf-8
class Brief < ActiveRecord::Base
belongs_to :project
validates_numericality_of :duration, :only_integer => true, :less_than_or_equal_to => 15, :greater_than_or_equal_to => 5, :unless => Proc.new{ |b| b.project.project_type.express_project }
end
brief_spec.rb
require 'spec_helper'
describe Brief do
before(:all) do
@project =Factory(:project)
@brief=Factory.build(:brief,:project => @project)
end
context 'non-specific tests' do
subject { @brief }
it { should belong_to(:project) }
it { should validate_presence_of(:project}
end
end
Это не моя краткая модель и краткая спецификация file.But Я не понять, как можно Я тестирую validates_numericality_of , если part.Can кто-нибудь попробовал это раньше?