2
使用Ruby on Rails和我正在編寫步驟定義,以便我可以運行黃瓜。不過,我有一個訪問頁面的普通高清和黃瓜不能找到我給它的路徑:黃瓜上的步驟定義沒有在Ruby on Rails上找到路徑
Can't find mapping from "the Brainstormy home index page" to a path.
這是步驟定義:
Given /^(?:|I)am on (.+)$/ do |page_name|
visit path_to(page_name)
end
這裏是情景:
Scenario: Sign up for Brainstormy
Given I am on the Brainstormy home index page
When I fill in "firstName" with "John"
And I fill in "lastName" with "Adams"
And I fill in "email" with "[email protected]"
And I fill in "email2" with "[email protected]"
And I fill in "password" with "spot1234"
And I fill in "password2" with "spot1234"
And I press "Sign Up"
Then I should be on the profile page
我的路線:
home_index /home/index(.:format) home#index
root / home#index
My routes.rb:
root :to => 'home#index'
resources :ideas
resources :users
#root :to => redirect('/home/index')
match 'home/index' => 'home#index'
match 'users/new' => 'users#new'
事情是,我沒有寫定義。我從一個正在運行的應用程序中獲得它,並基本上將它們做了鏡像。有人可以幫我解決這個問題嗎?