Skip to content

Instantly share code, notes, and snippets.

var _ = require('underscore');
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
mongoose.connect('mongodb://localhost/zems');
var Schemata = {
player: new Schema({
name: String,
_ = require('underscore')
assert = require('assert')
sinon = require('sinon')
Game = require('../../game/game')
db = require('../../db')
module.exports =
"setMongoObject(),
require 'spec_helper'
describe Court do
context "in general" do
[:name, :timespace_end_date].each do |f|
it "has #{ f } column" do
subject.should have_column f
end
end
// Mixins and variables
@mixin clearfix {
&:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
AttributeNormalizer.configure do |config|
config.normalizers[:reject_duplicated] = lambda do |value, options|
value.uniq
end
end
BBE.controllers :events do
get :index, map: "/events" do
@event_occurrences = EventOccurrence.all
render "events/index"
end
get :show, map: "/events/:id" do
@event = EventOccurrence.find(params[:id])
raise Sinatra::NotFound unless @event
@booking = Booking.new(event_occurrence_id: @event.id)
Feature: Viewing client index
As a team member
I want to see client index
Scenario: No client accounts exist
Given I am logged in as team member
And no active client accounts exist
When I go to clients index page
Then I should see "No active client accounts exist right now." message
module Cucumber
module Web
module URLs
def url_for(*names)
Capybara.app.url_for(*names)
end
alias_method :url, :url_for
def absolute_url_for(*names)
"http://www.example.com" + Capybara.app.url_for(*names)
Compito.helpers do
def absolute_url_for(*names)
path = url_for(*names)
scheme = request.scheme
if (scheme == 'http' && request.port == 80 ||
scheme == 'https' && request.port == 443)
port = ""
else
port = ":#{request.port}"
end
Given 'account with "$email" email and password of "$password" exist' do |email, password|
Given "account with \"#{ email }\" email does not exist"
Account.create(:email => email, :password => password, :password_confirmation => password)
end
Given 'inactive account with "$email" email exist' do |email|
Given "account with \"#{ email }\" email and password of \"secret\" exist"
account = Account.where(:email => email).first
account.is_active = false
account.save