@@ -28,19 +28,13 @@ def step_obj_for(path)
28
28
html = to_html ( steps . first )
29
29
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>}
30
30
expected = <<-HTML . strip_heredoc . gsub ( "\n " , '' )
31
- < div class ="step " title =" hello " >
31
+ < div class ="step ">
32
32
< h1 > #{ checkbox_html } < span class ="prefix "> Step 1: </ span > hello</ h1>
33
33
</ div>
34
34
HTML
35
35
assert { html == expected }
36
36
end
37
37
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
-
44
38
it "puts anchors in based on step numbers" do
45
39
steps = html_doc . css ( ".step" )
46
40
steps . each_with_index do |step , i |
@@ -71,8 +65,9 @@ def step_obj_for(path)
71
65
end
72
66
RUBY
73
67
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" ] }
76
71
77
72
anchors = html_doc . css ( "a" )
78
73
names = anchors . map { |a | a [ "name" ] }
@@ -90,7 +85,7 @@ def step_obj_for(path)
90
85
step "sandwich"
91
86
end
92
87
RUBY
93
- a = html_doc . css ( ".step[title=breakfast] a.link" ) . first
88
+ a = html_doc . css ( ".step" ) . first . css ( " a.link") . first
94
89
hash = URI . escape '#'
95
90
assert { a [ "href" ] == "choose_breakfast?back=hello#{ hash } step1" }
96
91
end
0 commit comments