Closed patrickkettner closed 9 years ago
@patrickkettner I know the test suite is non-existent … but do you think you'd be able to add a test for this?
fer sure
actually quick bikeshedding question -
Obviously I would get this error if I try to reregister a package that is already in the registry, but should there be a different response for packages that are already registered vs conflicting pacakges.
e.g. if I was to register github.com/patrickkettner/jquery
, should I get a Package Already Registered
err or a Conflict
err?
Hmm. In your example the issue is the package name, so it should be a Conflict
.
Package Already Registered
is a bit ambiguous. Perhaps the message could be:
<pkgName> is already registered
fer sure
You rule :metal:
@patrickkettner sorry for the delay, but a few things had to happen before this PR. I'd like to merge it. Could you be so kind to rebase your PR?
sorry for dropping this - the change is incredibly minimal, but the tests proved to be a pain in the arse (getting travis to set up a postgres db, specifically). I'll dig into this more soon
Np, would stubbing w/ sinonjs help?
Im not sure - having to stub out all of the underlying db calls may be more work than just getting a DB running
Sorry quick question - shouldn't this be a 409
?
409
- Conflict - Indicates that the request could not be processed because of conflict in the request, such as an edit conflict in the case of multiple updates.
406
- Not Acceptable - The requested resource is only capable of generating content not acceptable according to the Accept headers sent in the request.
That was my original iea, however the bower client is already listening for a 406
Client has been already updated to handle 403, but I liked the tests, so I commited them: https://github.com/bower/registry/commit/c36cfdb979f234ca2d6b4974778cd73bd4af661d
The registry-client is already listening for this code, so we should send it.