* create mentor relationship table and begin dashboard * add missing files from previous commit * add mentorship relationship status * remove uniqueness validation * add multiple notes * ban from mentorship deactives all relationships * add untracked files * fix logic issue and add specs * add model specs * add request specs * add request specs and fix linting * fix internal users spec * remove phantom columns * remove bizzaro character * move all attr_accessor to one line
23 lines
691 B
Ruby
23 lines
691 B
Ruby
require "rails_helper"
|
|
|
|
RSpec.describe MentorRelationship, type: :model do
|
|
let(:mentor) { create(:user) }
|
|
let(:mentee) { create(:user) }
|
|
let(:relationship) { MentorRelationship.create(mentor_id: mentor.id, mentee_id: mentee.id) }
|
|
|
|
it "is active" do
|
|
expect(relationship.active).to eq(true)
|
|
end
|
|
|
|
it { is_expected.to belong_to(:mentor) }
|
|
it { is_expected.to belong_to(:mentee) }
|
|
|
|
it "is not the same user" do
|
|
expect(MentorRelationship.create(mentor_id: mentor.id, mentee_id: mentor.id)).to be_invalid
|
|
end
|
|
|
|
it "cannot be a duplicate record" do
|
|
relationship
|
|
expect(MentorRelationship.create(mentor_id: mentor.id, mentee_id: mentee.id)).to be_invalid
|
|
end
|
|
end
|