Created
January 15, 2013 18:32
-
-
Save timwingfield/4540824 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extend 'the.models.OurModel', class OurModel extends Backbone.Model | |
url: -> | |
"#{relativeUrlRoot}/some_controller/some_action#{@get 'channel_type'}_data/#{@get 'end_point_id'}" | |
parse: (response) -> | |
response.id = "#{response.end_point_id}_#{response.channel_type}" | |
response |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xdescribe "#parse", -> | |
#how to set this up correctly?? | |
Given -> @json = | |
end_point_id: 44 | |
channel_type: 'spongebob' | |
Given -> @model = new the.models.OurModel | |
Given -> spyOn(@model, 'fetch').andReturn(@json) | |
When -> @model.fetch() | |
Then -> expect(@model.get 'channel_type').toEqual('spongebob') | |
Then -> expect(@model.get 'id').toEqual('44_spongebob') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment