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

Sign up form validation test #8468

Merged
merged 4 commits into from
Oct 6, 2020
Merged

Conversation

cypherean
Copy link
Contributor

Signup form validation test

Make sure these boxes are checked before your pull request (PR) is ready to be reviewed and merged. Thanks!

  • PR is descriptively titled 📑 and links the original issue above 🔗
  • tests pass -- look for a green checkbox ✔️ a few minutes after opening your PR -- or run tests locally with rake test
  • code is in uniquely-named feature branch and has no merge conflicts 📁
  • screenshots/GIFs are attached 📎 in case of UI updation
  • ask @publiclab/reviewers for help, in a comment below

We're happy to help you get this ready -- don't be afraid to ask for help, and don't be discouraged if your tests fail at first!

If tests do fail, click on the red X to learn why by reading the logs.

Please be sure you've reviewed our contribution guidelines at https://publiclab.org/contributing-to-public-lab-software

Thanks!

@gitpod-io
Copy link

gitpod-io bot commented Oct 6, 2020

@codecov
Copy link

codecov bot commented Oct 6, 2020

Codecov Report

Merging #8468 into main will increase coverage by 1.84%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #8468      +/-   ##
==========================================
+ Coverage   80.06%   81.90%   +1.84%     
==========================================
  Files         101      101              
  Lines        5919     5898      -21     
==========================================
+ Hits         4739     4831      +92     
+ Misses       1180     1067     -113     
Impacted Files Coverage Δ
app/controllers/comment_controller.rb 86.95% <100.00%> (ø)
app/controllers/map_controller.rb 50.00% <100.00%> (ø)
app/controllers/search_controller.rb 97.67% <100.00%> (+2.32%) ⬆️
app/controllers/users_controller.rb 81.04% <100.00%> (+1.04%) ⬆️
app/models/node.rb 91.51% <0.00%> (+0.35%) ⬆️
app/controllers/spam2_controller.rb 71.84% <0.00%> (+0.97%) ⬆️
app/helpers/application_helper.rb 84.70% <0.00%> (+1.17%) ⬆️
app/api/srch/search.rb 66.87% <0.00%> (+1.27%) ⬆️
app/controllers/admin_controller.rb 80.24% <0.00%> (+1.64%) ⬆️
... and 13 more

@jywarren
Copy link
Member

jywarren commented Oct 6, 2020

Just a tiny rewording to clarify the test!

@cypherean
Copy link
Contributor Author

I'm adding a test in this for a duplicate username as well.

@cypherean
Copy link
Contributor Author

#8469 is failing. Have we made the corresponding changes in the code? For the user not to register if the spam test is not passed?

I checked and they fail locally too. Should I open a PR to revert it?

@jywarren
Copy link
Member

jywarren commented Oct 6, 2020

Whoa that is so strange... look, it totally passed when I merged it!

image

What do you see is the error now? can u link me? I think we don't have to revert...

@cypherean
Copy link
Contributor Author

@jywarren
Copy link
Member

jywarren commented Oct 6, 2020

Hmm whoaaaa. Such inconsistency!

 FAIL["test_the_user_is_not_registered_without_passing_spam_", #<Minitest::Reporters::Suite:0x00007f20b1371c38 @name="SignupFormTest">, 104.59803336399997]
 test_the_user_is_not_registered_without_passing_spam_#SignupFormTest (104.60s)
        "User.count" didn't change by 0.
        Expected: 19
          Actual: 20
        test/system/signup_spamaway_test.rb:11:in `block in <class:SignupFormTest>'

Um, i'm working on getting #8467 finished, so why don't we just note that that should solve the problem and then rebase this... and then address the inconsistency later. All of this can happen later though!

Perhaps we should add something after https://github.com/publiclab/plots2/pull/8469/files#diff-e0e966662d6f0b4c06e82346b2605588R18 to ensure that it completes -- the clicking of the signup button doesn't necessarily confirm that the subsequent page has loaded.

For reference, adding a css-based assertion after a click event can help to confirm that the page has indeed reloaded fully:

wait_for_ajax
Capybara.ignore_hidden_elements = true
# Toggle preview
reply_preview_button.click()
# Make sure that image has been uploaded
page.assert_selector('#preview img', count: 1)

@jywarren
Copy link
Member

jywarren commented Oct 6, 2020

Could we add such a css selector to the end of the system test, in this PR, to both system tests, to try to resolve both?

@cypherean
Copy link
Contributor Author

Yeah sure. If it's not urgent can I get back to it tomorrow? I have a class to attend in 4 hours 😅

@jywarren
Copy link
Member

jywarren commented Oct 6, 2020

Oh my gosh Shreya, please go to sleep!!! Go!!! Really it's so important! ❤️

@jywarren
Copy link
Member

jywarren commented Oct 6, 2020

Forgive me, i know i said so but since you wanted to keep going i kept replying. Let's resume this another time! Many thanks!

@cypherean
Copy link
Contributor Author

No worries. I felt responsible for my code. Adios!

@jywarren
Copy link
Member

jywarren commented Oct 6, 2020

It'll be here when you come back 😄

thanks again!

@jywarren
Copy link
Member

jywarren commented Oct 6, 2020

OK -- #8467 is merged! Let's rebase this over to see.

@jywarren jywarren closed this Oct 6, 2020
@jywarren jywarren reopened this Oct 6, 2020
@gitpod-io
Copy link

gitpod-io bot commented Oct 6, 2020

@jywarren jywarren merged commit 19beaf7 into publiclab:main Oct 6, 2020
@jywarren
Copy link
Member

jywarren commented Oct 6, 2020

Done here! Thank you!!!!

shubhangikori pushed a commit to shubhangikori/plots2 that referenced this pull request Oct 12, 2020
* Sign up form validation test

* Update test/system/signup_form_test.rb

* Update test/system/signup_form_test.rb

* Add duplicate username test

Co-authored-by: Jeffrey Warren <jeff@unterbahn.com>
alvesitalo pushed a commit to alvesitalo/plots2 that referenced this pull request Oct 14, 2020
* Sign up form validation test

* Update test/system/signup_form_test.rb

* Update test/system/signup_form_test.rb

* Add duplicate username test

Co-authored-by: Jeffrey Warren <jeff@unterbahn.com>
piyushswain pushed a commit to piyushswain/plots2 that referenced this pull request Oct 22, 2020
* Sign up form validation test

* Update test/system/signup_form_test.rb

* Update test/system/signup_form_test.rb

* Add duplicate username test

Co-authored-by: Jeffrey Warren <jeff@unterbahn.com>
manchere pushed a commit to manchere/plots2 that referenced this pull request Feb 13, 2021
* Sign up form validation test

* Update test/system/signup_form_test.rb

* Update test/system/signup_form_test.rb

* Add duplicate username test

Co-authored-by: Jeffrey Warren <jeff@unterbahn.com>
lagunasmel pushed a commit to lagunasmel/plots2 that referenced this pull request Mar 2, 2021
* Sign up form validation test

* Update test/system/signup_form_test.rb

* Update test/system/signup_form_test.rb

* Add duplicate username test

Co-authored-by: Jeffrey Warren <jeff@unterbahn.com>
reginaalyssa pushed a commit to reginaalyssa/plots2 that referenced this pull request Oct 16, 2021
* Sign up form validation test

* Update test/system/signup_form_test.rb

* Update test/system/signup_form_test.rb

* Add duplicate username test

Co-authored-by: Jeffrey Warren <jeff@unterbahn.com>
ampwang pushed a commit to ampwang/plots2 that referenced this pull request Oct 26, 2021
* Sign up form validation test

* Update test/system/signup_form_test.rb

* Update test/system/signup_form_test.rb

* Add duplicate username test

Co-authored-by: Jeffrey Warren <jeff@unterbahn.com>
billymoroney1 pushed a commit to billymoroney1/plots2 that referenced this pull request Dec 28, 2021
* Sign up form validation test

* Update test/system/signup_form_test.rb

* Update test/system/signup_form_test.rb

* Add duplicate username test

Co-authored-by: Jeffrey Warren <jeff@unterbahn.com>
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.

2 participants