search for: test_params_exp

Displaying 1 result from an estimated 1 matches for "test_params_exp".

2008 Jul 17
2
problems with validation on STI
...d In my unit tests I can''t seem to get a valid object. Here''s my setup: def setup @s1 = simulations(:base) @rsc1 = resources(:rsc1) @d1 = RscDist.new @d1.simulation_id = @s1.id @d1.resource_id = @rsc1.id end and then the test: def test_params_exp @d1.desc = ''exponential'' assert !@d1.valid? @d1.param1 = 14 @d1.dist_name = ''dist1'' puts @d1.to_s assert @d1.valid? end The final line "assert @d1.valid?" fails, even though I have a :desc field that is properly spelled, a...