Merge pull request #1675 from edx/christina/tab-new

Convert tabs to use RESTful API
This commit is contained in:
Christina Roberts
2013-11-21 07:39:31 -08:00
11 changed files with 272 additions and 164 deletions

View File

@@ -0,0 +1,14 @@
/**
* A model that simply allows the update URL to be passed
* in as an argument.
*/
define(["backbone"], function(Backbone){
return Backbone.Model.extend({
defaults: {
"explicit_url": ""
},
url: function() {
return this.get("explicit_url");
}
});
});

View File

@@ -0,0 +1,12 @@
define(['js/models/explicit_url'],
function (Model) {
describe('Model ', function () {
it('allows url to be passed in constructor', function () {
expect(new Model({'explicit_url': '/fancy/url'}).url()).toBe('/fancy/url');
});
it('returns empty string if url not set', function () {
expect(new Model().url()).toBe('');
});
});
}
);