我正在使用以下验证
"validates_presense_of :column,:on => :update“
rspec是否提供了辅助工具来测试以上内容?
发布于 2013-04-05 01:40:11
找到了这个,这正是我想要的
http://remarkable.rubyforge.org/activerecord/classes/Remarkable/ActiveRecord/Matchers.html
发布于 2013-04-04 23:24:06
也许:
describe ThingsController, "#update" do
context "for a thing" do
before do
get :update, :id => 1
end
it { should validate_presence_of :your_column_name }
end
end
https://stackoverflow.com/questions/15813874
复制相似问题