ruby on rails - Error in running RSpec. 2.13.1 -


i have written spec file update function of 1 controller. using ruby-1.9.3 p194, rails 3.2.13 , rspec 2.13.1 , data mapper version ~> 1.2.0'. calling update function in spec follows:

put :update, :id=>@xyz.id, :xyz=> {key1:val1, key2:val2} 

in update function of xyz controller have accessed id follows:

def update  params[:xyz][:id] = params[:id]  #this line working fine , params[:id] not nil  params = params[:xyz]  id = params[:id]                end 

problem while running same file without change twice @ time, giving 2 different errors. once giving following error:

/home/joy/.rvm/gems/ruby-1.9.3-p194@packagename/gems/dm-core-1.2.0/lib/dm-             core/collection.rb:1302: in resource undefined method 'saved?' nil:nilclass  (nomethoderror)  .... 

next time, while running, giving following error:

nomethoderror:   undefined_method 'id' "57":string" # ./app/controllers/xyz_controller.rb : in line number 3 of update setting id giving error. 

is case ruby version or rspec or data-mapper version using unstable or there other problem not figure out. please help.


Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -