Commit 8df3bfb7 authored by Zsolt Benke's avatar Zsolt Benke
Browse files

Comment is optional for feedbacks

parent 42ee6957
Pipeline #21327 passed with stage
in 35 minutes and 13 seconds
......@@ -9,8 +9,6 @@ class Feedback < ApplicationRecord
inverse_of: 'reviewed_feedbacks', optional: true
belongs_to :feedbackable, polymorphic: true, optional: true
validates :comments, presence: true
scope :assignment, (-> { where(feedbackable_type: 'Assignment') })
scope :group_offer, (-> { where(feedbackable_type: 'GroupOffer') })
scope :from_assignments, lambda { |assignment_ids|
......
require 'test_helper'
class FeedbackTest < ActiveSupport::TestCase
test 'feedback with no comments is invalid' do
volunteer = create :volunteer
invalid_feedback = Feedback.new(volunteer: volunteer, author: volunteer.user)
refute invalid_feedback.valid?
assert_equal ["darf nicht leer sein"], invalid_feedback.errors.messages[:comments]
end
test 'since_last_submitted_scope' do
volunteer = create :volunteer
assignment = create :assignment, volunteer: volunteer
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment