github.com/lukasheimann/cloudfoundrycli@v7.1.0+incompatible/command/translatableerror/unauthorized_error_test.go (about)

     1  package translatableerror_test
     2  
     3  import (
     4  	. "code.cloudfoundry.org/cli/command/translatableerror"
     5  
     6  	. "github.com/onsi/ginkgo"
     7  	. "github.com/onsi/ginkgo/extensions/table"
     8  	. "github.com/onsi/gomega"
     9  )
    10  
    11  var _ = Describe("UnauthorizedError", func() {
    12  	DescribeTable("error",
    13  		func(message string, expected string) {
    14  			Expect(UnauthorizedError{Message: message}).To(MatchError(expected))
    15  		},
    16  		Entry("bad credentials returns custom message", "Bad credentials", "Credentials were rejected, please try again."),
    17  		Entry("invalid origin returns custom message", "The origin provided in the login hint is invalid.", "The origin provided is invalid."),
    18  		Entry("umatched origin returns custom message", "The origin provided in the login_hint does not match an active Identity Provider, that supports password grant.", "The origin provided is invalid."),
    19  		Entry("anything else", "I am a BANANA", "I am a BANANA"),
    20  	)
    21  })