에 경로를 지정하는 방법은 spree_fit_card/new_gift_card.feature` '이 오이 기능을 설정 한 :오이
@gift-card
Feature: access gift cards
As a general user
I will be able to place an order for a gift card
Scenario: The gift card index page will redirect to /new
When I am on the gift card page
Then I will be redirected to the new gift card page
그리고 support/paths.rb
의 :
module NavigationHelpers
def path_to(page_name)
when /the gift card page/
spree.gift_cards_path
when /the new gift card page/
spree.new_gift_card_path
else
...
end
end
end
우리가 step_definitions/new_gift_card_steps.rb
을 체크 아웃 할 때 :
When(/^I am on the gift card page$/) do
pending
end
Then(/^I will be redirected to the new gift card page$/) do
pending
end
오이 출력 :
,174,515$ zeus cucumber --tags @gift-card
Loading fixtures
Using the default profile...
@gift-card
Feature: access gift cards
As a general user
I will be able to place an order for a gift card
Scenario: The gift card page will redirect to the new gift card page # features/spree_gift_card/new_gift_card.feature:6
When I am on the gift card page # features/spree_gift_card/new_gift_card.feature:7
Ambiguous match of "I am on the gift card page":
features/step_definitions/spree_gift_card/new_gift_cards_steps.rb:1:in `/^I am on the gift card page$/'
cucumber-websteps-0.10.0/lib/cucumber/websteps/browsing_steps.rb:1:in `/^(?:|I)am on (.+)$/'
You can run again with --guess to make Cucumber be more smart about it
(Cucumber::Ambiguous)
-e:1:in `<main>'
features/spree_gift_card/new_gift_card.feature:7:in `When I am on the gift card page'
Then I will be redirected to the new gift card page # features/step_definitions/spree_gift_card/new_gift_cards_steps.rb:5
Failing Scenarios:
cucumber features/spree_gift_card/new_gift_card.feature:6 # Scenario: The gift card page will redirect to the new gift card page
그래서 나는 고려 오이의 제안을 가져다 zeus cucumber --tags @gift-card --guess
Loading fixtures
Using the default profile...
@gift-card
Feature: access gift cards
As a general user
I will be able to place an order for a gift card
Scenario: The gift card page will redirect to the new gift card page # features/spree_gift_card/new_gift_card.feature:6
When I am on 'the gift card page' # features/step_definitions/spree_gift_card/new_gift_cards_steps.rb:1
TODO (Cucumber::Pending)
./features/step_definitions/spree_gift_card/new_gift_cards_steps.rb:2:in `/^I am on the gift card page$/'
features/spree_gift_card/new_gift_card.feature:7:in `When I am on the gift card page'
Then I will be redirected to the new gift card page # features/step_definitions/spree_gift_card/new_gift_cards_steps.rb:5
1 scenario (1 pending)
2 steps (1 skipped, 1 pending)
0m0.016s
Cleaning up database
나는 그것이 --guess
으로 통과 기뻐요을 실행하지만, 그것 없이는 통과하지 왜 이해가 안 돼요. 나는 그것이 올바르게 설정했다고 생각하지만 분명히하지는 않았다. Ruby on Rails 버전 3.2.17에서 도움이된다면 Spree 프레임 워크를 사용하고 있습니다.
내 대답이 문제를 해결 했습니까? – Danny