Files
project-work/worker-toolkit-stocks-in-the-future/repo/test/system/announcements_test.rb
Eric Bell 392781f7aa chore: init commit
in worker.../repo/GITFOLDER.zip is the .git folder.
2026-08-11 14:44:09 -04:00

39 lines
893 B
Ruby

# frozen_string_literal: true
require "application_system_test_case"
class AnnouncementsTest < ApplicationSystemTestCase
setup do
@announcement = Announcement.create!(
title: "Test Announcement",
content: "Test content"
)
end
test "students can view announcements" do
student = create(:student)
sign_in student
visit announcement_url(@announcement)
assert_text @announcement.title
end
test "teachers can view announcements" do
teacher = create(:teacher)
sign_in teacher
visit announcement_url(@announcement)
assert_text @announcement.title
end
test "should display announcement content properly" do
student = create(:student)
sign_in student
visit announcement_url(@announcement)
assert_text @announcement.title
# ActionText content should be displayed
assert_selector ".trix-content"
end
end