Displaying 1 result from an estimated 1 matches for "flight_name_id".
2012 Nov 12
7
RSpec: controller POST create
...ession
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 => true
validates :weight, :presence => true
end
The failure message is
1) PlansController POST create with valid params assigns a newly
created plan as @plan
Failure/Error: assigns(:plan).should be_persisted...