Testing Polymorphic Issue Controller Implementation in maybe-finance
This test suite validates the Issues Controller functionality in a Ruby on Rails application, focusing on polymorphic issue display and user authentication. The tests ensure proper rendering of issue details and verify access control mechanisms for family administrators.
Test Coverage Overview
Implementation Analysis
Technical Details
Best Practices Demonstrated
maybe-finance/maybe
test/controllers/issues_controller_test.rb
require "test_helper"
class IssuesControllerTest < ActionDispatch::IntegrationTest
setup do
sign_in users(:family_admin)
end
test "should get show polymorphically" do
issues.each do |issue|
get issue_url(issue)
assert_response :success
assert_dom "h2", text: issue.title
assert_dom "h3", text: "Issue Description"
assert_dom "h3", text: "How to fix this issue"
end
end
end