ruby on rails - rspec testing a controller post changing my params from symbols to strings and breaking my tests -
In my controller device, I am doing this:
make this a new message " "Client. Should_receive (: create) .with ({: title = & gt; 'Mr.'}) Post 'Create', Client = & gt; {: Title = & gt; "Mr."} end
... and in my controller I am ...
def client = client .create (params [client] ]
Although this failed with the following error message:
Expected: ({title = & gt; "Mr."}) found: ({"Title" = & gt; "Mr."})
I am wondering why this is happening and how it works
That's because you are not going to a mark and it's not a string to fix it. Ran needs to:
this should "create a new message" client. Should_receive (create) .with ({: title = & gt; 'Shree'}) 'create' post, client = & gt; {"Title" = & gt; "Mr."} End
Here is a blog post: ""
Comments
Post a Comment