Skip to content

Instantly share code, notes, and snippets.

View raine's full-sized avatar

Raine Virta raine

View GitHub Profile
@raine
raine / app.js
Last active October 10, 2018 11:59
Define socket.io once and use it in any view I want?
// Setup basic express server
var express = require('express');
var app = express();
// Spool up server
var server = app.listen(app.get('port'), function() {
console.log('App listening on port %d', app.get('port'));
});
// Import socket_api
require 'spec_helper'
describe User do
it "should create a new user given a username" do
User.create!(:username => "rmcenroe")
end
it "should not create a new user given a bad username" do
bad_user = User.new(:username => "not_real")
bad_user.should_not be_valid