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
Class Specialists::UsersController < ApplicationController | |
def new | |
@user = User.new | |
end | |
def create | |
@user = User.new(params[:user]) | |
if @user.save_without_session_maintenance | |
flash[:success] = 'Successfully created user!' | |
redirect_to specialists_user_path(@new_user) |
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
Counting objects: 35, done. | |
Delta compression using up to 4 threads. | |
Compressing objects: 100% (19/19), done. | |
Writing objects: 100% (19/19), 2.00 KiB, done. | |
Total 19 (delta 14), reused 0 (delta 0) | |
remote: /home/git/git-campfire-hook/lib/notification.rb:69:in `ref_name_type': undefined method `match' for nil:NilClass (NoMethodError) | |
remote: from /home/git/git-campfire-hook/lib/notification.rb:22:in `initialize' | |
remote: from /home/git/git-campfire-hook/lib/hook.rb:25:in `new' | |
remote: from /home/git/git-campfire-hook/lib/hook.rb:25 | |
remote: ARG0: "b93763b65059486fe2763f7420a86bdf91f39e4e" |
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
module EmailLinkHelper | |
CHECK_YOUR_EMAIL = "<h6>Check your email. Your account link will arrive shortly</h6>" | |
EMAIL_PROVIDERS = { | |
'gmail.com' => 'http://gmail.com' | |
} | |
def email_link(email) | |
domain = email.split('@').last | |
EMAIL_PROVIDERS[domain].nil? ? CHECK_YOUR_EMAIL : EMAIL_PROVIDERS[domain] | |
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
table { | |
border:1px solid #999; | |
border-collapse:collapse; | |
} | |
table th, | |
table td { | |
padding:5px; | |
vertical-align:top; | |
border:1px solid #999; | |
} |
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
require('../lib/texting_buds'); | |
require('../lib/store'); | |
require('../lib/sender'); | |
describe('TextingBuds', function() { | |
var textingBuds, sender, store, number, stubbedQuery; | |
beforeEach(function() { | |
sender = new Sender({}); | |
store = new Store({}); |
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
App = function(sender, store) { | |
return: { | |
... | |
next: function(person) { | |
store.getBuddiesWaiting(function(buddies) { | |
if(buddies.length === 0) { | |
store.addBuddyWaiting(person, function() { | |
sender.emptyQueueSms(person); | |
}); | |
} |
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
require('../lib/sender'); | |
describe('Sender', function() { | |
var sender, client, number; | |
beforeEach(function() { | |
number = '805-769-8255'; | |
client = {sendSms: jasmine.createSpy()}; | |
sender = new Sender(client); | |
spyOn(sender, 'send').andCallThrough(); |
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
Sender = function(client) { | |
return { | |
send: function(number, message) { | |
client.sendSms(number, message, null, function(){}); | |
}, | |
emptyQueueSms: function(number) { | |
this.send(number, this.messages.emptyQueue); | |
}, | |
messages: { | |
emptyQueue: 'the empty queue message' |
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
require('../lib/store.js'); | |
describe('Store', function() { | |
var store, results, buddy, callback; | |
beforeEach(function() { | |
callback = jasmine.createSpy('callback'); | |
results = 'fake results'; | |
buddy = '805-769-8255'; | |
store = new Store({}); |
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
Store = function(client) { | |
return { | |
run: function(method, params, callback) { | |
var modifiedCallback = function(error, result) { | |
callback(result); | |
}; | |
params.push(modifiedCallback); | |
client[method].apply(client, params); | |
}, | |
addBuddyWaiting: function(buddy, callback) { |