Refactor JS functions add_tag() and create add_comment() for pure JS API #6411
Labels
feature
explains that the issue is to add a new feature
help wanted
requires help by anyone willing to contribute
JavaScript
testing
issues are usually for adding unit tests, integration tests or any other tests for a feature
We have a JavaScript function to add tags, here:
plots2/app/assets/javascripts/tagging.js
Lines 1 to 13 in 86ea8ba
However, it uses the on-page HTML tag form to do this. We should be able to do this directly using AJAX without using an HTML form.
Secondly, we should implement the same functionality for an
add_comment('Comment body here')
function, similarly AJAX based.Our functional tests show how these should be possible to run directly, instead of via the HTML page:
plots2/test/functional/comment_controller_test.rb
Lines 43 to 53 in 86ea8ba
plots2/test/functional/tag_controller_test.rb
Lines 9 to 12 in 86ea8ba
We should create a system test to confirm that these javascript functions actually work! You can run javascript in a system test like this:
plots2/test/system/search_test.rb
Lines 26 to 27 in 86ea8ba
The text was updated successfully, but these errors were encountered: