Esempio n. 1
0
				Expect(err).To(BeNil())
			})
		})
	})

	Describe("Update", func() {
		Context("When present", func() {
			var anotherm climb.Model

			BeforeEach(func() {
				m = climb.Model{Name: "test", Rating: 3, Description: "Awesome climbing!"}
				anotherm = climb.Model{Name: "another", Rating: 3, Description: "Awesome climbing!"}
				climbFactory.Create(db, &m)
				climbFactory.Create(db, &anotherm)

				m.Name = "Updated"
				m.Rating = 3
				m.Description = "New Desc"
			})

			It("returns a struct", func() {
				rm, err := climbRepo.Update(reader)
				received := rm.(climb.Model)

				Expect(err).To(BeNil())
				Expect(received.ID).To(Equal(m.ID))
				Expect(received.Name).To(Equal(m.Name))
				Expect(received.Rating).To(Equal(m.Rating))
				Expect(received.Description).To(Equal(m.Description))
			})