Skip to content

Commit ee74ae6

Browse files
committed
Steps no longer set the 'title' attribute
This was causing a tooltip to show up when you hover over any part of the step. That seems like kind of an unusual use case for a tooltip, so I'm taking it out.
1 parent a48cdd5 commit ee74ae6

File tree

3 files changed

+6
-15
lines changed

3 files changed

+6
-15
lines changed

lib/step.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ def insert file
8181

8282
def step name = nil, options = {}
8383
num = next_step_number
84-
a(:name => "step#{current_anchor_num}")
85-
a(:name => options[:anchor_name]) if options[:anchor_name]
86-
div :class => "step", :title => name do
84+
a(name: "step#{current_anchor_num}")
85+
a(name: options[:anchor_name]) if options[:anchor_name]
86+
div class: "step" do
8787
h1 do
8888
widget BigCheckbox
8989
prefix I18n.t("general.step_title", :num => num) +

spec/step_page_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<h1 class="doc_title">Hello</h1>
3333
<div class="doc">
3434
<a name="step1"></a>
35-
<div class="step" title="hello">
35+
<div class="step">
3636
<h1>#{checkbox_html}<span class="prefix">Step 1: </span>hello</h1>
3737
</div>
3838
</div>

spec/step_spec.rb

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,13 @@ def step_obj_for(path)
3131
html = to_html(steps.first)
3232
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>}
3333
expected = <<-HTML.strip_heredoc.gsub("\n", '')
34-
<div class="step" title="hello">
34+
<div class="step">
3535
<h1>#{checkbox_html}<span class="prefix">Step 1: </span>hello</h1>
3636
</div>
3737
HTML
3838
assert { html == expected }
3939
end
4040

41-
it "puts titles in based on step names" do
42-
steps = html_doc.css(".step")
43-
assert { steps.first["title"] == "hello" }
44-
assert { steps[1]["title"] == "goodbye" }
45-
end
46-
4741
it "puts anchors in based on step numbers" do
4842
steps = html_doc.css(".step")
4943
steps.each_with_index do |step, i|
@@ -74,9 +68,6 @@ def step_obj_for(path)
7468
end
7569
RUBY
7670

77-
titles = html_doc.css('.step').map{|div| div["title"]}
78-
assert { titles == %w(breakfast cereal eggs lunch salad sandwich) }
79-
8071
anchors = html_doc.css("a")
8172
names = anchors.map{|a| a["name"]}
8273
assert { names == %w(step1 step1-1 step1-2 step2 step2-1 step2-2) }
@@ -93,7 +84,7 @@ def step_obj_for(path)
9384
step "sandwich"
9485
end
9586
RUBY
96-
a = html_doc.css(".step[title=breakfast] a.link").first
87+
a = html_doc.css(".step a.link").first
9788
assert { a["href"] == "choose_breakfast" }
9889
end
9990

0 commit comments

Comments
 (0)