-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
setup first feature test - cucumber && capybara
- Loading branch information
Benny1992
committed
Feb 14, 2014
1 parent
fd433c3
commit 9383c01
Showing
3 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
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
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" |
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
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 |
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
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 |