RubyFlow The Ruby and Rails community linklog

×

The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

Factories that makes JSON

Sometimes, it gets quite annoying while you are testing your API, that accepts JSON. Often the solution in this is to keep JSON data in fixtures and then parse that and provide to endpoint. Maintaining then becomes quite a pain, especial if you have to support complex JSON data types and introduce changes with time. Here is solution:

Utilize power of FactoryGirl while dealing with JSON data. Say hello to FactoryJson

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in