Commit 12f45c21c09e918bb63a00252c6d5531b57e226b

specs for user stats

Commit diff

spec/models/repository_spec.rb

 
295295 @repository.should_receive(:has_commits?).and_return(false)
296296 @repository.count_commits_from_last_week_by_user(users(:johan)).should == 0
297297 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
299304 it "returns a set of users from a list of commits" do
300305 commits = []
301306 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