-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
79 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
-- 1_11.sql is a migration that enforces uniqueness on URLs in application offers. | ||
ALTER TABLE application_offers ADD UNIQUE (url); | ||
|
||
UPDATE versions SET major=1, minor=11 WHERE component='jimmdb'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,6 +83,29 @@ func (s *applicationOffersSuite) TestOffer(c *gc.C) { | |
c.Assert(results[0].Error.Code, gc.Equals, "unauthorized access") | ||
} | ||
|
||
func (s *applicationOffersSuite) TestCreateMultipleOffersForSameApp(c *gc.C) { | ||
conn := s.open(c, nil, "[email protected]") | ||
defer conn.Close() | ||
client := applicationoffers.NewClient(conn) | ||
|
||
results, err := client.Offer(s.Model.UUID.String, "test-app", []string{s.endpoint.Name}, "[email protected]", "test-offer", "test offer description") | ||
c.Assert(err, gc.Equals, nil) | ||
c.Assert(results, gc.HasLen, 1) | ||
c.Assert(results[0].Error, gc.Equals, (*jujuparams.Error)(nil)) | ||
|
||
// Creating an offer with the same name as above. | ||
results, err = client.Offer(s.Model.UUID.String, "test-app", []string{s.endpoint.Name}, "[email protected]", "test-offer", "test offer description") | ||
c.Assert(err, gc.Equals, nil) | ||
c.Assert(results, gc.HasLen, 1) | ||
c.Assert(results[0].Error, gc.ErrorMatches, `offer [email protected]/model-1.test-offer already exists, use a different name.*`) | ||
|
||
// Creating an offer with a new name. | ||
results, err = client.Offer(s.Model.UUID.String, "test-app", []string{s.endpoint.Name}, "[email protected]", "test-offer-foo", "test offer description") | ||
c.Assert(err, gc.Equals, nil) | ||
c.Assert(results, gc.HasLen, 1) | ||
c.Assert(results[0].Error, gc.Equals, (*jujuparams.Error)(nil)) | ||
} | ||
|
||
func (s *applicationOffersSuite) TestGetConsumeDetails(c *gc.C) { | ||
conn := s.open(c, nil, "[email protected]") | ||
defer conn.Close() | ||
|