diff options
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/commit_spec.rb | 6 | ||||
-rw-r--r-- | spec/models/project_spec.rb | 7 |
2 files changed, 7 insertions, 6 deletions
diff --git a/spec/models/commit_spec.rb b/spec/models/commit_spec.rb index b84f24bf3ad..73418efd3f2 100644 --- a/spec/models/commit_spec.rb +++ b/spec/models/commit_spec.rb @@ -9,11 +9,11 @@ describe Commit do commit.title.should == "--no commit message" end - it "truncates a message without a newline at 70 characters" do + it "truncates a message without a newline at 80 characters" do message = commit.safe_message * 10 commit.stub(:safe_message).and_return(message) - commit.title.should == "#{message[0..69]}…" + commit.title.should == "#{message[0..79]}…" end it "truncates a message with a newline before 80 characters at the newline" do @@ -27,7 +27,7 @@ describe Commit do message = (commit.safe_message * 10) + "\n" commit.stub(:safe_message).and_return(message) - commit.title.should == "#{message[0..69]}…" + commit.title.should == "#{message[0..79]}…" end end diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index 65acf0c2498..05a54f760f1 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -68,9 +68,10 @@ describe Project do it { should ensure_length_of(:issues_tracker_id).is_within(0..255) } it "should not allow new projects beyond user limits" do - project.stub(:creator).and_return(double(can_create_project?: false, projects_limit: 1)) - project.should_not be_valid - project.errors[:limit_reached].first.should match(/Your own projects limit is 1/) + project2 = build(:project) + project2.stub(:creator).and_return(double(can_create_project?: false, projects_limit: 0)) + project2.should_not be_valid + project2.errors[:limit_reached].first.should match(/Your own projects limit is 0/) end end |