Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initial fix attempt for comment/answer markdown #2605

Merged
merged 27 commits into from
Apr 11, 2018

Conversation

jywarren
Copy link
Member

@jywarren jywarren commented Apr 10, 2018

fixes #2604

Starting with tests!

@jywarren jywarren changed the title initial fix attempt initial fix attempt for comment/answer markdown Apr 10, 2018
@PublicLabBot
Copy link

PublicLabBot commented Apr 10, 2018

1 Warning
⚠️ It looks like you merged from master in this pull request. Please rebase to get rid of the merge commits – you may want to rewind the master branch and rebase instead of merging in from master, which can cause problems when accepting new code!
1 Message
📖 @jywarren Thank you for your pull request! I’m here to help with some tips and recommendations. Please take a look at the list provided and help us review and accept your contribution! And don’t be discouraged if you see errors – we’re here to help.

Generated by 🚫 Danger

@jywarren
Copy link
Member Author

This is complete, but I can't figure out how to write the assert_select query to check! Ugh...

@jywarren
Copy link
Member Author

Hmm, @publiclab/reviewers any ideas on how to match these assert_select successfully? I believe the code is correctly generating markdown, as I've confirmed manually. I just need some help getting this test to correctly confirm this so we don't break it again in the future!

@jywarren
Copy link
Member Author

As you can see I've been trying all kinds of things!


get :show, id: node.id

assert_select 'strong', 'markdown'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jywarren don't know how to pull this PR to test locally so i cant test. but instead of "strong" can you please try "b"?

@jywarren
Copy link
Member Author

jywarren commented Apr 11, 2018 via email

@jywarren
Copy link
Member Author

jywarren commented Apr 11, 2018 via email

@siaw23-retired
Copy link
Collaborator

it's weird that i can't find your branch here to pull https://github.com/publiclab/plots2/branches/all?utf8=%E2%9C%93&query=comment :/ @jywarren

@jywarren
Copy link
Member Author

jywarren commented Apr 11, 2018 via email

@jywarren
Copy link
Member Author

Hmm, no luck?

@siaw23-retired
Copy link
Collaborator

i stopped investigating last night cause it was time for sleep but today i looked into it and made some changes: f11e88f and made some comments in the file.

@sagarpreet-chadha
Copy link
Contributor

sagarpreet-chadha commented Apr 11, 2018

Hi @jywarren and @siaw23 !

Adding this line solves this .

comment.save! in the tests .

What do you think ?

@sagarpreet-chadha
Copy link
Contributor

screen shot 2018-04-11 at 6 37 13 pm

@siaw23-retired
Copy link
Collaborator

@sagarpreet-chadha solution i went after. my history shows me doing node.save! 🤦🏾‍♂️ thank you!

@jywarren
Copy link
Member Author

I resolved a small conflict, let's see how this does! Thanks everybody for helping out, i really appreciate it. @Fastie is struggling a bit with commenting while this is broken.

@jywarren
Copy link
Member Author

Copied this solution to the last test -- great catch. I feel a bit silly for missing that!

@jywarren jywarren merged commit d37c7c0 into publiclab:master Apr 11, 2018
@jywarren
Copy link
Member Author

Phew! Deploying to stable to check.

@jywarren
Copy link
Member Author

Confirmed, it works!!! 🎉 🎆 🙌 👍

@sagarpreet-chadha
Copy link
Contributor

Awesome!!!!

SrinandanPai pushed a commit to SrinandanPai/plots2 that referenced this pull request May 5, 2019
* initial fix attempt

* additional tests for question comments and answer comments

* unit tests for comment/answer body_markdown

* test fix

* should resolve some tests

* fix note/node ref in test

* comma

* various test fixes

* functional test fixes

* one more functional test fix

* Update questions_controller_test.rb

* answer comment css selector

* test css nesting

* test css tweaks

* rearranging assert_select

* assert_select fixes

* Update _comment.html.erb

* Update _comment.html.erb

* Update notes_controller_test.rb

* Update notes_controller_test.rb

* Update notes_controller_test.rb

* Fix test for comment/answer markdown

* Clean up nesting

* Looks like a simpler solution

Courtesy of @sagarpreet-chadha

* Clean up

* Update notes_controller_test.rb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Parsing of markdown (formatting) of answers and comments is broken
4 participants