Skip to content

Instantly share code, notes, and snippets.

View ttdonovan's full-sized avatar

Tanner Donovan ttdonovan

View GitHub Profile
@ryanb
ryanb / favorite_gems.md
Created March 4, 2011 17:31
A list of my favorite gems for various tasks.
@ryanb
ryanb / application.html.erb
Created January 19, 2011 19:31
Example of very simple password authentication.
<!-- layout file -->
<% if current_user %>
Welcome <%= current_user.username %>. Not you? <%= link_to "Log out", logout_path %>
<% else %>
<%= link_to "Sign up", signup_path %> or <%= link_to "log in", login_path %>.
<% end %>
@tdreyno
tdreyno / env.rb
Created December 14, 2010 18:10
Teaching Cucumber Lebowski
gem 'rspec', "~> 2.1.0"
require 'rspec'
require 'lebowski/rspec'
include Lebowski::Foundation
include Lebowski::Foundation::Views
include Lebowski::Foundation::Panes
include Lebowski::SCUI::Views
Before do
require "spec/acceptance/acceptance_helper"
feature "Login", %q{
In order to access my account
As an user
I want to be able to log in
} do
let :user do
Factory :user
(posted at http://groups.google.com/group/cukes/browse_thread/thread/4e01cc6e1a7071d4)
Hi Guys,
I'm the author of pickle, and despite this I broadly agree with Jonas' point of view.
The power of capybara is best realised when you do away with web_steps.rb, and start writing your own steps using capybara's dsl.
In my opinion, pickle is likewise. pickle_steps.rb is a general set of steps to both introduce the dev to the dsl, and enable rapid cuke writing in the early stages of a project.
I agree with Nick - the main point of pickle is to provide a general way of storing models for the lifetime of a scenario, and also to provide a general way of referring to them, so that you don't have to have step defs littered with variable names
# Copy this to features/support/ssl_fix.rb to make Capybara work with sites that switch between HTTP and HTTPS
module Capybara::Driver::RackTest::SslFix
[:get, :post, :put, :delete].each do |method|
define_method method do |*args|
args[0] = path_to_ssl_aware_url(args[0])
super(*args)
end
end
@kneath
kneath / _README.md
Created November 18, 2009 21:42 — forked from defunkt/bundle.rake
Intelligent asset bundling for Rails (GitHub's asset bundling)

GitHub Javascript Strategy

Unless otherwise necessary (such as mobile development), the GitHub javascript codebase is based off jQuery. You can safely assume it will be included on every page.

File naming

  • All jquery plugins should be prefixed with jquery, such as jquery.facebox
  • All github-specific jquery plugins should be prefixed with jquery.github. Like jquery.github.repo_list.js
  • All page-specific files (that only run on ONE page) should be prefixed with page. page.billing.js
namespace :minifier do
def minify(files)
files.each do |file|
cmd = "java -jar lib/yuicompressor-2.3.1.jar #{file} -o #{file}"
puts cmd
ret = system(cmd)
raise "Minification failed for #{file}" if !ret
end
end