look sir, cucumbers

This commit is contained in:
John Bintz 2012-01-20 09:46:29 -05:00
parent f4cafdc5a7
commit bfbc9243c3
9 changed files with 45 additions and 35 deletions

2
.gitignore vendored
View File

@ -2,3 +2,5 @@
themes/* themes/*
plugins/* plugins/*
wordpress/* wordpress/*
Gemfile.lock

View File

@ -1,4 +1,7 @@
# A sample Gemfile # A sample Gemfile
source "http://rubygems.org" source "http://rubygems.org"
gem "vagrant" gem "vagrant", '~> 0.8.0'
gem 'cucumber'
gem 'capybara-webkit'
gem 'rspec'

View File

@ -1,33 +0,0 @@
GEM
remote: http://rubygems.org/
specs:
abstract (1.0.0)
archive-tar-minitar (0.5.2)
erubis (2.6.6)
abstract (>= 1.0.0)
ffi (1.0.9)
i18n (0.5.0)
json (1.5.1)
mario (0.0.6)
net-scp (1.0.4)
net-ssh (>= 1.99.1)
net-ssh (2.1.4)
thor (0.14.6)
vagrant (0.7.5)
archive-tar-minitar (= 0.5.2)
erubis (~> 2.6.6)
i18n (~> 0.5.0)
json (~> 1.5.1)
mario (~> 0.0.6)
net-scp (~> 1.0.4)
net-ssh (~> 2.1.0)
thor (~> 0.14.6)
virtualbox (~> 0.8.3)
virtualbox (0.8.6)
ffi (~> 1.0)
PLATFORMS
ruby
DEPENDENCIES
vagrant

View File

@ -0,0 +1,7 @@
Feature: Home Page
Scenario: Load the home page
Given I have a running WordPress site
When I visit the home page
Then I should not see a WordPress installation page
And I should see a WordPress site

View File

@ -0,0 +1,3 @@
Given /^I have a running WordPress site$/ do
ensure_vagrant_running
end

View File

@ -0,0 +1,3 @@
Then /^I should not see a WordPress installation page$/ do
page.should_not have_css('link[href*="install.css"]')
end

View File

@ -0,0 +1,3 @@
Then /^I should see a WordPress site$/ do
page.should have_css('meta[content*="WordPress"]')
end

View File

@ -0,0 +1,3 @@
When /^I visit the home page$/ do
visit '/'
end

19
features/support/env.rb Normal file
View File

@ -0,0 +1,19 @@
require 'capybara/cucumber'
Capybara.app_host = 'http://localhost:8080/'
require 'capybara-webkit'
Capybara.default_driver = :webkit
def ensure_vagrant_running
require 'vagrant'
vm = Vagrant::Environment.new.primary_vm
if !vm.created?
raise StandardError.new("VM not created! Run `bundle exec vagrant up`.")
end
vm.start
end