prose/prose — pull request #798 by dereklieu (2014-12-11 19:15:31+00:00)
Title: Tests for metadata name collision, textarea saving

I've written an initial set of tests for `/app/views/metadata.js`. Some notes on this file:

To facilitate testing, I created a fake model that mocks `/app/models/file.js`, and a fake view that mocks `/app/views/file.js`. These are both dependencies that I don't want to include directly.

I'm using jQuery to trigger change events. Before each test, I append a `

` to the tail end of the test page and set this as the view's `el` property. This `div` gets removed after each test runs.

This is not an exhaustive test file, but currently two of them are failing. One shows that you can break the view by including a meta element which forces a name collision on `this`. The other shows that textarea changes aren't being saved to the model. If we're able to merge, I can start to work on getting these tests to pass.

Would love feedback!