mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-24 03:56:05 +10:00
23 lines
681 B
Ruby
23 lines
681 B
Ruby
require 'spec_helper'
|
|
|
|
describe ProjectGroupLink do
|
|
describe "Associations" do
|
|
it { should belong_to(:group) }
|
|
it { should belong_to(:project) }
|
|
end
|
|
|
|
describe "Mass assignment" do
|
|
it { should_not allow_mass_assignment_of(:group_id) }
|
|
it { should_not allow_mass_assignment_of(:project_id) }
|
|
end
|
|
|
|
describe "Validation" do
|
|
let!(:project_group_link) { create(:project_group_link) }
|
|
|
|
it { should validate_presence_of(:project_id) }
|
|
it { should validate_uniqueness_of(:group_id).scoped_to(:project_id).with_message(/already shared/) }
|
|
it { should validate_presence_of(:group_id) }
|
|
it { should validate_presence_of(:group_access) }
|
|
end
|
|
end
|