@@ -28,19 +28,13 @@ def step_obj_for(path)
2828 html = to_html ( steps . first )
2929 checkbox_html = %q{<input class="big_checkbox" id="big_checkbox_1" name="big_checkbox_1" type="checkbox" value="valuable"><label for="big_checkbox_1"></label>}
3030 expected = <<-HTML . strip_heredoc . gsub ( "\n " , '' )
31- < div class ="step " title =" hello " >
31+ < div class ="step ">
3232 < h1 > #{ checkbox_html } < span class ="prefix "> Step 1: </ span > hello</ h1>
3333 </ div>
3434 HTML
3535 assert { html == expected }
3636 end
3737
38- it "puts titles in based on step names" do
39- steps = html_doc . css ( ".step" )
40- assert { steps . first [ "title" ] == "hello" }
41- assert { steps [ 1 ] [ "title" ] == "goodbye" }
42- end
43-
4438 it "puts anchors in based on step numbers" do
4539 steps = html_doc . css ( ".step" )
4640 steps . each_with_index do |step , i |
@@ -71,8 +65,9 @@ def step_obj_for(path)
7165 end
7266 RUBY
7367
74- titles = html_doc . css ( '.step' ) . map { |div | div [ "title" ] }
75- assert { titles == [ "breakfast" , "cereal" , "eggs" , "lunch" , "salad" , "sandwich" ] }
68+ titles = html_doc . css ( '.step h1' ) . map { |title | title . text }
69+ titles . inspect
70+ assert { titles == [ "Step 1: breakfast" , "Step 1.1: cereal" , "Step 1.2: eggs" , "Step 2: lunch" , "Step 2.1: salad" , "Step 2.2: sandwich" ] }
7671
7772 anchors = html_doc . css ( "a" )
7873 names = anchors . map { |a | a [ "name" ] }
@@ -90,7 +85,7 @@ def step_obj_for(path)
9085 step "sandwich"
9186 end
9287 RUBY
93- a = html_doc . css ( ".step[title=breakfast] a.link" ) . first
88+ a = html_doc . css ( ".step" ) . first . css ( " a.link") . first
9489 hash = URI . escape '#'
9590 assert { a [ "href" ] == "choose_breakfast?back=hello#{ hash } step1" }
9691 end
0 commit comments