diff --git a/lib/kaffy/pagination.ex b/lib/kaffy/pagination.ex index 07f4b321..14d98b1a 100644 --- a/lib/kaffy/pagination.ex +++ b/lib/kaffy/pagination.ex @@ -4,7 +4,7 @@ defmodule Kaffy.Pagination do # number of pages to show on the showleft/right of the current page @pagination_delta 2 - def get_pages(0, 0), do: [] + def get_pages(1, 0), do: [] def get_pages(current_page, total_page) do showleft = current_page - @pagination_delta diff --git a/test/pagination_test.exs b/test/pagination_test.exs index dbccbffb..89640e56 100644 --- a/test/pagination_test.exs +++ b/test/pagination_test.exs @@ -5,7 +5,7 @@ defmodule Kaffy.PaginationTest do # testing for get_pages(current_page, total_page) test "test on empty pages" do - pages = Pagination.get_pages(0, 0) + pages = Pagination.get_pages(1, 0) assert pages == [] end