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

在数据库中有一些记录。它工作正常..

于 2013-03-25T12:57:19.817 回答
0

当您测试 HTML 元素时,您应该使用 have_css 而不是 have_content:

page.should have_css("#form_id")

有关详细信息,请参阅Capybara 文档

于 2013-03-25T11:25:02.650 回答