I am try to build a json
using a factory, but when i try to build
it's empty.
Below is Factory
class.
require 'faker'
FactoryGirl.define do
factory :account do |f|
f.name {Faker::Name.name}
f.description {Faker::Name.description}
end
factory :accjson, class:Hash do
"@type" "accountResource"
"createdAt" "2014-08-07T14:31:58"
"createdBy" "2"
"disabled" "false"
end
end
Below is how i am trying to build.
hashed_response = FactoryGirl.build(:accjson)
expect(account.to_json).to eq(hashed_response.to_json);
But my hashed_response
always seems to be empty object
.