Commit graph

10 commits

Author SHA1 Message Date
Joshua Wehner
8216700858
Trusted user _can_ use moderator comment (#20158)
* Trusted user _can_ use moderator comment

* Update spec to confirm cannot create

* Trusted user is trusted

* Better mod template access
2023-09-26 10:24:37 -04:00
Mac Siri
842e6880b8
Routine rubocop fix on /spec (#19217)
* Softrun rubocop

* Hardrun rubocop (-A)

* Change a rubocop rule

* Add missing cops

* Undo & redo rubocop -A
2023-03-21 09:55:26 -04:00
Anna Buianova
7d053471f8
Rubocop fixes in spec/requests (#18946)
* Rubocop fixes in spec/requests

* Fixed spec/requests/api/v0/articles_spec.rb

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>

Co-authored-by: Ridhwana <Ridhwana.Khan16@gmail.com>
2023-01-12 19:10:16 +03:00
Mac Siri
43829bdb96
Change requirement for response_template (#18601) 2022-11-02 12:16:17 -04:00
Joshua Wehner
5dee4a11c1
Allow trusted user to access response templates (#17978)
* Allow trusted user to access response templates

* Add request specs for trusted user templates

* WIP: was just investigating...

* Move permission check to authorizer

* Revert "WIP: was just investigating..."

This reverts commit c38c60f7ab19ce43c174729c2542a9041e9322e2.

* Improved accessibility

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>

Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2022-07-12 11:37:59 +02:00
Joshua Wehner
07e1364f54
Trusted users can view & use moderator response templates (#17867)
* Trusted users can use moderator response templates

* Iron out container reveal logic

* Explanatory comment on controller endpoint confusion
2022-06-16 14:05:49 +02:00
rhymes
5b62811c98
[deploy] Rubocop: fix violations of Layout/LineLength (#9197) 2020-07-08 08:36:36 -05:00
Ernesto Tagwerker
9ea3a8c67d
Upgrade to Rails 6.0 (#7658)
* Add dual booting logic to Gemfile

This might be helpful for the Rails 6.0 upgrade project.

* Add more than one gemfile to Travis' configuration

We want to see how the application behaves with more than one Rails versions:

- Gemfile -> Rails 5.2
- Gemfile.next -> Rails 6.0

This will help us figure out what needs to be addressed before migrating to Rails 6.0.

If you want to read more about this technique (dual booting) you can check out this page: https://www.fastruby.io/blog/upgrade-rails/dual-boot/dual-boot-with-rails-6-0-beta.html

* Fix joins

* Upgrade Gemfile.next.lock

* Make sure we're installing the correct versions of gems

* Add Rails 6 notes

* Update rubocop in Gemfile.next.lock

* Fix organization spec

* Fix page_views_spec

* Add Rails 6 and run rails app:update

* Remove some tricks

* Remove Gemfile.next for now

* Fix .content_type deprecation

* Fix deprecation of .where.not NAND/NOR behavior

* Fix deprecation of parameterized emails

* Fix specs

* Remove next flag for now

* Fix spec (hopefully)

* Add wait_for_javascript

* Fix spec, thanks @maestromac!

* Try without wait for javascript hack

* Remove unnecessary bin/update

* Remove file that snuck in the rebase

* Update the vendored gems

* Replace migrate+db:setup with db:prepare

* Update vendored gems

* Fix Gemfile.lock and update vendored stuff

* Fix Gemfile.lock to be the same as master's minus the changes

Co-authored-by: rhymes <rhymesete@gmail.com>
2020-06-04 11:54:25 +02:00
Andy Zhao
f5ec83653c
[deploy] Finalize and add response templates feature (#7068) 2020-04-16 15:53:29 -04:00
Andy Zhao
1a989bef07
[deploy] Add response templates to user settings (#6823)
* Add response templates controller, routes, and view

* Add response templates settings page

* Remove dead code

* Use proper variable oops

* Use proper indentation

* Use before action for checking current_user

* Remove index action temporarily

* Use url helpers for redirects

* Use form_with over form_tag and form_for

* Persist previous content if edit fails

* Use exists for performance

* Remove index spec and add CRUD specs

* Memoize @response_template

* Use workaround for sad paths b/c render doesn't work

* Refactor and extract permitted_attributes into var

* Use present over exists to preload into memory

* Use last over first

* Lint for codeclimate

* Use two redirects for happy and sad create path

* Remove proper index route oops

* Codeclimate comma sigh
2020-03-26 14:48:00 -04:00