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

Commit e18aba9

Browse files
committed
Implemented Scenario: Updating a story
1 parent d1ea3bf commit e18aba9

File tree

5 files changed

+34
-2
lines changed

5 files changed

+34
-2
lines changed

Diff for: Gemfile

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ group :test do
1414
gem 'cucumber'
1515
gem 'capybara'
1616
gem 'capybara-webkit'
17+
gem 'launchy'
1718
end
1819

1920
group :development, :test do

Diff for: Gemfile.lock

+5
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ GEM
2929
childprocess (0.2.1)
3030
ffi (~> 1.0.6)
3131
columnize (0.3.4)
32+
configuration (1.3.1)
3233
cucumber (1.0.2)
3334
builder (>= 2.1.2)
3435
diff-lcs (>= 1.1.2)
@@ -47,6 +48,9 @@ GEM
4748
i18n (0.5.0)
4849
json (1.5.3)
4950
json_pure (1.5.3)
51+
launchy (0.4.0)
52+
configuration (>= 0.0.5)
53+
rake (>= 0.8.1)
5054
linecache (0.46)
5155
rbx-require-relative (> 0.0.4)
5256
linecache19 (0.5.12)
@@ -115,6 +119,7 @@ DEPENDENCIES
115119
capybara-webkit
116120
cucumber
117121
factory_girl
122+
launchy
118123
rack-test
119124
rake
120125
rspec

Diff for: features/stories.feature

+16
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,19 @@ Feature: Stories
99

1010
When I go to the home page
1111
Then I should see "Set up integration tests"
12+
13+
Scenario: Updating a story
14+
Given the following story exists:
15+
| description |
16+
| Updating a story |
17+
When I go to the home page
18+
And I follow "Edit" within the story "Updating a story"
19+
And I fill in "description" with "User can update a story" within the story "Updating a story"
20+
And I press "Update" within the story "Updating a story"
21+
22+
Then I should see "User can update a story"
23+
And I should not see "Updating a story"
24+
25+
When I go to the home page
26+
Then I should see "User can update a story"
27+
And I should not see "Updating a story"

Diff for: features/support/env.rb

+9-2
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,19 @@
33
require 'bundler'
44
Bundler.require :default, 'test'
55
require 'gaskit'
6+
67
require 'factories'
8+
require 'factory_girl/step_definitions'
79

810
require 'capybara/cucumber'
911
Capybara.default_selector = :css
10-
Capybara.app = Gaskit::App.new
11-
Capybara.javascript_driver = :webkit
12+
Capybara.app = Rack::Builder.new do
13+
map('/assets') { run Gaskit::App.sprockets }
14+
map('/') { run Gaskit::App }
15+
end
16+
Capybara.asset_root = Gaskit.root.join('public')
17+
Capybara.save_and_open_page_path = Gaskit.root.join('tmp/capybara')
18+
Capybara.javascript_driver = ENV['SELENIUM'] ? :selenium : :webkit
1219

1320
Before do
1421
Gaskit::Story.store.clear

Diff for: features/support/selectors.rb

+3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ def selector_for(locator)
1010

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

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

0 commit comments

Comments
 (0)