This file contains 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
var _ = require('underscore'); | |
var mongoose = require('mongoose'); | |
var Schema = mongoose.Schema; | |
mongoose.connect('mongodb://localhost/zems'); | |
var Schemata = { | |
player: new Schema({ | |
name: String, |
This file contains 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('underscore') | |
assert = require('assert') | |
sinon = require('sinon') | |
Game = require('../../game/game') | |
db = require('../../db') | |
module.exports = | |
"setMongoObject(), |
This file contains 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 '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 |
This file contains 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
// Mixins and variables | |
@mixin clearfix { | |
&:after { | |
content: "."; | |
display: block; | |
height: 0; | |
clear: both; | |
visibility: hidden; | |
} |
This file contains 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
AttributeNormalizer.configure do |config| | |
config.normalizers[:reject_duplicated] = lambda do |value, options| | |
value.uniq | |
end | |
end |
This file contains 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
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) |
This file contains 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
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 |
This file contains 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 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) |
This file contains 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
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 |
This file contains 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
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 |