Displaying 1 result from an estimated 1 matches for "be_persist".
Did you mean:
req_persist
2012 Nov 12
7
RSpec: controller POST create
...te part.
I have generated scaffold, and simultaneously it generated
controller_spec.rb as well.
it "assigns a newly created plan as @plan" do
post :create, {:plan => valid_attributes}, valid_session
assigns(:plan).should be_a(Plan)
assigns(:plan).should be_persisted
end
is the default POST create test. It raises a failure, if I changed the
validations of Plan
class Plan < ActiveRecord::Base
validates :give_take, :presence => true
validates :flight_name_id, :presence => true
validates :day_departure, :presence => tru...