Skip to content

Commit

Permalink
search_controller_test, test for number of results equal to page size
Browse files Browse the repository at this point in the history
In my environment, these tests were failing, cause I got 20 hits
back for each search (page size), but tests were for less?!? Not
sure why Travis succeeded, let's see if this breaks travis.
  • Loading branch information
jrochkind committed Apr 1, 2013
1 parent 12426df commit 8f0f198
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/functional/search_controller_test.rb
Expand Up @@ -2,6 +2,10 @@
class SearchControllerTest < ActionController::TestCase
setup do
@controller = SearchController.new

# Weird, sorry internal implementation isn't great for testabiltiy
@search_page_size = @controller.class.class_variable_get("@@search_batch_size")
@az_page_size = @controller.class.class_variable_get("@@az_batch_size")
end

test "index" do
Expand All @@ -21,7 +25,7 @@ class SearchControllerTest < ActionController::TestCase
assert_select "title", "Find It | Journal titles that begin with &#x27;Account&#x27;"
assert_select ".citationLinker", 1
assert_select ".list", 1
assert_select ".list .citation", 5
assert_select ".list .citation", @search_page_size
assert_select ".pagination", 2
assert_select ".azNav", 0
end
Expand All @@ -33,7 +37,7 @@ class SearchControllerTest < ActionController::TestCase
assert_select "title", "Find It | Browse by Journal Title: A"
assert_select ".citationLinker", 1
assert_select ".list", 1
assert_select ".list .citation", 16
assert_select ".list .citation", @az_page_size
assert_select ".pagination", 2
assert_select ".azNav", 2
end
Expand Down

0 comments on commit 8f0f198

Please sign in to comment.