| |   |
| 256 | 256 | @repository.should_receive(:has_commits?).and_return(false) |
| 257 | 257 | @repository.count_commits_from_last_week_by_user(users(:johan)).should == 0 |
| 258 | 258 | end |
| 259 | | |
| 259 | |
| 260 | it "has a count_commits_from_the_beginning_by_user of 0 if no commits" do |
| 261 | @repository.should_receive(:has_commits?).and_return(false) |
| 262 | @repository.count_commits_from_the_beginning_by_user(users(:johan)).should == 0 |
| 263 | end |
| 264 | |
| 260 | 265 | it "returns a set of users from a list of commits" do |
| 261 | 266 | commits = [] |
| 262 | 267 | users(:johan, :moe).map(&:email).each do |email| |
| toggle raw diff |
--- a/spec/models/repository_spec.rb
+++ b/spec/models/repository_spec.rb
@@ -256,7 +256,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 = {}) |