Skip to content

Instantly share code, notes, and snippets.

require 'spec_helper'
feature 'Visitor sees mobile taxon page' do
scenario 'with branding' do
# Stub store
stub_default_store!
store = solidify_stubbed_store!
# Set up Taxonomy, Taxon, Product and TaxonPage
taxonomy = Taxonomy.make(name: 'Brands')
class BidOfferedJob < Struct.new(:bid_id)
PRIORITY = 1
def self.enqueue(bid)
Delayed::Job.enqueue new(bid.id), priority: PRIORITY
end
def perform
Mailer.bid_offered(owner, bid).deliver
Activity.create activity_type: 'bid_offered', subject: bid, user: aide
@ralphos
ralphos / seller_sees_auction_spec.rb
Created June 7, 2014 15:34
Feature spec setup smell
# ...
def create_seller_with_company_debtor_invoice_and_auction(args = {})
company = create(:company, name: args.fetch(:company_name))
debtor = create(:debtor, status: args.fetch(:debtors_status),
company: company)
seller = create(:seller, status: args.fetch(:seller_status))
create(:user, email: args.fetch(:email),
password: args.fetch(:password),
account: seller,
@ralphos
ralphos / piped.html
Created May 21, 2014 06:20
local html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head data-hook="admin_inside_head">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
<meta content="authenticity_token" name="csrf-param" />
<meta content="beeCDc469lxCuPS92r8QzKDGqJnSr99A9vO5m291Cg4=" name="csrf-token" />
<title>ABC Shop Administration:
Variants</title>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head data-hook="admin_inside_head">
<script type="text/javascript">window.NREUM||(NREUM={});NREUM.info={"beacon":"beacon-1.newrelic.com","errorBeacon":"jserror.newrelic.com","licenseKey":"14073fb694","applicationID":"3780965","transactionName":"JwwKEkQNXA4BExxUBgkKCklAA0ILBQ9HRk0NDQADTg==","queueTime":7723,"applicationTime":2528,"ttGuid":"","agentToken":null,"agent":"js-agent.newrelic.com/nr-411.min.js"}</script>
<script type="text/javascript">window.NREUM||(NREUM={}),__nr_require=function(t,n,e){function r(e){if(!n[e]){var o=n[e]={exports:{}};t[e][0].call(o.exports,function(n){var o=t[e][1][n];return r(o?o:n)},o,o.exports)}return n[e].exports}if("function"==typeof __nr_require)return __nr_require;for(var o=0;o<e.length;o++)r(e[o]);return r}({D5DuLP:[function(t,n){function e(t,n){var e=r[t];return e?e.apply(this,n):(o[t]||(o[t]=[]),void o[t].pu
@ralphos
ralphos / sphinx.rb
Last active August 29, 2015 14:01
Sphinx 0.9.9 Formula - updated
require 'formula'
class Sphinx < Formula
url 'http://sphinxsearch.com/files/archive/sphinx-0.9.9.tar.gz'
homepage 'http://www.sphinxsearch.com'
version '0.9.9'
sha1 '8c739b96d756a50972c27c7004488b55d7458015'
head 'http://sphinxsearch.googlecode.com/svn/trunk/'
fails_with_llvm "ld: rel32 out of range in _GetPrivateProfileString from /usr/lib/libodbc.a(SQLGetPrivateProfileString.o)",
language: ruby
rvm:
- 1.9.3
bundler_args: --without development --deployment
cache:
- bundler
- apt
addons:
postgresql: "9.2"
firefox: "7.0.1"
@ralphos
ralphos / gist:10329496
Created April 9, 2014 23:25
Learning Resources
# HTML
Head First HTML/CSS
# Ruby
Learn to Program (Chris Pine)
Eloquent Ruby
# Rails
Rails Tutorial (Michael Hartl)
require "spec_helper"
describe ExampleController do
context "GET #index" do
let(:resources) { FactoryGirl.create_list(:resource) }
before do
get :index
end
module DelayedJob
module Matchers
def enqueue_delayed_job(handler)
DelayedJobMatcher.new handler
end
class DelayedJobMatcher
def initialize(handler)
@handler = handler
@attributes = {}