Skip to content

Instantly share code, notes, and snippets.

View unamashana's full-sized avatar

Hana Mohan unamashana

View GitHub Profile
SB.Models.Ticket = Backbone.Model.extend({
name: "ticket",
keepInSync: true,
initialize: function(){
}
})
@unamashana
unamashana / supportbee_form.html
Created December 7, 2011 14:43 — forked from avinasha/supportbee_form.html
Embed SupportBee Form
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'
});
@unamashana
unamashana / supportbee_form.html
Created December 7, 2011 14:44 — forked from avinasha/supportbee_form.html
Embed SupportBee Form
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>
<a data-controls-modal='sb-overlay'>Contact Us</a>
.bundle
solr/data
db/*.qlite3
log/*.log
tmp/**/*
config/database.yml
tmp/*
public/javascripts/backbone/**/**/*.js
public/javascripts/backbone/*.js
public/javascripts/backbone/collections/
@unamashana
unamashana / gist:1611606
Created January 14, 2012 14:10
Spec_helper.rb to get transaction callbacks going
config.use_transactional_fixtures = false
config.before(:suite) do
DatabaseCleaner.strategy = :deletion
DatabaseCleaner.clean_with(:truncation)
end
config.before(:each) do
DatabaseCleaner.start
end
@unamashana
unamashana / gist:1785907
Created February 10, 2012 02:58
Test Setup
@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 ]
@unamashana
unamashana / gist:1785947
Created February 10, 2012 03:07
Mocks to Test
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()
@unamashana
unamashana / gist:1786069
Created February 10, 2012 03:18
Ticket Factory
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()