Quantcast
Viewing all articles
Browse latest Browse all 3491

Should fixtures only ever be used for development and unit tests?

JMVC 3.2.4

Hello there,

Would I be right in saying that JMVC model fixtures should only ever be used for development and unit tests and not in production? I've come across some production code that uses the "fixture" method on a $.ajax() method inside a model to fake an HTTP response, effectively returning static data. This works fine but I have my doubts that this is proper use of $.fixture. For example if I was to create fixtures for all my models (ideal scenario) using:

fixtures/fixtures.js
  1. $.fixture('someurl', function() { ...
Then I can share my fixtures between unit tests and application code (for when I'm developing to preview the application). But I've found that if if the $.ajax().fixture() method has been used and I turn $.fixtures.on = false, the existing fixtures fail.

Does that make sense?

Viewing all articles
Browse latest Browse all 3491

Trending Articles