Skip to content

Commit

Permalink
setup first feature test - cucumber && capybara
Browse files Browse the repository at this point in the history
  • Loading branch information
Benny1992 committed Feb 14, 2014
1 parent fd433c3 commit 9383c01
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
5 changes: 5 additions & 0 deletions features/hello.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Feature: The app should Work

Scenario: View home page
Given I am on the home page
Then I should see "index"
13 changes: 13 additions & 0 deletions features/step_definitions/hello_steps.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Given(/^I am on the home page$/) do
puts visit "http://localhost:3000"
end

Then(/^I should see "(.*?)"$/) do |text|
page.has_content?(text)
#page.driver.resize(20,30)
#page.save_screenshot("/path/to/test.pdf")
#puts page.within_window
#puts page.driver.network_traffic
#puts page.driver.cookies
#puts page.response_headers.to_a
end
6 changes: 6 additions & 0 deletions features/support/env.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
require 'capybara/cucumber'
require 'rack/blogengine'

Rack::Blogengine::documents = [{ html: '<!DOCTYPE html><body><h2>index</h2></body></html>',
path: '/' }]
Capybara.app = Rack::Blogengine::Application

0 comments on commit 9383c01

Please sign in to comment.