osem-fcy/spec/models/survey_reply_spec.rb

28 lines
683 B
Ruby
Raw Normal View History

# frozen_string_literal: true
2021-02-20 09:57:27 -08:00
# == Schema Information
#
# Table name: survey_replies
#
# id :bigint not null, primary key
# text :text
# created_at :datetime not null
# updated_at :datetime not null
# survey_question_id :integer
# user_id :integer
#
2018-02-08 21:02:16 +02:00
require 'spec_helper'
describe SurveyReply do
subject { create(:survey_reply) }
describe 'association' do
it { is_expected.to belong_to(:user) }
it { is_expected.to belong_to(:survey_question) }
end
describe 'validation' do
it { is_expected.to validate_uniqueness_of(:survey_question_id).scoped_to(:user_id) }
end
end