오이

2014-03-24 2 views
0

에 경로를 지정하는 방법은 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 프레임 워크를 사용하고 있습니다.

답변

0

이유는 당신이 제공하고있는 오류를 다시 찾을 수 있습니다

cucumber-websteps-0.10.0/lib/cucumber/websteps/browsing_steps.rb:1:in `/^(?:|I)am on (.+)$/' 

또한 테스트와 일치 browsing_steps.rb에서 "기본"단계,이 있음을 보여줍니다. 그것이이 오류를 얻는 이유입니다. 보시다시피, 매칭은 단계보다 "적은"것이고, 이것이 바로 "추측"이 작동하는 이유입니다. "최적의"단계 정의를 자동으로 선택합니다.

+0

내 대답이 문제를 해결 했습니까? – Danny