#ruby-on-rails #cucumber
#ruby-on-rails #огурец
Вопрос:
Feature: Home page
As a HR manager of a company I am visiting the digipresent app for the first time
I want to be welcomed with a greeting
Scenario: User sees the welcome message
When: he goes to home page
Then: he should see the welcome message
Этот файл называется как features/home_page.feature
When (/^he goes to the home page$/) do
visit root_path
end
Then (/^he should see the welcome message$/)do
expect(page).to have_content("Welcome to Present")
end
Этот файл присутствует в виде features/step_definitions/home_page_steps.rb
$cucumber --require features features/home_page.feature
когда я делаю это, шаги не распознаются.
Feature: Home page
As a HR manager of a company I am visiting the digipresent app for the first time
I want to be welcomed with a greeting
Scenario: User sees the welcome message # features/home_page.feature:5
When: he goes to home page
Then: he should see the welcome message
1 scenario (1 passed)
0 steps
0m0.023s
Ответ №1:
После when и then нет точки с запятой
Scenario: User sees the welcome message
When he goes to home page
Then he should see the welcome message
Это должно сработать