problem with specing controller and using blueprints attributes

11 views
Skip to first unread message

ssmithstone

unread,
Feb 2, 2010, 7:12:50 AM2/2/10
to Machinist Users
Im trying to spec a controller using a blueprint as the params however
its not going to plan


Client.blueprint do


title { Forgery:Name:title}

end

now in the spec im doing

it "should ...." do
client = Client.plan
Client.should_receive(:create).with(client)
post 'create' , :client => client
end

now this is failing

with
expected: ({:title=>"Mr"})
got: ({"title"=>"Mr"})

is there any way to get machinist to generate the attribute as
strings ?

or get rspec to pass the params as symbols

cheers

Pete Yandell

unread,
Feb 2, 2010, 7:44:10 PM2/2/10
to machini...@googlegroups.com
There's nothing built into Machinist to do this. Feel free to submit a
patch, if it doesn't break anything.

Otherwise you could just write a little helper to do the conversion.

- Pete

J2M

unread,
Feb 2, 2010, 8:46:18 PM2/2/10
to Machinist Users
There is always #stringify_keys in ActiveSupport.
Reply all
Reply to author
Forward
0 new messages