0

次のエラーが発生します。

expected there to be text "D87F1B373E528ECBE040D10A044A2E9A" in "Pending Forms to be completed Patient Medication Last Updated Prescription Id" (RSpec::Expectations::ExpectationNotMetError)
  ./features/step_definitions/get_pending_forms.rb:10:in `/^I should see formId as "([^"]*)"$/'
  features/get_pending_forms.feature:5:in `And I should see formId as "D87F1B373E528ECBE040D10A044A2E9A"'


Feature: List all pending forms in json
  Scenario: get pending forms
    Given I visits the get pending forms page with token "121cb4c8e9c5133b4046db3e81f91c0d03f4735949daf6e1c129d613531f3954"
    Then I should see pending forms with location_id "1234567890"
    And I should see formId as "D87F1B373E528ECBE040D10A044A2E9A"
    And I should see formCount as "5"

ステップ定義:

Given /^I visits the get pending forms page with token "([^"]*)"$/ do |token|
  visit display_pending_forms_path(:authorization => "121cb4c8e9c5133b4046db3e81f91c0d03f4735949daf6e1c129d613531f3954")
end

Then /^I should see pending forms with location_id "([^"]*)"$/ do |location|
  #page.should have_content(location)
end

And /^I should see formId as "([^"]*)"$/ do |formId|
  page.should have_content(formId)
end

And /^I should see formCount as "([^"]*)"$/ do |formCount|
  page.should have_content(formCount)
end
4

2 に答える 2

0

HTML要素をテストするときは、have_contentの代わりにhave_cssを使用する必要があります。

page.should have_css("#form_id")

詳細については、Capybaraのドキュメントを参照してください。

于 2013-03-25T11:25:02.650 に答える
0

データベースにいくつかのレコードがあります。そしてそれはうまくいきます。

于 2013-03-25T12:57:19.817 に答える