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
# Forked to get it working with Rails 3 and RSpec 2 | |
# Updated to aggregate Cucumber and rspec correctly | |
# Updated to not fail in production when Cucumber, rspec aren't available | |
# | |
# From http://github.com/jaymcgavren | |
# | |
# Save this as rcov.rake in lib/tasks and use rcov:all => | |
# to get accurate spec/feature coverage data | |
# | |
# Use rcov:rspec or rcov: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
# This was ripped from one of our Webrat suites - Capybara would be similar, but slightly different... | |
Then /^I should( not)? see "([^\"]*)" in (.+)$/ do |negatory, text, area| | |
within(selector_for(area)) do |content| | |
if negatory.blank? then | |
content.should contain(text) | |
else | |
content.should_not contain(text) | |
end | |
end | |
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
# 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 |
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
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
# 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
# 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
<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
$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
# 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\\] " |