         XCTAssertEqual(viewRenderer.capturedContext?["site_twitter_handle"]?.string, "brokenhandsio")
     }
     
-//    func testBlogIndexPageGivenCorrectParameters() throws {
-//        let (posts, tags, authors) = try setupBlogIndex()
-//        _ = try viewFactory.blogIndexView(uri: indexURI, paginatedPosts: posts.paginate(for: indexRequest), tags: tags, authors: authors, loggedInUser: nil, disqusName: nil, siteTwitterHandle: nil)
-//
-//        XCTAssertEqual(viewRenderer.capturedContext?["uri"]?.string, indexURI.description)
-//        XCTAssertTrue((viewRenderer.capturedContext?["blog_index_page"]?.bool) ?? false)
-//        
-//        XCTAssertEqual(viewRenderer.capturedContext?["posts"]?["data"]?.array?.count, posts.count)
-//        XCTAssertEqual((viewRenderer.capturedContext?["posts"]?["data"]?.array?.first)?["title"]?.string, posts.first?.title)
-//        XCTAssertEqual(viewRenderer.capturedContext?["tags"]?.array?.count, tags.count)
-//        XCTAssertEqual((viewRenderer.capturedContext?["tags"]?.array?.first)?["name"]?.string, tags.first?.name)
-//        XCTAssertEqual(viewRenderer.capturedContext?["authors"]?.array?.count, authors.count)
-//        XCTAssertEqual((viewRenderer.capturedContext?["authors"]?.array?.first)?["name"]?.string, authors.first?.name)
-//        XCTAssertEqual(viewRenderer.leafPath, "blog/blog")
-//    }
-//    
-//    func testNoPostsPassedIntoBlogIndexIfNoneAvailable() throws {
-//        let (_, tags, authors) = try setupBlogIndex()
-//        let emptyBlogPosts: [BlogPost] = []
-//        _ = try viewFactory.blogIndexView(uri: indexURI, paginatedPosts: emptyBlogPosts.paginator(5, request: indexRequest), tags: tags, authors: authors, loggedInUser: nil, disqusName: nil, siteTwitterHandle: nil)
-//        XCTAssertNil(viewRenderer.capturedContext?["posts"])
-//    }
-//    
-//    func testNoAuthorsPassedIntoBlogIndexIfNoneCreated() throws {
-//        let (posts, _, authors) = try setupBlogIndex()
-//        _ = try viewFactory.blogIndexView(uri: indexURI, paginatedPosts: posts.paginator(5, request: indexRequest), tags: [], authors: authors, loggedInUser: nil, disqusName: nil, siteTwitterHandle: nil)
-//        XCTAssertNil(viewRenderer.capturedContext?["tags"])
-//    }
-//    
-//    func testNoTagsPassedIntoBlogIndexIfNoneCreted() throws {
-//        let (posts, tags, _) = try setupBlogIndex()
-//        _ = try viewFactory.blogIndexView(uri: indexURI, paginatedPosts: posts.paginator(5, request: indexRequest), tags: tags, authors: [], loggedInUser: nil, disqusName: nil, siteTwitterHandle: nil)
-//        XCTAssertNil(viewRenderer.capturedContext?["authors"])
-//    }
-//    
-//    func testUserPassedToBlogIndexIfUserPassedIn() throws {
-//        let (posts, tags, authors) = try setupBlogIndex()
-//        _ = try viewFactory.blogIndexView(uri: indexURI, paginatedPosts: posts.paginator(5, request: indexRequest), tags: tags, authors: authors, loggedInUser: authors[0], disqusName: nil, siteTwitterHandle: nil)
-//        XCTAssertEqual(viewRenderer.capturedContext?["user"]?["name"]?.string, authors.first?.name)
-//    }
-//    
-//    func testDisqusNamePassedToBlogIndexIfPassedIn() throws {
-//        let (posts, tags, authors) = try setupBlogIndex()
-//        _ = try viewFactory.blogIndexView(uri: indexURI, paginatedPosts: posts.paginator(5, request: indexRequest), tags: tags, authors: authors, loggedInUser: nil, disqusName: "brokenhands", siteTwitterHandle: nil)
-//        XCTAssertEqual(viewRenderer.capturedContext?["disqus_name"]?.string, "brokenhands")
-//    }
-//    
-//    func testTwitterHandlePassedToBlogIndexIfPassedIn() throws {
-//        let (posts, tags, authors) = try setupBlogIndex()
-//        _ = try viewFactory.blogIndexView(uri: indexURI, paginatedPosts: posts.paginator(5, request: indexRequest), tags: tags, authors: authors, loggedInUser: nil, disqusName: nil, siteTwitterHandle: "brokenhandsio")
-//        XCTAssertEqual(viewRenderer.capturedContext?["site_twitter_handle"]?.string, "brokenhandsio")
-//    }
+    func testBlogIndexPageGivenCorrectParameters() throws {
+        let (posts, tags, authors) = try setupBlogIndex()
+        _ = try viewFactory.blogIndexView(uri: indexURI, paginatedPosts: posts, tags: tags, authors: authors, loggedInUser: nil, disqusName: nil, siteTwitterHandle: nil)
+
+        XCTAssertEqual(viewRenderer.capturedContext?["uri"]?.string, indexURI.description)
+        XCTAssertTrue((viewRenderer.capturedContext?["blog_index_page"]?.bool) ?? false)
+        
+        XCTAssertEqual(viewRenderer.capturedContext?["posts"]?["data"]?.array?.count, posts.total)
+        XCTAssertEqual((viewRenderer.capturedContext?["posts"]?["data"]?.array?.first)?["title"]?.string, posts.data.first?.title)
+        XCTAssertEqual(viewRenderer.capturedContext?["tags"]?.array?.count, tags.count)
+        XCTAssertEqual((viewRenderer.capturedContext?["tags"]?.array?.first)?["name"]?.string, tags.first?.name)
+        XCTAssertEqual(viewRenderer.capturedContext?["authors"]?.array?.count, authors.count)
+        XCTAssertEqual((viewRenderer.capturedContext?["authors"]?.array?.first)?["name"]?.string, authors.first?.name)
+        XCTAssertEqual(viewRenderer.leafPath, "blog/blog")
+    }
+    
+    func testNoPostsPassedIntoBlogIndexIfNoneAvailable() throws {
+        let (_, tags, authors) = try setupBlogIndex()
+        let emptyBlogPosts = try BlogPost.makeQuery().filter("title", "A non existent title").paginate(for: indexRequest)
+        _ = try viewFactory.blogIndexView(uri: indexURI, paginatedPosts: emptyBlogPosts, tags: tags, authors: authors, loggedInUser: nil, disqusName: nil, siteTwitterHandle: nil)
+        XCTAssertNil(viewRenderer.capturedContext?["posts"])
+    }
+    
+    func testNoAuthorsPassedIntoBlogIndexIfNoneCreated() throws {
+        let (posts, _, authors) = try setupBlogIndex()
+        _ = try viewFactory.blogIndexView(uri: indexURI, paginatedPosts: posts, tags: [], authors: authors, loggedInUser: nil, disqusName: nil, siteTwitterHandle: nil)
+        XCTAssertNil(viewRenderer.capturedContext?["tags"])
+    }
+    
+    func testNoTagsPassedIntoBlogIndexIfNoneCreted() throws {
+        let (posts, tags, _) = try setupBlogIndex()
+        _ = try viewFactory.blogIndexView(uri: indexURI, paginatedPosts: posts, tags: tags, authors: [], loggedInUser: nil, disqusName: nil, siteTwitterHandle: nil)
+        XCTAssertNil(viewRenderer.capturedContext?["authors"])
+    }
+    
+    func testUserPassedToBlogIndexIfUserPassedIn() throws {
+        let (posts, tags, authors) = try setupBlogIndex()
+        _ = try viewFactory.blogIndexView(uri: indexURI, paginatedPosts: posts, tags: tags, authors: authors, loggedInUser: authors[0], disqusName: nil, siteTwitterHandle: nil)
+        XCTAssertEqual(viewRenderer.capturedContext?["user"]?["name"]?.string, authors.first?.name)
+    }
+    
+    func testDisqusNamePassedToBlogIndexIfPassedIn() throws {
+        let (posts, tags, authors) = try setupBlogIndex()
+        _ = try viewFactory.blogIndexView(uri: indexURI, paginatedPosts: posts, tags: tags, authors: authors, loggedInUser: nil, disqusName: "brokenhands", siteTwitterHandle: nil)
+        XCTAssertEqual(viewRenderer.capturedContext?["disqus_name"]?.string, "brokenhands")
+    }
+    
+    func testTwitterHandlePassedToBlogIndexIfPassedIn() throws {
+        let (posts, tags, authors) = try setupBlogIndex()
+        _ = try viewFactory.blogIndexView(uri: indexURI, paginatedPosts: posts, tags: tags, authors: authors, loggedInUser: nil, disqusName: nil, siteTwitterHandle: "brokenhandsio")
+        XCTAssertEqual(viewRenderer.capturedContext?["site_twitter_handle"]?.string, "brokenhandsio")
+    }
     
     func testAuthorViewHasCorrectParametersSet() throws {
         let (author, posts) = try setupAuthorPage()

    }
    
    func testAuthorViewHasNoPostsSetIfNoneCreated() throws {
//        let (author, _) = try setupAuthorPage()
//        let emptyPosts: [BlogPost] = []
//        let paginatedEmptyPosts = try emptyPosts.paginator(5, request: authorRequest)
//        let _ = try viewFactory.createProfileView(uri: authorURI, author: author, isMyProfile: true, paginatedPosts: paginatedEmptyPosts, loggedInUser: nil, disqusName: nil, siteTwitterHandle: nil)
//        XCTAssertNil(viewRenderer.capturedContext?["posts"])
    }
    
    func testAuthorViewGetsLoggedInUserIfProvider() throws {

        XCTAssertEqual(viewRenderer.capturedContext?["users"]?.array?.count, 2)
        XCTAssertEqual(viewRenderer.capturedContext?["users"]?.array?.first?["name"]?.string, users.first?.name)
        XCTAssertEqual(viewRenderer.capturedContext?["published_posts"]?.array?.count, 2)
        XCTAssertEqual(viewRenderer.capturedContext?["published_posts"]?.array?.first?["title"]?.string, posts.data[1].title)
        XCTAssertEqual(viewRenderer.capturedContext?["draft_posts"]?.array?.count, 1)
        XCTAssertEqual(viewRenderer.capturedContext?["draft_posts"]?.array?.first?["title"]?.string, draftPost.title)
        XCTAssertEqual(viewRenderer.leafPath, "blog/admin/index")
