我遇到了模棱两可的步骤定义错误。以下方案存在于不同的功能文件中,并且具有相同的步骤:Then I should see my profile page
。我该如何避免这种情况发生?
# authentication.feature
Scenario: Successful sign in
Given I visit the sign in page
When I submit valid sign in information
Then I should see my profile page
# signing_up.feature
Scenario: Successful sign up
Given I visit the sign up page
When I submit valid information
Then I should see my profile page
# authentication_steps.rb
...
Then /^I should see my profile page$/ do
page.current_path.should == user_path(@user)
end
# signing_up.feature
...
Then /^I should see my profile page$/ do
page.current_path.should == user_path(@user)
end
我也遇到了这个错误消息:
Scenario: Unsuccessful sign up
...
Then I should see an error message
Scenario: Unsuccessful login
...
Then I should see an error message
答案 0 :(得分:4)
为什么不只使用authentication_steps.rb中的那个?我认为您可以使用任何功能文件中的所有步骤