Sha256: a10fdc76c9e27d8fcbce1ab99c819901413a3134a9e99b41d3724c1b08f82c54

Contents?: true

Size: 592 Bytes

Versions: 5

Compression:

Stored size: 592 Bytes

Contents

# frozen_string_literal: true
require "spec_helper"

module SocialNetworking
  describe ProfileAnswer, type: :model do
    fixtures :all

    let(:old_answer) { social_networking_profile_answers(:profile_answer1) }

    it "validates the uniqueness of a profile question and profile" do
      new_answer = ProfileAnswer.new(old_answer.attributes).tap(&:valid?)

      expect(new_answer.errors[:social_networking_profile_question_id].size)
        .to eq 1
      expect(new_answer.errors[:social_networking_profile_question_id][0])
        .to eq "has already been answered"
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
social_networking-0.13.3 spec/models/social_networking/profile_answer_spec.rb
social_networking-0.13.2 spec/models/social_networking/profile_answer_spec.rb
social_networking-0.13.1 spec/models/social_networking/profile_answer_spec.rb
social_networking-0.13.0 spec/models/social_networking/profile_answer_spec.rb
social_networking-0.12.0 spec/models/social_networking/profile_answer_spec.rb