This file contains 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
# This assumes you have the metric_fu and kablame plugins installed. | |
# Set the artifacts dir for development | |
ENV['CC_BUILD_ARTIFACTS'] ||= File.expand_path("#{RAILS_ROOT}/metrics") | |
rspec_base = File.expand_path("#{RAILS_ROOT}/vendor/plugins/rspec/lib") | |
$LOAD_PATH.unshift(rspec_base) if File.exist?(rspec_base) | |
require 'spec/rake/spectask' | |
require 'spec/rake/verify_rcov' |
This file contains 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 'cucumber/rake/task' #I have to add this | |
require 'spec/rake/spectask' | |
namespace :rcov do | |
Cucumber::Rake::Task.new(:cucumber) do |t| | |
t.rcov = true | |
t.rcov_opts = %w{--rails --exclude osx\/objc,gems\/,spec\/,features\/ --aggregate coverage.data} | |
t.rcov_opts << %[-o "coverage"] | |
end | |
This file contains 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
# Add our current git branch out to our path | |
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
} | |
condense_path() { | |
pwd | sed "s/\/home\/$USER/~/" | sed -r "s|(\/?)(.[^\/]{0,3})[^\/]*(\/)|\\1\\2\\3|g" | |
} | |
PS1="\\[\\033[01;32m\\]\\u@\\h\\[\\033[01;34m\\] \$(condense_path)\\[\\033[01;33m\\]\$(parse_git_branch)\\[\\033[01;34m\\] \\\$\\[\\033[00m\\] " |
This file contains 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
$LOAD_PATH.unshift(RAILS_ROOT + '/vendor/plugins/cucumber/lib') if File.directory?(RAILS_ROOT + '/vendor/plugins/cucumber/lib') | |
begin | |
require 'cucumber/rake/task' | |
task :features => 'db:test:prepare' | |
desc "Run all features" | |
task :features => "features:all" | |
This file contains 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
<h1>Feeds Checker</h1> | |
<% | |
require 'hpricot' | |
require 'open-uri' | |
f1 = open("http://www.commerce.wa.gov.au/feeds/feed1.xml") | |
feed = Hpricot.XML(f1) |
This file contains 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
# Some generic steps to work with Facebooker within Cucumber | |
# See full post at : | |
# http://griffin.oobleyboo.com/archive/facebooker-and-cucumber | |
# | |
# Standard usage like : | |
# Background: | |
# Given our default User | |
# And I am Facebook friends with UID 2 | |
# And I am Facebook friends with UID 3 | |
# And I am Facebook friends with UID 100000700000000 |
This file contains 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
# Let Facebooker get Cucumber all set up | |
require 'facebooker/rails/cucumber' |
This file contains 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
Given /^I am logged in as a Facebook user$/ do | |
# Initialize facebooker session | |
# This will set all the parameters that FB normally passes through, as well as set up | |
# a default Facebooker::Mock::Session. It all just magically happens from this one liner. | |
@integration_session = open_session | |
# Now, we need to specify the default options for the request - in this case, we're setting | |
# that the FB UID is 1, and they have the friends defined in FACEBOOK_FRIENDS - simply UIDs separated by commas. | |
@integration_session.default_request_params.merge!( :fb_sig_user => 1, :fb_sig_friends => '2,3' ) | |
This file contains 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
Scenario: Page Lists Friends | |
Given my default User | |
And I am logged in as a Facebook user | |
When I am on the home page | |
Then I should see "This will be in the canvas" |
This file contains 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
# Simulates a request which has not come via Facebook. | |
# For example, an API request, or webhook request. | |
Given /^I am not in Facebook$/ do | |
@integration_session = open_session | |
@integration_session.canvas=false | |
end |
OlderNewer