แตงกวา: ขั้นตอนที่ไม่ได้กำหนด แม้ว่าควรกำหนดขั้นตอนก็ตาม

ฉันได้สร้างขั้นตอน:

    Given /^the feed "([^"]*)" has an item "([^"]*)" published at "([^"]*)"$/ do |feed_name, feed_item_title, published_at|
  feed = Feed.find_by_name(feed_name)
  FeedItem.make(:feed => feed, :title => feed_item_title, :published_at => published_at)
end

และฉันทำการทดสอบแตงกวาด้วย:

Scenario: feed items should be sorted by date
    Given I am signed into an account called "GT" as a customer
    And there is a social feed called "Twitter" for the account "GT"
    And the feed Twitter has an item Majbrasa published at "2010-05-01"
    --- more follows 

แตงกวากล่าวว่า:

7 steps (4 skipped, 1 undefined, 2 passed)
You can implement step definitions for undefined steps with these snippets:

Given /^the feed Twitter has an item Majbrasa published at "([^"]*)"$/ do |arg1|
  pending # express the regexp above with the code you wish you had
end

ฉันไม่เห็นว่ามีอะไรผิดปกติกับขั้นตอนของฉัน ฉันขาดอะไรไปหรือเปล่า? ขอบคุณล่วงหน้าเอมิล


person Soroush Hakami    schedule 26.10.2010    source แหล่งที่มา


คำตอบ (1)


ในขั้นตอนของคุณ คุณต้องมี " " รอบ ๆ Twitter ดังนั้นให้ใช้แบบเดียวกันกับ Majbrasa

Scenario: feed items should be sorted by date
    Given I am signed into an account called "GT" as a customer
    And there is a social feed called "Twitter" for the account "GT"
    And the feed "Twitter" has an item "Majbrasa" published at "2010-05-01"
person shingara    schedule 26.10.2010
comment
ขอบคุณมาก ไม่น่าเชื่อว่าจะพลาดไป - person Soroush Hakami; 26.10.2010
comment
rubular.com เป็นแหล่งข้อมูลที่ดีเยี่ยมในการช่วยแก้ปัญหาคำจำกัดความขั้นตอนที่ตรงกับขั้นตอนของคุณ - person burtlo; 12.11.2010