1
describe "user enters 150 into time" do
before do
fill_in "workout[total_time]", with: "150"
click_button "Update Workout"
end
it "should be on profile page" do
save_and_open_page
page.should have_selector("h1", text: "Profile")
page.should have_selector("title", text: "Profile")
end
end
그것은 다음과 같은 메시지와 함께 실패있어 다음과 같은 사양이 일치하지 않는 : (save_and_open_page
에서)
Capybara::ExpectationNotMet: expected to find css "title" with text "Profile" but there were no matches. Also found "", which matched the selector but not all filters.
소스 코드를 포함이 head
섹션
<head>
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<title>Profile
</title>
<meta content="Composer Delete" name="description">
<link href="/assets/application.css" media="all" rel="stylesheet" type="text/css">
<script src="/assets/application.js" type="text/javascript"></script>
</head>
여기에보기 :
,- content_for :title do
Profile
%h1 Profile
%table.table.table-striped
%thead
%tr
%th Name
%tbody
- current_user.workouts.each do |workout|
%tr
%td= link_to workout.name, workout
%td= link_to "Edit", edit_profile_workout_url(workout)
%td= link_to "Remove", profile_workout_url(workout), method: :delete, confirm: "Are you sure?"
= link_to "Create New Workout", new_profile_workout_url
그리고 content_for
는 layouts/application.html.haml
내지 : 페이지
%title= content_for?(:title) ? yield(:title) : "Composer Delete"
표제가 "프로파일"로 표시되고있다.
이 사양이 실패하는 이유는 무엇입니까?
레일 3.2.3
루비 1.9.3