course_participation_test.rb 424 B

123456789101112131415161718
  1. require 'test_helper'
  2. class CourseParticipationTest < ActiveSupport::TestCase
  3. def setup
  4. @participation = course_participations(:one)
  5. @user = users(:daniel)
  6. @course = courses(:one)
  7. end
  8. test "should be valid" do
  9. assert @participation.valid?
  10. end
  11. test "should filter by role correctly" do
  12. filtered = @course.users.merge(CourseParticipation.teachers)
  13. assert_equal filtered, [@user]
  14. end
  15. end