             }
             
             it("should not serialize nil top links") {
+                let userLinks = [
+                    "one": JSONAPILink.Simple(value: "hello"),
+                    "two": JSONAPILink.Object(href: "hello", meta: Meta())
+                ]
+                
                 let newUser = NoCatsUser(id: "11",
                                          name: "Alex",
                                          dog: DogWithNoLinks(id: "213", name: "Hez", cat: cats[0]),
-                                         links: ["one": JSONAPILink.Simple(value: "hello"),
-                                    "two": JSONAPILink.Object(href: "hello", meta: Meta())])
+                                         links: userLinks)
+                
                 let object = json(newUser)
-                let data = object["relationships"]["dog"]["links"]
-                expect(data.count) == 0
+                let links = object["relationships"]["dog"]["links"]
+                expect(links.count) == 0
             }
         }
-
     }
-
 }

            
            it("should serialize the top links inside single relationships") {
                let object = json(user)
                let data = object["relationships"]["dog"]["links"].dictionaryValue
                expect(data.count).toNot(equal(0))
                expect(data["anotherDog"]!["href"]).to(equal("http://example.com/articles/1/comments"))
                expect(data["testDog"]).to(equal("hello"))
            }
            
            it("should serialize the top links inside multiple relationships") {
                let object = json(user)
                let data = object["relationships"]["cats"]["links"].dictionaryValue
                expect(data.count).toNot(equal(0))
                expect(data["prev"]).to(equal("hello"))
                expect(data["next"]).to(equal("world"))
                expect(data["first"]).to(equal("yeah"))
                expect(data["last"]).to(equal("text"))
            }
            
            it("should serialize the links inside included objects") {
                let object = json(JSONAPISerializer(user))
                let data = object["included"][2]["links"].dictionaryValue
                expect(data).toNot(beNil())
                expect(data["test"]).to(equal("hello"))
                expect(data["another"]!["href"]).to(equal("http://example.com/articles/1/comments"))
            }
            
            it("should serialize the links inside array of data objects") {
                let object = json(JSONAPISerializer([user, user2]))
                let firstData = object["data"][0]["links"]
                let secondData = object["data"][0]["links"]
                expect(firstData).toNot(beNil())
                expect(secondData).toNot(beNil())
            }
            
            it("should not serialize nil links") {

            
            it("should serialize data with links") {
                let object = json(JSONAPISerializer(dog, topLinks: ["test": JSONAPILink.Simple(value: "hello")]))
                let links = object["data"]["links"].dictionaryValue
                expect(links.count).toNot(equal(0))
                expect(links["self"]).to(equal("selfish"))
            }
            
            it("should serialize top level links") {
                let object = json(JSONAPISerializer(dog, topLinks: ["test": JSONAPILink.Simple(value: "hello"), "another": JSONAPILink.Object(href: "http://example.com/articles/1/comments", meta: Meta())]))
                let links = object["links"].dictionaryValue
                expect(links.count).toNot(equal(0))
                expect(links["test"]).to(equal("hello"))
                expect(links["another"]!["href"]).to(equal("http://example.com/articles/1/comments"))
                expect(links["another"]!["meta"]["authors"][0]).to(equal("Yehuda Katz"))
            }
        }
        
