Ask for Help
“We’re using the json gem in production, but jasmine is requiring the json_pure gem for our tests. How can we run our rspec tests with the json gem (instead of json_pure) to better reproduce production?”
Nobody had a definitive answer, but one suggestion was to explicitly declare the json_pure gem in your gemfile with require: false.
Interesting Things
- Mysql will not let you insert a record with an id of 0 if you have auto-incrementing ids turned on. However, if you really need to create a record with an id of 0 in your tests, you can turn off the auto-incrementing id feature in a before suite block.
Update:
Here is the SQL command to turn off the auto incrementing feature in mysql:
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO'