Ejemplo n.º 1
0
		var user model.User
		var keyPath string

		BeforeEach(func() {
			user = auth.Register()
		})

		AfterEach(func() {
			auth.Cancel(user)
		})

		Context("who has added their public key", func() {

			BeforeEach(func() {
				_, keyPath = keys.Add(user)
			})

			Context("and who has a local git repo containing buildpack source code", func() {

				BeforeEach(func() {
					output, err := cmd.Execute(`git clone https://github.com/deis/example-go.git`)
					Expect(err).NotTo(HaveOccurred(), output)
				})

				Context("and has run `deis apps:create` from within that repo", func() {

					var app model.App

					BeforeEach(func() {
						os.Chdir("example-go")
Ejemplo n.º 2
0
		var user model.User

		BeforeEach(func() {
			user = auth.Register()
		})

		AfterEach(func() {
			auth.Cancel(user)
		})

		Context("who has at least one key", func() {

			var keyName string

			BeforeEach(func() {
				keyName, _ = keys.Add(user)
			})

			Specify("that user can list their own keys", func() {
				sess, err := cmd.Start("deis keys:list", &user)
				Eventually(sess, settings.MaxEventuallyTimeout).Should(Say(fmt.Sprintf("%s ssh-rsa", keyName)))
				Expect(err).NotTo(HaveOccurred())
				Eventually(sess).Should(Exit(0))
			})

		})

		Specify("that user can add and remove keys", func() {
			keyName, _ := keys.Add(user)
			keys.Remove(user, keyName)
		})