Added test for model.changedAttributes()

Fixes #2505