summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorgitlabhq <m@gitlabhq.com>2011-10-21 21:40:36 +0300
committergitlabhq <m@gitlabhq.com>2011-10-22 14:08:03 +0300
commit1a9531c9a42e380d922de98ad1658e85ac5fbde6 (patch)
tree37c77036ac3877068e26b94beda075c2f41de9dc /spec
parent29e11d1461a5689ff295adb035e38564701ad377 (diff)
downloadgitlab-ce-1a9531c9a42e380d922de98ad1658e85ac5fbde6.tar.gz
fix #140, commit lil refactor
Diffstat (limited to 'spec')
-rw-r--r--spec/models/project_spec.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb
index 6ed8653d761..0c62743d8e8 100644
--- a/spec/models/project_spec.rb
+++ b/spec/models/project_spec.rb
@@ -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"