summaryrefslogtreecommitdiff
path: root/spec/models/repository_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/repository_spec.rb')
-rw-r--r--spec/models/repository_spec.rb19
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