diff options
author | George Andrinopoulos <geoandri@gmail.com> | 2017-11-07 21:49:41 +0200 |
---|---|---|
committer | George Andrinopoulos <geoandri@gmail.com> | 2017-11-11 16:47:39 +0200 |
commit | 46cacbe5cfa69b1ae63ce8b669bc9d9f06676ea2 (patch) | |
tree | f9a6524f50296f81490288c667d4da9591496495 /spec/features | |
parent | 561693ad173b22dab54a0fdd5446f7637095272a (diff) | |
download | gitlab-ce-46cacbe5cfa69b1ae63ce8b669bc9d9f06676ea2.tar.gz |
Add feature test to milestone
Diffstat (limited to 'spec/features')
-rw-r--r-- | spec/features/milestone_spec.rb | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/spec/features/milestone_spec.rb b/spec/features/milestone_spec.rb index 6c9dc67ad74..27efc32c95b 100644 --- a/spec/features/milestone_spec.rb +++ b/spec/features/milestone_spec.rb @@ -65,4 +65,33 @@ feature 'Milestone' do expect(find('.alert-danger')).to have_content('already being used for another group or project milestone.') end end + + feature 'Open a milestone' do + scenario 'shows total issue time spent correctly when no time has been logged' do + milestone = create(:milestone, project: project, title: 8.7) + + visit project_milestone_path(project, milestone) + + page.within('.block.time_spent') do + expect(page).to have_content 'No time spent' + expect(page).to have_content 'None' + end + end + + scenario 'shows total issue time spent' do + milestone = create(:milestone, project: project, title: 8.7) + issue1 = create(:issue, project: project, milestone: milestone) + issue2 = create(:issue, project: project, milestone: milestone) + issue1.spend_time(duration: 3600, user: user) + issue1.save! + issue2.spend_time(duration: 7200, user: user) + issue2.save! + + visit project_milestone_path(project, milestone) + + page.within('.block.time_spent') do + expect(page).to have_content '3h' + end + end + end end |