Object.save failed in spec data validation
问题 Here is the failed spec code for create in customer controller: describe CustomersController do before(:each) do #the following recognizes that there is a before filter without execution of it. controller.should_receive(:require_signin) controller.should_receive(:require_employee) end render_views describe "'create' successful" do before(:each) do category = Factory(:category) sales = Factory(:user) @customer = Factory.attributes_for(:customer, :category1_id => category.id, :sales_id => sales