I'm running a proof of concept test to see if I can get Fabrication linked to my js. The problem is `Fabricate` calls in the following test.js.erb file are returning the same values. First, why would they always be the same? and second, how can I change the (is is caching?) behavior to return a proper sample? Note that the value doesn't change even if I edit the test.js.erb file, restart the rails server... I've tried lots of things. Thanks.
In a test.js.erb file I have the following:
test = [
<%= Fabricate.attributes_for(:item).to_json.gsub('\\','') + ',' %>
<%= Fabricate.attributes_for(:item).to_json.gsub('\\','') + ',' %>
<%= Fabricate.attributes_for(:item).to_json.gsub('\\','') %>
]
Which when served to `localhost:3000/assests/app/test.js` returns:
test = [
{"name":"seven"}
{"name":"seven"}
{"name":"seven"}
]
The `item` Fabricator is:
Fabricator(:item) do
name %w(one two three four five six seven eight nine ten).sample
end