Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Project#branch isn't nullable

  • Loading branch information...
commit 3605faec16cf407db58414fd1151de1e4982d57f 1 parent 0efd482
@sr sr authored
Showing with 8 additions and 2 deletions.
  1. +1 −1  lib/integrity/project.rb
  2. +7 −1 test/unit/project_test.rb
View
2  lib/integrity/project.rb
@@ -10,7 +10,7 @@ class Project
property :permalink, String
property :uri, URI, :nullable => false, :length => 255
property :scm, String, :nullable => false, :default => "git"
- property :branch, String, :nullable => true, :default => "master"
+ property :branch, String, :nullable => false, :default => "master"
property :command, String, :nullable => false, :length => 255, :default => "rake"
property :public, Boolean, :default => true
View
8 test/unit/project_test.rb
@@ -36,7 +36,7 @@ class ProjectTest < Test::Unit::TestCase
it "has a branch" do
assert_equal "master", @project.branch
- assert_equal "master", Project.new.branch
+ assert_equal "master", Project.new.branch
end
it "has a command" do
@@ -98,6 +98,12 @@ class ProjectTest < Test::Unit::TestCase
}
end
+ it "requires a branch" do
+ assert_no_change(Project, :count) {
+ ! Project.gen(:branch => nil).valid?
+ }
+ end
+
it "requires a command" do
assert_no_change(Project, :count) {
assert ! Project.gen(:command => nil).valid?
Please sign in to comment.
Something went wrong with that request. Please try again.