mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Bugfix conference#calculate_items_per_week
This commit is contained in:
parent
84a26b8d02
commit
54ac8a8fb7
3 changed files with 29 additions and 9 deletions
|
|
@ -70,6 +70,24 @@ describe Conference do
|
|||
|
||||
describe '#get_submissions_per_week' do
|
||||
|
||||
it 'does calculate correct if cfp start date is altered' do
|
||||
cfp = create(:call_for_papers)
|
||||
cfp.start_date = Date.new(2014, 05, 26)
|
||||
cfp.end_date = Date.new(2014, 05, 26) + 21
|
||||
subject.call_for_papers = cfp
|
||||
subject.events += [create(:event, created_at: Date.new(2014, 05, 26) - 7)]
|
||||
expect(subject.get_submissions_per_week).to eq([1, 1, 1, 1, 1])
|
||||
end
|
||||
|
||||
it 'does calculate correct if cfp end date is altered' do
|
||||
cfp = create(:call_for_papers)
|
||||
cfp.start_date = Date.new(2014, 05, 26)
|
||||
cfp.end_date = Date.new(2014, 05, 26) + 21
|
||||
subject.call_for_papers = cfp
|
||||
subject.events += [create(:event, created_at: Date.new(2014, 05, 26) + 28)]
|
||||
expect(subject.get_submissions_per_week).to eq([0, 0, 0, 0, 1])
|
||||
end
|
||||
|
||||
it 'pads with zeros if there are no submissions' do
|
||||
cfp = create(:call_for_papers)
|
||||
cfp.start_date = Date.new(2014, 05, 26)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue