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

Don't let newcomers edit wiki pages (controller-level) #8250

Merged
merged 10 commits into from
Aug 5, 2020

Conversation

jywarren
Copy link
Member

@jywarren jywarren commented Aug 4, 2020

No description provided.

@gitpod-io
Copy link

gitpod-io bot commented Aug 4, 2020

@codecov
Copy link

codecov bot commented Aug 4, 2020

Codecov Report

Merging #8250 into main will decrease coverage by 0.25%.
The diff coverage is 63.49%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #8250      +/-   ##
==========================================
- Coverage   81.70%   81.44%   -0.26%     
==========================================
  Files         100      101       +1     
  Lines        5847     5873      +26     
==========================================
+ Hits         4777     4783       +6     
- Misses       1070     1090      +20     
Impacted Files Coverage Δ
app/controllers/spam2_controller.rb 61.53% <7.14%> (-14.06%) ⬇️
app/controllers/batch_controller.rb 67.96% <67.96%> (ø)
app/controllers/wiki_controller.rb 85.22% <100.00%> (+0.22%) ⬆️
app/models/node_tag.rb 100.00% <100.00%> (ø)
app/models/tag.rb 97.47% <100.00%> (-0.03%) ⬇️
app/api/srch/search.rb 70.06% <0.00%> (+3.82%) ⬆️
app/services/execute_search.rb 94.44% <0.00%> (+5.55%) ⬆️

@jywarren
Copy link
Member Author

jywarren commented Aug 4, 2020

Great -

 FAIL["test_disallow_viewing_edit_wiki_page_for_first-timers", #<Minitest::Reporters::Suite:0x0000000012000048 @name="WikiControllerTest">, 81.481001566]
 test_disallow_viewing_edit_wiki_page_for_first-timers#WikiControllerTest (81.48s)
        --- expected
        +++ actual
        @@ -1 +1 @@
        -nil
        +"Please post a question or other content before editing the wiki. Click <a href='https://publiclab.org/notes/tester/04-23-2016/new-moderation-system-for-first-time-posters'>here</a> to learn why."
        test/functional/wiki_controller_test.rb:150:in `block in <class:WikiControllerTest>'

@jywarren
Copy link
Member Author

jywarren commented Aug 4, 2020

Hmm:

 FAIL["test_basic_user_blocked_from_editing_a_locked_wiki_page", #<Minitest::Reporters::Suite:0x000000000b7bdee0 @name="WikiControllerTest">, 43.298456568999995]
 test_basic_user_blocked_from_editing_a_locked_wiki_page#WikiControllerTest (43.30s)
        --- expected
        +++ actual
        @@ -1 +1 @@
        -nil
        +"This page is <a href='/wiki/power-tags#Locking'>locked</a>, and only <a href='/wiki/moderators'>moderators</a> can edit it."
        test/functional/wiki_controller_test.rb:173:in `block in <class:WikiControllerTest>'
 FAIL["test_viewing_edit_wiki_page", #<Minitest::Reporters::Suite:0x0000000009f8a468 @name="WikiControllerTest">, 47.288350495]
 test_viewing_edit_wiki_page#WikiControllerTest (47.29s)
        expecting <"wiki/edit"> but rendering with <[]>
        test/functional/wiki_controller_test.rb:135:in `block in <class:WikiControllerTest>'

Oh, i should use a different wiki page!

@jywarren
Copy link
Member Author

jywarren commented Aug 4, 2020

Hmm. I can't seem to get past these two test failures... very strange.

@jywarren
Copy link
Member Author

jywarren commented Aug 4, 2020

Trying to remove the logout/login code to see if we fail our new test instead of those other two... i can't otherwise see how we're affecting them?

    UserSession.find.destroy if UserSession.find
    UserSession.create(users(:newcomer))

@jywarren
Copy link
Member Author

jywarren commented Aug 5, 2020

OK! all that's left is:

 FAIL["test_viewing_edit_wiki_page", #<Minitest::Reporters::Suite:0x000000000db38c58 @name="WikiControllerTest">, 75.507005142]
 test_viewing_edit_wiki_page#WikiControllerTest (75.51s)
        expecting <"wiki/edit"> but rendering with <[]>
        test/functional/wiki_controller_test.rb:135:in `block in <class:WikiControllerTest>'

@jywarren
Copy link
Member Author

jywarren commented Aug 5, 2020

 FAIL["test_viewing_edit_wiki_page", #<Minitest::Reporters::Suite:0x000000000cfccdb0 @name="WikiControllerTest">, 11.398483155999998]
 test_viewing_edit_wiki_page#WikiControllerTest (11.40s)
        Expected true to be nil or false
        test/functional/wiki_controller_test.rb:135:in `block in <class:WikiControllerTest>'

@jywarren
Copy link
Member Author

jywarren commented Aug 5, 2020

LOL ok Bob is a first-timer, thus failing the original test!

@jywarren
Copy link
Member Author

jywarren commented Aug 5, 2020

Whew!!!

@jywarren jywarren merged commit 1ceffde into main Aug 5, 2020
dms-yondy pushed a commit to dms-yondy/plots2 that referenced this pull request Aug 7, 2020
* Don't let newcomers edit wiki pages (controller-level)

* Update wiki_controller.rb

* Update wiki_controller_test.rb

* Update wiki_controller_test.rb

* Update wiki_controller_test.rb

* Update wiki_controller_test.rb

* Update wiki_controller.rb

* Update wiki_controller.rb

* Update wiki_controller_test.rb

* Update wiki_controller_test.rb
jywarren added a commit that referenced this pull request Aug 12, 2020
* paginate tag page listings (#8243)

* Update _graph.html.erb

* Update show.html.erb

* topic card count fixes for #7965 (#8249)

* fixes for #7965

* count fixes

* Update _topicCard.html.erb

* Delete _related_tags.html.erb (#8247)

* Fixes to tag counting logic (#8245)

* Update tag_test.rb

* Update tag_test.rb

* Update tag_test.rb

* Update tag.rb

* Spam2: Moderator's Queue  feature (#8196)

* queue feature spam2

* indentation issue

* bulk moderation for comments and tag count in queue

* indentation

* moderator queue

* batch controller

* first-timmer issue

* tag filter

* queue indentation

* all tags filter queue

* Don't let newcomers edit wiki pages (controller-level) (#8250)

* Don't let newcomers edit wiki pages (controller-level)

* Update wiki_controller.rb

* Update wiki_controller_test.rb

* Update wiki_controller_test.rb

* Update wiki_controller_test.rb

* Update wiki_controller_test.rb

* Update wiki_controller.rb

* Update wiki_controller.rb

* Update wiki_controller_test.rb

* Update wiki_controller_test.rb

* Bump rubocop from 0.88.0 to 0.89.0

Bumps [rubocop](https://github.com/rubocop-hq/rubocop) from 0.88.0 to 0.89.0.
- [Release notes](https://github.com/rubocop-hq/rubocop/releases)
- [Changelog](https://github.com/rubocop-hq/rubocop/blob/master/CHANGELOG.md)
- [Commits](rubocop/rubocop@v0.88.0...v0.89.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Bump codecov from 0.2.3 to 0.2.5

Bumps [codecov](https://github.com/codecov/codecov-ruby) from 0.2.3 to 0.2.5.
- [Release notes](https://github.com/codecov/codecov-ruby/releases)
- [Changelog](https://github.com/codecov/codecov-ruby/blob/master/CHANGELOG.md)
- [Commits](codecov/codecov-ruby@v0.2.3...v0.2.5)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Bump rdiscount from 2.2.0.1 to 2.2.0.2

Bumps [rdiscount](https://github.com/davidfstr/rdiscount) from 2.2.0.1 to 2.2.0.2.
- [Release notes](https://github.com/davidfstr/rdiscount/releases)
- [Changelog](https://github.com/davidfstr/rdiscount/blob/master/CHANGELOG.md)
- [Commits](davidfstr/rdiscount@2.2.0.1...2.2.0.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Adding tags to Modals of Nodes (#8238)

* adding tags in modals of Nodes #8230

* refactored #8230

* fixed tag path in the modal #8230
also fixed extra spacing when no tags on the modal

* update _flags.html.erb (#8237)

Changed "btn btn-xs" to "btn btn-sm"

* adjust opengraph tag

Co-authored-by: Jeffrey Warren <jeff@unterbahn.com>
Co-authored-by: Keshav Sethi <36025262+keshavsethi@users.noreply.github.com>
Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: renugasaraswathy <renugasaraswathy@gmail.com>
Co-authored-by: siddhama <54734665+siddhama@users.noreply.github.com>
nadimakhtar97 pushed a commit to nadimakhtar97/plots2 that referenced this pull request Sep 21, 2020
* Don't let newcomers edit wiki pages (controller-level)

* Update wiki_controller.rb

* Update wiki_controller_test.rb

* Update wiki_controller_test.rb

* Update wiki_controller_test.rb

* Update wiki_controller_test.rb

* Update wiki_controller.rb

* Update wiki_controller.rb

* Update wiki_controller_test.rb

* Update wiki_controller_test.rb
shubhangikori pushed a commit to shubhangikori/plots2 that referenced this pull request Oct 12, 2020
* Don't let newcomers edit wiki pages (controller-level)

* Update wiki_controller.rb

* Update wiki_controller_test.rb

* Update wiki_controller_test.rb

* Update wiki_controller_test.rb

* Update wiki_controller_test.rb

* Update wiki_controller.rb

* Update wiki_controller.rb

* Update wiki_controller_test.rb

* Update wiki_controller_test.rb
alvesitalo pushed a commit to alvesitalo/plots2 that referenced this pull request Oct 14, 2020
* Don't let newcomers edit wiki pages (controller-level)

* Update wiki_controller.rb

* Update wiki_controller_test.rb

* Update wiki_controller_test.rb

* Update wiki_controller_test.rb

* Update wiki_controller_test.rb

* Update wiki_controller.rb

* Update wiki_controller.rb

* Update wiki_controller_test.rb

* Update wiki_controller_test.rb
piyushswain pushed a commit to piyushswain/plots2 that referenced this pull request Oct 22, 2020
* Don't let newcomers edit wiki pages (controller-level)

* Update wiki_controller.rb

* Update wiki_controller_test.rb

* Update wiki_controller_test.rb

* Update wiki_controller_test.rb

* Update wiki_controller_test.rb

* Update wiki_controller.rb

* Update wiki_controller.rb

* Update wiki_controller_test.rb

* Update wiki_controller_test.rb
manchere pushed a commit to manchere/plots2 that referenced this pull request Feb 13, 2021
* Don't let newcomers edit wiki pages (controller-level)

* Update wiki_controller.rb

* Update wiki_controller_test.rb

* Update wiki_controller_test.rb

* Update wiki_controller_test.rb

* Update wiki_controller_test.rb

* Update wiki_controller.rb

* Update wiki_controller.rb

* Update wiki_controller_test.rb

* Update wiki_controller_test.rb
lagunasmel pushed a commit to lagunasmel/plots2 that referenced this pull request Mar 2, 2021
* Don't let newcomers edit wiki pages (controller-level)

* Update wiki_controller.rb

* Update wiki_controller_test.rb

* Update wiki_controller_test.rb

* Update wiki_controller_test.rb

* Update wiki_controller_test.rb

* Update wiki_controller.rb

* Update wiki_controller.rb

* Update wiki_controller_test.rb

* Update wiki_controller_test.rb
reginaalyssa pushed a commit to reginaalyssa/plots2 that referenced this pull request Oct 16, 2021
* Don't let newcomers edit wiki pages (controller-level)

* Update wiki_controller.rb

* Update wiki_controller_test.rb

* Update wiki_controller_test.rb

* Update wiki_controller_test.rb

* Update wiki_controller_test.rb

* Update wiki_controller.rb

* Update wiki_controller.rb

* Update wiki_controller_test.rb

* Update wiki_controller_test.rb
ampwang pushed a commit to ampwang/plots2 that referenced this pull request Oct 26, 2021
* Don't let newcomers edit wiki pages (controller-level)

* Update wiki_controller.rb

* Update wiki_controller_test.rb

* Update wiki_controller_test.rb

* Update wiki_controller_test.rb

* Update wiki_controller_test.rb

* Update wiki_controller.rb

* Update wiki_controller.rb

* Update wiki_controller_test.rb

* Update wiki_controller_test.rb
billymoroney1 pushed a commit to billymoroney1/plots2 that referenced this pull request Dec 28, 2021
* Don't let newcomers edit wiki pages (controller-level)

* Update wiki_controller.rb

* Update wiki_controller_test.rb

* Update wiki_controller_test.rb

* Update wiki_controller_test.rb

* Update wiki_controller_test.rb

* Update wiki_controller.rb

* Update wiki_controller.rb

* Update wiki_controller_test.rb

* Update wiki_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.

1 participant