| |   |
| 295 | 295 | @repository.should_receive(:has_commits?).and_return(false) |
| 296 | 296 | @repository.count_commits_from_last_week_by_user(users(:johan)).should == 0 |
| 297 | 297 | end |
| 298 | | |
| 298 | |
| 299 | it "has a count_commits_from_the_beginning_by_user of 0 if no commits" do |
| 300 | @repository.should_receive(:has_commits?).and_return(false) |
| 301 | @repository.count_commits_from_the_beginning_by_user(users(:johan)).should == 0 |
| 302 | end |
| 303 | |
| 299 | 304 | it "returns a set of users from a list of commits" do |
| 300 | 305 | commits = [] |
| 301 | 306 | users(:johan, :moe).map(&:email).each do |email| |
| toggle raw diff |
--- a/spec/models/repository_spec.rb
+++ b/spec/models/repository_spec.rb
@@ -295,7 +295,12 @@ describe Repository do
@repository.should_receive(:has_commits?).and_return(false)
@repository.count_commits_from_last_week_by_user(users(:johan)).should == 0
end
-
+
+ it "has a count_commits_from_the_beginning_by_user of 0 if no commits" do
+ @repository.should_receive(:has_commits?).and_return(false)
+ @repository.count_commits_from_the_beginning_by_user(users(:johan)).should == 0
+ end
+
it "returns a set of users from a list of commits" do
commits = []
users(:johan, :moe).map(&:email).each do |email| |
| |   |
| 153 | 153 | password = u.reset_password! |
| 154 | 154 | User.authenticate(u.email, password).should_not be_nil |
| 155 | 155 | end |
| 156 | |
| 157 | it "has a count_commits_from_last_week of 0 if no commits" do |
| 158 | users(:johan).count_commits_from_the_beginning.should == 0 |
| 159 | end |
| 160 | |
| 161 | it "has a count_commits_from_the_beginning of 0 if no commits" do |
| 162 | users(:johan).count_commits_from_the_beginning.should == 0 |
| 163 | end |
| 156 | 164 | |
| 157 | 165 | protected |
| 158 | 166 | def create_user(options = {}) |
| toggle raw diff |
--- a/spec/models/user_spec.rb
+++ b/spec/models/user_spec.rb
@@ -153,6 +153,14 @@ describe User do
password = u.reset_password!
User.authenticate(u.email, password).should_not be_nil
end
+
+ it "has a count_commits_from_last_week of 0 if no commits" do
+ users(:johan).count_commits_from_the_beginning.should == 0
+ end
+
+ it "has a count_commits_from_the_beginning of 0 if no commits" do
+ users(:johan).count_commits_from_the_beginning.should == 0
+ end
protected
def create_user(options = {}) |