mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-05-11 09:17:20 -04:00
* Add comprehensive test coverage for forums - Added `spec/controllers/forums_controller_spec.rb` to test all CRUD actions and authorization for guest, member, and admin roles. - Added `spec/features/forums_spec.rb` to cover user-facing features such as browsing forums and creating posts from within a forum. - Updated `spec/requests/forums_spec.rb` to cover basic request flow and JSON response formats. Note: Tests were verified for content and logic but execution in the sandbox environment was blocked by missing infrastructure (PostgreSQL and Elasticsearch). Co-authored-by: CloCkWeRX <365751+CloCkWeRX@users.noreply.github.com> * Fix specs --------- Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
18 lines
427 B
Plaintext
18 lines
427 B
Plaintext
- content_for :title, t('.title')
|
|
|
|
- if can? :create, Forum
|
|
%p
|
|
= link_to "New forum", new_forum_path, class: 'btn btn-default'
|
|
|
|
- @forums.each do |forum|
|
|
%h2= forum
|
|
%p= forum.description
|
|
%p
|
|
= localize_plural(forum.posts, Post)
|
|
|
|
|
= link_to "Visit forum", forum
|
|
|
|
|
= link_to "Post", new_post_path(forum_id: forum.id)
|
|
= render partial: "posts/summary", locals: { posts: forum.posts, howmany: 4 }
|
|
|