Merge pull request #372 from coreos-inc/notifyui
Better notifications UI
This commit is contained in:
commit
523dc912f7
10 changed files with 89 additions and 12 deletions
|
@ -1935,6 +1935,8 @@ class TestRepositoryNotifications(ApiTestCase):
|
|||
self.assertEquals('repo_push', json['event'])
|
||||
self.assertEquals('webhook', json['method'])
|
||||
self.assertEquals('http://example.com', json['config']['url'])
|
||||
self.assertIsNone(json['title'])
|
||||
|
||||
wid = json['uuid']
|
||||
|
||||
# Get the notification.
|
||||
|
@ -1944,6 +1946,7 @@ class TestRepositoryNotifications(ApiTestCase):
|
|||
self.assertEquals(wid, json['uuid'])
|
||||
self.assertEquals('repo_push', json['event'])
|
||||
self.assertEquals('webhook', json['method'])
|
||||
self.assertIsNone(json['title'])
|
||||
|
||||
# Verify the notification is listed.
|
||||
json = self.getJsonResponse(RepositoryNotificationList,
|
||||
|
@ -1962,6 +1965,29 @@ class TestRepositoryNotifications(ApiTestCase):
|
|||
params=dict(repository=ADMIN_ACCESS_USER + '/simple', uuid=wid),
|
||||
expected_code=404)
|
||||
|
||||
# Add another notification.
|
||||
json = self.postJsonResponse(RepositoryNotificationList,
|
||||
params=dict(repository=ADMIN_ACCESS_USER + '/simple'),
|
||||
data=dict(config={'url': 'http://example.com'}, event='repo_push',
|
||||
method='webhook', title='Some Notification'),
|
||||
expected_code=201)
|
||||
|
||||
self.assertEquals('repo_push', json['event'])
|
||||
self.assertEquals('webhook', json['method'])
|
||||
self.assertEquals('http://example.com', json['config']['url'])
|
||||
self.assertEquals('Some Notification', json['title'])
|
||||
|
||||
wid = json['uuid']
|
||||
|
||||
# Get the notification.
|
||||
json = self.getJsonResponse(RepositoryNotification,
|
||||
params=dict(repository=ADMIN_ACCESS_USER + '/simple', uuid=wid))
|
||||
|
||||
self.assertEquals(wid, json['uuid'])
|
||||
self.assertEquals('repo_push', json['event'])
|
||||
self.assertEquals('webhook', json['method'])
|
||||
self.assertEquals('Some Notification', json['title'])
|
||||
|
||||
|
||||
class TestListAndGetImage(ApiTestCase):
|
||||
def test_listandgetimages(self):
|
||||
|
|
Reference in a new issue