[rspec-users] specin' update_attributes! + Hash

CNNN NICK lists at ruby-forum.com
Mon Jan 21 09:23:07 EST 2008


I am facing a problem while trying to test a method that updates an
attribute. The attribute format should be converted to YAML format
before storing in the table which is excatly what is going on. But when
testing it using expectations in rspec it returns an error.

*** below is the error message :
Spec::Mocks::MockExpectationError in 'InteractController (submit) -
saving a form to use later should update costumer details using the form
Mock 'Instance_1039' expected :update_attributes with
({:customer_details=>"--- !map:HashWithIndifferentAccess \\ntitle:
Hola\\n"}) but received it with ({:customer_details=>"---
!map:HashWithIndifferentAccess \ntitle: Hola\n"})

*** here's how i am testing it:
'---  map:HashWithIndifferentAccess \ntitle: Hola\n')
post :submit, { :id => '7770' , :perform => 'Save this form', :form => {
:title => 'Hola' } }

Any tips pls?
Posted via http://www.ruby-forum.com/.

More information about the rspec-users mailing list