Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Commit

Permalink
Implemented Scenario: Updating a story
Browse files Browse the repository at this point in the history
  • Loading branch information
bkeepers committed Aug 29, 2011
1 parent d1ea3bf commit e18aba9
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 2 deletions.
1 change: 1 addition & 0 deletions Gemfile
Expand Up @@ -14,6 +14,7 @@ group :test do
gem 'cucumber'
gem 'capybara'
gem 'capybara-webkit'
gem 'launchy'
end

group :development, :test do
Expand Down
5 changes: 5 additions & 0 deletions Gemfile.lock
Expand Up @@ -29,6 +29,7 @@ GEM
childprocess (0.2.1)
ffi (~> 1.0.6)
columnize (0.3.4)
configuration (1.3.1)
cucumber (1.0.2)
builder (>= 2.1.2)
diff-lcs (>= 1.1.2)
Expand All @@ -47,6 +48,9 @@ GEM
i18n (0.5.0)
json (1.5.3)
json_pure (1.5.3)
launchy (0.4.0)
configuration (>= 0.0.5)
rake (>= 0.8.1)
linecache (0.46)
rbx-require-relative (> 0.0.4)
linecache19 (0.5.12)
Expand Down Expand Up @@ -115,6 +119,7 @@ DEPENDENCIES
capybara-webkit
cucumber
factory_girl
launchy
rack-test
rake
rspec
Expand Down
16 changes: 16 additions & 0 deletions features/stories.feature
Expand Up @@ -9,3 +9,19 @@ Feature: Stories

When I go to the home page
Then I should see "Set up integration tests"

Scenario: Updating a story
Given the following story exists:
| description |
| Updating a story |
When I go to the home page
And I follow "Edit" within the story "Updating a story"
And I fill in "description" with "User can update a story" within the story "Updating a story"
And I press "Update" within the story "Updating a story"

Then I should see "User can update a story"
And I should not see "Updating a story"

When I go to the home page
Then I should see "User can update a story"
And I should not see "Updating a story"
11 changes: 9 additions & 2 deletions features/support/env.rb
Expand Up @@ -3,12 +3,19 @@
require 'bundler'
Bundler.require :default, 'test'
require 'gaskit'

require 'factories'
require 'factory_girl/step_definitions'

require 'capybara/cucumber'
Capybara.default_selector = :css
Capybara.app = Gaskit::App.new
Capybara.javascript_driver = :webkit
Capybara.app = Rack::Builder.new do
map('/assets') { run Gaskit::App.sprockets }
map('/') { run Gaskit::App }
end
Capybara.asset_root = Gaskit.root.join('public')
Capybara.save_and_open_page_path = Gaskit.root.join('tmp/capybara')
Capybara.javascript_driver = ENV['SELENIUM'] ? :selenium : :webkit

Before do
Gaskit::Story.store.clear
Expand Down
3 changes: 3 additions & 0 deletions features/support/selectors.rb
Expand Up @@ -10,6 +10,9 @@ def selector_for(locator)

when "the page"
"html > body"
when /^the story "(.+)"$/
story = Gaskit::Story.all.detect {|s| s.description == $1 } || raise("Could not find story: #{$1}")
"#story-#{story.id}"

# Add more mappings here.
# Here is an example that pulls values out of the Regexp:
Expand Down

0 comments on commit e18aba9

Please sign in to comment.