Skip to content

Commit

Permalink
markup changes: <span class="current">1</span> is now <em>1</em>. als…
Browse files Browse the repository at this point in the history
…o, "a.prev_page" is now "a.previous_page" (for consistency)
  • Loading branch information
mislav committed Oct 12, 2008
1 parent 5a0a11c commit 8c585a7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions lib/will_paginate/view_helpers/link_renderer.rb
Expand Up @@ -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

Expand All @@ -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
Expand Down
12 changes: 6 additions & 6 deletions spec/view_helpers/action_view_spec.rb
Expand Up @@ -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
Expand All @@ -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

Expand All @@ -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
Expand All @@ -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>
Expand Down

0 comments on commit 8c585a7

Please sign in to comment.