Commit 587cb904 authored by Eric Barbour's avatar Eric Barbour

Fix pagure_api_users test and fix @ mention on prs

* Change api tests to expect the newly added mention list
* Use the correct key for the `mention` library
parent e1f29a5d
......@@ -1186,15 +1186,14 @@ $(document).ready(function () {
}
}
);
{% endif %}
$.get("{{ url_for('api_ns.api_users') }}", {
pattern: '*'
}).done(function(resp) {
$("#comment").mention({
data: resp['mention']
users: resp['mention']
});
});
{% endif %}
} );
$(window).on('hashchange', updateHighlight);
var selected = [];
......
......@@ -54,14 +54,14 @@ class PagureFlaskApitests(tests.Modeltests):
self.assertEqual(output.status_code, 200)
data = json.loads(output.data)
self.assertEqual(sorted(data['users']), ['foo', 'pingou'])
self.assertEqual(sorted(data.keys()), ['total_users', 'users'])
self.assertEqual(sorted(data.keys()), ['mention', 'total_users', 'users'])
self.assertEqual(data['total_users'], 2)
output = self.app.get('/api/0/users?pattern=p')
self.assertEqual(output.status_code, 200)
data = json.loads(output.data)
self.assertEqual(data['users'], ['pingou'])
self.assertEqual(sorted(data.keys()), ['total_users', 'users'])
self.assertEqual(sorted(data.keys()), ['mention', 'total_users', 'users'])
self.assertEqual(data['total_users'], 1)
def test_api_project_tags(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment