Commit 8377e992182aea7d0b15a506a07e6639d47f057e

specs for user stats

Commit diff

spec/models/repository_spec.rb

 
256256 @repository.should_receive(:has_commits?).and_return(false)
257257 @repository.count_commits_from_last_week_by_user(users(:johan)).should == 0
258258 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
260265 it "returns a set of users from a list of commits" do
261266 commits = []
262267 users(:johan, :moe).map(&:email).each do |email|
toggle raw diff

spec/models/user_spec.rb

 
153153 password = u.reset_password!
154154 User.authenticate(u.email, password).should_not be_nil
155155 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
156164
157165 protected
158166 def create_user(options = {})
toggle raw diff