This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Running all features | |
# default runs all webrat features | |
<% | |
def_r = " -r features/support/env.rb -r features/step_definitions features " | |
def_f = " --format pretty " | |
def_t = " --tags ~@wip --tags ~@pending --tags ~@selenium" | |
def_opts = "#{def_r} #{def_f} #{def_t}" | |
use_webrat = "-r features/support/webrat.rb" | |
use_selenium_rc = "-r features/support/selenium_rc.rb" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[andy@mini-un ~/Sites] (master) | |
➥ rvm use --create 1.9.2@test_rspec | |
Using /Users/andy/.rvm/gems/ruby-1.9.2-p180 with gemset test_rspec | |
[andy@mini-un ~/Sites] (master) ❷@test_rspec | |
➥ gem install rspec | |
Fetching: rspec-core-2.6.3.gem (100%) | |
Fetching: diff-lcs-1.1.2.gem (100%) | |
Fetching: rspec-expectations-2.6.0.gem (100%) | |
Fetching: rspec-mocks-2.6.0.gem (100%) | |
Fetching: rspec-2.6.0.gem (100%) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def foo | |
# do whatever you need to do | |
end | |
def bar | |
# do whatever you need to do | |
end | |
def foobar | |
foo | |
bar | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"headline" => "Test story", | |
"url" => "http://news.bbc.co.uk/sport/football", | |
"intro" => "This is the introduction", | |
"lastUpdated" => "10:57 GMT, 08/10/10", | |
"imageUrl" => "http://news.bbcimg.co.uk/media/images/48353000/jpg/_48353797_fabregas_getty226x170.jpg", | |
"imageAlt" => "This is an alt" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Running all features | |
# default runs all webrat features | |
<% | |
def_r = " -r features/support/env.rb -r features/step_definitions features " | |
def_f = " --format pretty " | |
def_t = " --tags ~@wip --tags ~@pending --tags ~@selenium" | |
def_opts = "#{def_r} #{def_f} #{def_t}" | |
use_webrat = "-r features/support/webrat.rb" | |
use_selenium_rc = "-r features/support/selenium_rc.rb" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
module PriceBandSpecHelper | |
def valid_attributes | |
{ | |
:start_margin => 10, | |
:end_margin => 30 | |
} | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CategoriesController < ApplicationController | |
before_filter :find_category, :only => [:show] | |
before_filter :ensure_current_post_url, :only => :show | |
def show | |
@products = @category.products.paginate :page => params[:page], :order => Product.pagination_ordering(session[:prefs][:product_sort]) if @category | |
end | |
private |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module UserStepHelper | |
def user_fill_in_login(name, password=nil) | |
login = name =~ /@/ ? name : remove_non_ascii(name)+'@example.com' | |
login.downcase! | |
password ||= name + 'pass' | |
fill_in('login', :with => login) | |
fill_in('password', :with => password) | |
end | |
def user_fill_in_signup(name) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/cucumber.yml | |
default: --tags ~@wip | |
new: --tags @wip:2 --wip | |
# see cucumber-rails wiki for interesting ways to use this file to run cucumber how you want (link here) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
config.after_initialize do | |
AppConfig.gateway = ActiveMerchant::Billing::AxiarGateway.new(:login => 'test', :password => 'test', :mode => self.gateway_mode) | |
end |