2012-01-30 20:39:34 +00:00
|
|
|
# -*- encoding : utf-8 -*-
|
2011-10-13 16:55:03 +01:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe ProjectToRepository do
|
2011-12-23 17:06:47 +00:00
|
|
|
before(:each) do
|
|
|
|
stub_rsync_methods
|
|
|
|
@platform = Factory(:platform)
|
|
|
|
@first_repo = Factory(:repository, :platform_id => @platform.id)
|
|
|
|
@second_repo = Factory(:repository, :platform_id => @platform.id)
|
|
|
|
@project = Factory(:project)
|
|
|
|
@first_repo.projects << @project
|
|
|
|
@first_repo.save
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'should not add the same project in different repositories of same platform' do
|
|
|
|
p2r = @second_repo.project_to_repositories.build :project_id => @project.id
|
|
|
|
p2r.should_not be_valid
|
|
|
|
end
|
2011-10-13 16:55:03 +01:00
|
|
|
end
|