-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I need to introduce Cells
- Loading branch information
pikesley
committed
Feb 27, 2016
1 parent
e925e7c
commit c0760c7
Showing
3 changed files
with
35 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
describe 'GlycatedHaemoglobin' do | ||
describe 'Return at least something if the metric is sparse' do | ||
let(:user) { create :user } | ||
|
||
before :each do | ||
DatabaseCleaner.clean | ||
end | ||
|
||
it 'shows the year if the first metric is from last year or even older' do | ||
create(:glycated_haemoglobin, datetime: '2015-06-06') | ||
Timecop.freeze 2016, 02, 27 do | ||
visit glycated_haemoglobins_url(as: user) | ||
expect(page).to have_content 'June 6th 2015' | ||
end | ||
end | ||
|
||
it 'does not show the year if the first metric is from this year' do | ||
create(:glycated_haemoglobin, datetime: '2016-01-01') | ||
Timecop.freeze 2016, 02, 27 do | ||
visit glycated_haemoglobins_url(as: user) | ||
expect(page).to have_content 'January 1st' | ||
expect(page).to_not have_content 'January 1st 2016' | ||
end | ||
end | ||
end | ||
end |