codecombat/codecombat — pull request #1137 by rubenvereecken (2014-06-09 11:18:55+00:00)
Title: Fixed all server-sided tests, with server-test TODO

I wanted to start on some server-sided achievement tests but soon ran into trouble. I fixed three scenarios, the third one of which is the gravest and needs a follow-up.

- First of all I had to resolve yet another mutual inclusion case between Achievements and Users. This took quite some time but I luckily managed since this prevented any tests from running.
- Secondly, scotterickson.info is down but some tests in `file.spec.coffee` needed a working URL. It didn't only fail the tests but instead crashed the whole suite. I substituted a tiny Pikachu gif but left the old link in comments, in case the merger would like to update this URL.
- Last of all, and most annoyingly, Mongo text search broke our Level Component and System schemas. `language` has become a reserved Mongo field while we use it to denote programming language. As a _temporary_ fix I un-required the field in the schemas and removed the field from all tests. All instances involved can be found with `grep -r "TODO server-test [app|server]".

For reference, here's an example Mongo error that helped me find the cause.

`{ name : 'MongoError', code : 17262, err : 'insertDocument :: caused by :: 17262 language override unsupported: javascript' }`

I also tried using Mongo's `language_override` field so it would ignore `language` but it didn't.

All 146 tests now run successfully but we still need to rename the `language` field in components and systems I'm afraid.