Permalink
Browse files

markup changes: <span class="current">1</span> is now <em>1</em>. als…

…o, "a.prev_page" is now "a.previous_page" (for consistency)
  • Loading branch information...
mislav committed Oct 12, 2008
1 parent 5a0a11c commit 8c585a716baf2d4fd20a7c0ba7f59aea61d800cd
Showing with 8 additions and 8 deletions.
  1. +2 −2 lib/will_paginate/view_helpers/link_renderer.rb
  2. +6 −6 spec/view_helpers/action_view_spec.rb
@@ -48,7 +48,7 @@ def page_number(page)
unless page == current_page
link page, page, :rel => rel_value(page)
else
- tag :span, page, :class => 'current'
+ tag :em, page
end
end
@@ -57,7 +57,7 @@ def gap
end
def previous_page
- previous_or_next_page(@collection.previous_page, @options[:previous_label], 'prev_page')
+ previous_or_next_page(@collection.previous_page, @options[:previous_label], 'previous_page')
end
def next_page
@@ -38,9 +38,9 @@ def render(locals)
validate_page_numbers [2,3,2], elements
assert_select elements.last, ':last-child', "Next &raquo;"
end
- assert_select 'span', 2
+ assert_select 'span', 1
assert_select 'span.disabled:first-child', '&laquo; Previous'
- assert_select 'span.current', '1'
+ assert_select 'em', '1'
pagination.first.inner_text.should == '&laquo; Previous 1 2 3 Next &raquo;'
end
end
@@ -64,7 +64,7 @@ def render(locals)
link.first['rel'].should == 'next'
end
end
- assert_select 'span.current', '2'
+ assert_select 'em', '2'
end
end
@@ -90,7 +90,7 @@ def renderer.gap() '<span class="my-gap">~~</span>' end
it "should have classnames on previous/next links" do
paginate do |pagination|
- assert_select 'span.disabled.prev_page:first-child'
+ assert_select 'span.disabled.previous_page:first-child'
assert_select 'a.next_page[href]:last-child'
end
end
@@ -106,8 +106,8 @@ def renderer.gap() '<span class="my-gap">~~</span>' end
it "should match expected markup" do
paginate
expected = <<-HTML
- <div class="pagination"><span class="prev_page disabled">&laquo; Previous</span>
- <span class="current">1</span>
+ <div class="pagination"><span class="previous_page disabled">&laquo; Previous</span>
+ <em>1</em>
<a href="/foo/bar?page=2" rel="next">2</a>
<a href="/foo/bar?page=3">3</a>
<a href="/foo/bar?page=2" class="next_page" rel="next">Next &raquo;</a></div>

0 comments on commit 8c585a7

Please sign in to comment.