Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Post comments directly to a subject from Octobox #1523
Adds a form to the bottom of the thread view to post a comment on that subject.
I am in two minds as to whether to bother adding a JS action on this as turbolinks is doing a good job of re-rendering. But will happily add if needed.
Future extensions of this might add previews for markdown, file uploading etc. this is just a starter to build upon.
Will need some work to #1484 to ensure that comments aren't re-rendered when receiving the hook back from GH which I'll add there this avo.
It might be easier to test if you extra the logic that picks the client into a separate method, perhaps on
def comment_client(comment) if user.app_token.present? && comment.subject.repository.commentable? user.app_installation_client else github_client end end
Then you can write a couple tests like:
"for user with an app_token, commenting on a commentable repo uses app_installation_client"
Then in each test, you can assert the return value of