Tests for pagination middleware