Skip to content

Instantly share code, notes, and snippets.

View matschaffer's full-sized avatar
🧡

Mat Schaffer matschaffer

🧡
View GitHub Profile
@javascript
Scenario: confiming when saving inactive
Given I expect to click "OK" on a confirmation box saying "Are you sure?"
When I press "Save"
Then the confirmation box should have been displayed
And I should see "TV" in the "Campaign Keywords" section
# Given an app in auto jump, callme. Matched by "j cal".
$ tmux # start the initial session
$ r cal # runs "j cal", opens 3 tabs, starts rails in tab 2
trotter spoke about chloe
brian spoke about ruby shadow tables
matt showed collavoce
Houdini:
easy mechanical turk integrtion
Jameson used MT for GreenKonnect, Chris considered a StackOverflow type
Given /^I expect to pay \$(\d+) via amazon$/ do |arg1|
price = arg1.to_f
mock_pipeline_request = mock('pipeline_request',
:url => sekret_payment_path(:transaction_amount => price))
Remit::API.any_instance.
expects(:get_recurring_use_pipeline).
with{ |opts| opts[:transaction_amount] == price }.
returns(mock_pipeline_request)
require 'formula'
# Gets the latest Gnu Screen with 256 support
# Method from:
# http://ryanwilliams.org/2010/Oct/09/gnu-screen-256-colours-mac-os-x and
# http://pjkh.com/articles/2008/07/09/osx-iterm-screen-vim-256-colors
class Screen <Formula
head 'git://git.savannah.gnu.org/screen.git'
homepage 'http://www.gnu.org/software/screen/'
Then /^"([^"]*)" I should receive an email$/ do |recipient|
@email = ActionMailer::Base.deliveries.detect do |m|
m.to.include? recipient
end
assert @email
end
Then /^that email should have a (\w+) attachment$/ do |type|
assert @email.attachments.detect { |a| a.mime_type.match(type) }
end
Feature: Index cards
In order to help me remember things
As a student
I want to get custom index cards
Scenario: Sending yourself a card
Given I am on the new index card page
When I fill in "Email" with "info@mashion.net"
And I select "iPhone 4" from "Phone"
And I fill in "Body" with "A test card"
Feature: Player listings
In order to know who is on a team
As a league manager
I want to see a list of players on the team page
Scenario: listing on a team page
Given I am on the teams page
And I follow "Kickers"
Then I should see "Trotter"
escape ^\a
bell_msg '^GBell in window %n'
defscrollback 10000
bind ^L eval "clear" "scrollback 0" "scrollback 10000"
shell -bash
startup_message off
class PlayerTest < ActiveSupport::TestCase
test "parses out last name" do
trotter = Player.new(:name => "Trotter Cashion")
assert_equal "Cashion", trotter.last_name
end
end