diff options
author | Hannes Rosenögger <123haynes@gmail.com> | 2015-03-13 11:39:26 +0100 |
---|---|---|
committer | Hannes Rosenögger <123haynes@gmail.com> | 2015-03-18 08:42:42 +0100 |
commit | 9e5738b0072f8715d52801f3469be9f3742beb97 (patch) | |
tree | e6f83c4c42e05309ef20150796aefe372026e68f /spec/models | |
parent | dbd347bfa00e133da8ac178612ed8c30ef871ca4 (diff) | |
download | gitlab-ce-9e5738b0072f8715d52801f3469be9f3742beb97.tar.gz |
Extend the commit calendar to show the actual commits for a date
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/repository_spec.rb | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/spec/models/repository_spec.rb b/spec/models/repository_spec.rb index b3a38f6c5b9..0e3e0b167d7 100644 --- a/spec/models/repository_spec.rb +++ b/spec/models/repository_spec.rb @@ -29,7 +29,7 @@ describe Repository do subject { repository.timestamps_by_user_log(user) } - it { is_expected.to eq(["2014-08-06", "2014-07-31", "2014-07-31"]) } + it { is_expected.to eq(['2014-08-06', '2014-07-31', '2014-07-31']) } end describe 'multiple emails for user' do @@ -38,7 +38,22 @@ describe Repository do subject { repository.timestamps_by_user_log(user) } - it { is_expected.to eq(["2015-01-10", "2014-08-06", "2014-07-31", "2014-07-31"]) } + it { is_expected.to eq(['2015-01-10', '2014-08-06', '2014-07-31', '2014-07-31']) } + end + end + + context :commits_by_user_on_date_log do + + describe 'single e-mail for user' do + let(:user) { create(:user, email: sample_commit.author_email) } + let(:commit1) { '0ed8c6c6752e8c6ea63e7b92a517bf5ac1209c80' } + let(:commit2) { '7d3b0f7cff5f37573aea97cebfd5692ea1689924' } + + subject { repository.commits_by_user_on_date_log(user,Date.new(2014, 07, 31)) } + + it 'contains the exepected commits' do + expect(subject.flatten.map(&:id)).to eq([commit1, commit2]) + end end end end |