| ... | @@ -4,11 +4,15 @@ describe Project do |
... | @@ -4,11 +4,15 @@ describe Project do |
|
|
describe "Associations" do
|
|
describe "Associations" do
|
|
|
it { should have_many(:users) }
|
|
it { should have_many(:users) }
|
|
|
it { should have_many(:users_projects) }
|
|
it { should have_many(:users_projects) }
|
|
|
|
it { should have_many(:issues) }
|
|
|
|
it { should have_many(:notes) }
|
|
|
|
it { should have_many(:snippets) }
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
describe "Validation" do
|
|
describe "Validation" do
|
|
|
it { should validate_presence_of(:name) }
|
|
it { should validate_presence_of(:name) }
|
|
|
it { should validate_presence_of(:path) }
|
|
it { should validate_presence_of(:path) }
|
|
|
|
it { should validate_presence_of(:code) }
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
describe "Respond to" do
|
|
describe "Respond to" do
|
| ... | @@ -31,6 +35,11 @@ describe Project do |
... | @@ -31,6 +35,11 @@ describe Project do |
|
|
it { should respond_to(:commit) }
|
|
it { should respond_to(:commit) }
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
|
it "should not allow 'gitosis-admin' as repo name" do
|
|
|
|
should allow_value("blah").for(:path)
|
|
|
|
should_not allow_value("gitosis-admin").for(:path)
|
|
|
|
end
|
|
|
|
|
|
|
it "should return valid url to repo" do
|
|
it "should return valid url to repo" do
|
|
|
project = Project.new(:path => "somewhere")
|
|
project = Project.new(:path => "somewhere")
|
|
|
project.url_to_repo.should == "git@localhost:somewhere.git"
|
|
project.url_to_repo.should == "git@localhost:somewhere.git"
|
| ... | |
... | |
| ... | | ... | |