Skip to content

Instantly share code, notes, and snippets.

View braidn's full-sized avatar
🏰
Storming

Braden Douglass braidn

🏰
Storming
View GitHub Profile
#if this begins to fail, the issue is likely with the naming scheme on the
#SQL columns. This expects tableType_name.
#That would mean lawyers_fname would be chill but lawyers_f_name would
#fail into a misserable amount of fiery poop
$(document).ready(function() {
$("ol.comment-post").delegate("#reply-btn", "click", function(event) {
event.preventDefault();
console.log("we have mercy");
});
});
require 'berkshelf/vagrant'
Vagrant.configure('2') do |config|
# Define VM box to use
config.vm.box = "precise64"
config.vm.box_url = "http://files.vagrantup.com/precise32.box"
# Use hostonly network with a static IP Address
config.vm.network :private_network, ip: "172.90.90.80"
<?php
include_once "inc/incConstants.php";
include 'request_model.php';
if($logon!=1){
header("Location:".$secureURL."/home");
}
$client_info = getAccountByID('client', $userID);
$selected_bids = get_bids(null, 'selected', $get['id']);
//get_bids returns an array that usually has more than one bid
$bid = $selected_bids[0];
@braidn
braidn / helper.rb
Created July 24, 2013 23:28
weird state AR Template error in spree 1.3.3 extension
def add_to_cart(name, variant=nil)
visit spree.root_path
click_link name
choose variant if variant
click_button 'add-to-cart-button'
end
def user_login(user)
fill_in 'spree_user_email', :with => user.email
fill_in 'spree_user_password', :with => 'secret'
# Configure Rails Environment
ENV['RAILS_ENV'] = 'test'
require File.expand_path('../dummy/config/environment.rb', __FILE__)
require 'rspec/rails'
require 'capybara/rspec'
require 'database_cleaner'
require 'ffaker'
Capybara.javascript_driver = :webkit
def add_to_cart(name, variant=nil)
visit(spree.root_path)
click_link name
choose variant if variant
click_button 'add-to-cart-button'
end
def user_login(user)
fill_in 'spree_user_email', :with => user.email
fill_in 'spree_user_password', :with => 'secret'
require 'spec_helper'
describe 'Checkout' do
let(:user) { create(:user) }
let(:product) { create(:product, name: 'awesome-sauce') }
before(:each) do
visit spree.root_path
create(:payment_method)
end
require 'spec_helper'
feature "Add child", %q{
as a user
when I log into my account
I can successfully add a kid
} do
let(:user) { Fabricate(:user) }
let(:kid) { Fabricate(:kid) }
class AuthenticatorConstructor
def self.build(*args)
new.build(*args)
end
def build(authenticator, user_id)
authenticator.merge({user_id: user_id})
Authenticator.create(authenticator_params)
end