From 2ac743c8bee7056d31694e511cf3dca52bc96a9e Mon Sep 17 00:00:00 2001 From: Domizio Demichelis Date: Tue, 19 Jun 2018 21:00:26 +0200 Subject: [PATCH] added bootstrap extra test --- test/pagy/extras/bootstrap_test.rb | 106 +++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 test/pagy/extras/bootstrap_test.rb diff --git a/test/pagy/extras/bootstrap_test.rb b/test/pagy/extras/bootstrap_test.rb new file mode 100644 index 000000000..3006a5bd6 --- /dev/null +++ b/test/pagy/extras/bootstrap_test.rb @@ -0,0 +1,106 @@ +require_relative '../../test_helper' +require 'pagy/extras/bootstrap' + +SingleCov.covered! + +describe Pagy::Frontend do + + let(:frontend) { TestView.new } + + describe "#pagy_nav_bootstrap" do + before do + @array = (1..103).to_a.extend(Pagy::Array::PageMethod) + end + + def test_pagy_nav_bootstrap_page_1 + pagy, _ = @array.pagy(1) + + assert_equal( + '', + frontend.pagy_nav_bootstrap(pagy) + ) + end + + def test_pagy_nav_bootstrap_page_3 + pagy, _ = @array.pagy(3) + + assert_equal( + '', + frontend.pagy_nav_bootstrap(pagy) + ) + end + + + def test_pagy_nav_bootstrap_page_6 + pagy, _ = @array.pagy(6) + + assert_equal( + '', + frontend.pagy_nav_bootstrap(pagy) + ) + end + + def test_pagy_nav_bootstrap_page_10 + @array = (1..1000).to_a.extend(Pagy::Array::PageMethod) + pagy, _ = @array.pagy(10) + + assert_equal( + '', + frontend.pagy_nav_bootstrap(pagy) + ) + end + + + end +end