次のキュウリスクリプトを実行すると:
Feature: Manage Customers
In order to store customers
As a user
I want to create and manage customers
Scenario Outline: Create Customer
Given I am on new customer screen
When I fill in Name with "Test Company"
And I press "Create"
Then I should see "Customer created successfully"
次のメッセージが表示されます。
When /^I fill in Name with "([^"]*)"$/ do |arg1|
pending # express the regexp above with the code you wish you had
end
ただし、webratを使用していますが、web_steps.rbのこの行を認識していないようです。
When /^(?:|I )fill in "([^"]*)" with "([^"]*)"$/ do |field, value|
fill_in(field, :with => value)
end
features / support / env.rbを確認しましたが、webratが適切に必要とされているようです。
require 'cucumber/formatter/unicode' # Remove this line if you don't want Cucumber Unicode support
require 'cucumber/rails/world'
require 'cucumber/rails/active_record'
require 'cucumber/web/tableish'
require 'webrat'
require 'webrat/core/matchers'
Webrat.configure do |config|
config.mode = :rails
config.open_error_files = false # Set to true if you want error pages to pop up in the browser
end
何かご意見は?