Skip to content

Instantly share code, notes, and snippets.

@garciadanny
garciadanny / psych.rb
Created February 20, 2013 16:46 — forked from jcasimir/psych.rb
require 'highline/import'
class Question
attr_reader :text, :important, :validation, :answer
def initialize(input)
@text = input[:text]
@important = input[:important]
@validation = input[:validation] ||= /.*/
end
@garciadanny
garciadanny / Rakefile
Last active December 14, 2015 01:39 — forked from burtlo/Rakefile
# http://rake.rubyforge.org/
$:.push('lib')
require 'sales_engine'
def cleanup
puts "Cleaning Up My Mess"
end
task :environment do
puts "Loading Environment"
@garciadanny
garciadanny / seconds_old.rb
Last active December 14, 2015 06:08 — forked from burtlo/example2.rb
require 'date'
# puts "What are you? #{ARGV} #{ARGV.class}"
# Called as in `ruby example2.rb 1977 10 30`
# birthdate = ARGV.map {|arg| arg.to_i }
birthdate = [ 1977, 10, 30 ]
# year, month, day = [ 1977, 10, 30 ]
# birth_in_seconds = Date.new(year,month,day).to_time.to_i
require 'time'
class Gigasecond
attr_reader :quantity
IN_SECONDS = 1_000_000_000
def initialize(quantity)
@quantity = quantity
end
@garciadanny
garciadanny / word_problem.rb
Created March 6, 2013 16:41 — forked from jcasimir/word_problem.rb
REGULAR EXPRESSIONS
class WordProblem
attr_reader :equation
def initialize(equation)
@equation = equation
end
def answer
calculate
end
class NilClass
def join
""
end
end
class Chunks
attr_reader :value
def initialize(value)
class Sieve
attr_reader :values
def initialize(max)
@values = (2..max).to_a
end
def primes
values.each do |value|
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')

#Lew's Opinionated Guide to Delivering Features#


  1. First, understand the story.

Do you understand the story completely? If not, talk to the product owner to clarify your understanding.

Is the story a logically cohesive grouping of functionality? If not, can it be broken into multiple stories?

Do the points assigned make sense given your current level of understanding of the story? If not, can it be broken into multiple stories?

# in spec/support/omniauth_macros.rb
module OmniauthMacros
def mock_auth_hash
# The mock_auth configuration allows you to set per-provider (or default)
# authentication hashes to return during integration testing.
OmniAuth.config.mock_auth[:twitter] = {
'provider' => 'twitter',
'uid' => '123545',
'user_info' => {
'name' => 'mockuser',