Please refer to https://github.com/SupportBee/Backbone.js-Identity-Map/blob/master/public/javascripts/backbone_cached_model.js
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
SB.Models.Ticket = Backbone.Model.extend({ | |
name: "ticket", | |
keepInSync: true, | |
initialize: function(){ | |
} | |
}) |
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
Add the following code block with the correct options to embed SupportBee in any website | |
<script src="http://sbassets.s3.amazonaws.com/widget/script.js" type="text/javascript"></script> | |
<script> | |
var sb_form = SupportBee.Form.initialize({ | |
company: 'techfolder', | |
height: '400px', | |
base_domain: 'supportbee.com', | |
position: 'bottom' | |
}); |
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
Add the following code block with the correct options to embed SupportBee in any website | |
<script src="http://sbassets.s3.amazonaws.com/widget/script.js" type="text/javascript"></script> | |
<script> | |
var sb_form = SupportBee.Form.initialize({ | |
company: 'techfolder', | |
height: '400px', | |
position: 'bottom' | |
}); | |
</script> |
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
<a data-controls-modal='sb-overlay'>Contact Us</a> |
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
.bundle | |
solr/data | |
db/*.qlite3 | |
log/*.log | |
tmp/**/* | |
config/database.yml | |
tmp/* | |
public/javascripts/backbone/**/**/*.js | |
public/javascripts/backbone/*.js | |
public/javascripts/backbone/collections/ |
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
config.use_transactional_fixtures = false | |
config.before(:suite) do | |
DatabaseCleaner.strategy = :deletion | |
DatabaseCleaner.clean_with(:truncation) | |
end | |
config.before(:each) do | |
DatabaseCleaner.start | |
end |
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
@server = sinon.fakeServer.create() | |
response = "{tickets: [{id: 1, title: 'Ticket 1'}, {id: 2, title: 'Ticket 2'}]}" | |
@server.respondWith "GET", "/tickets", [ 200, "Content-Type": "application/json", 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
archiveMock = sinon.mock(SB.Models) | |
archive = save: -> | |
archiveMock.expects("Archive").once().returns archive | |
saveMock = sinon.mock(archive) | |
saveMock.expects("save").once() | |
# Call Archive on ticket | |
ticket.archive() |
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
BackboneFactory.define_sequence "ticket_title", (n) -> | |
"Ticket " + n | |
ticketAttr = -> | |
subject: BackboneFactory.next("ticket_title") | |
cc: [ BackboneFactory.create("user").toJSON().user, BackboneFactory.create("user").toJSON().user ] | |
summary: "summary" | |
unanswered: true | |
requester: BackboneFactory.create("user").toJSON().user | |
current_assignee: BackboneFactory.create("user").toJSON() |