fix #140, commit lil refactor

This commit is contained in:
gitlabhq 2011-10-21 21:40:36 +03:00
parent 29e11d1461
commit 1a9531c9a4
5 changed files with 59 additions and 38 deletions

View file

@ -4,11 +4,15 @@ describe Project do
describe "Associations" do
it { should have_many(:users) }
it { should have_many(:users_projects) }
it { should have_many(:issues) }
it { should have_many(:notes) }
it { should have_many(:snippets) }
end
describe "Validation" do
it { should validate_presence_of(:name) }
it { should validate_presence_of(:path) }
it { should validate_presence_of(:code) }
end
describe "Respond to" do
@ -31,6 +35,11 @@ describe Project do
it { should respond_to(:commit) }
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
project = Project.new(:path => "somewhere")
project.url_to_repo.should == "git@localhost:somewhere.git"