Skip to content

Commit

Permalink
More encoding fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
elia committed Oct 5, 2013
1 parent de2d1e4 commit e1d36ce
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions spec/features/smoke_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -227,20 +227,18 @@
# temprorary go to page 2
page.find('.pagination > .page > a', text: '2').click

nbsp = Nokogiri::HTML(" ").text

(1..4).each do |page_number|
page.find('.pagination > .page > a', text: page_number).click
page.find('.pagination_information').should have_content('Displaying Posts')

offset = (page_number - 1) * per_page
collection_size = [per_page, posts_size - (page_number - 1) * per_page].min

display_total_text = I18n.t 'active_admin.pagination.multiple', :model => 'Posts', :total => posts_size,
:from => offset + 1, :to => offset + collection_size

pagination_information = page.find('.pagination_information').native.to_s.gsub(nbsp,' ')
display_total_text.gsub!(/&(#160|nbsp);/, ' ')
display_total_text = I18n.t 'active_admin.pagination.multiple',
model: 'Posts', total: posts_size,
from: offset + 1, to: offset + collection_size
display_total_text = Nokogiri::HTML(display_total_text).text.gsub(' ', ' ')
pagination_information = page.find('.pagination_information').text
pagination_information.should include(display_total_text)
end
end
Expand Down

0 comments on commit e1d36ce

Please sign in to comment.