Skip to content
This repository has been archived by the owner on May 11, 2021. It is now read-only.

Commit

Permalink
Users can debrief early
Browse files Browse the repository at this point in the history
Addresses #209
  • Loading branch information
jdudley1123 committed Nov 26, 2019
1 parent c30dc8b commit b9a2e49
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/views/iterations/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<div class="w-full sm:w-3/4 mb-3">
Every two weeks
<% if policy(@iteration).create? %>
<small>(Only visible to project contributors)</small>
<br><small>(Only visible to project contributors)</small>
<% end %>
</div>
</div>
Expand Down Expand Up @@ -74,7 +74,12 @@
Debrief
</div>
<div class="w-full sm:w-3/4 mb-3">
Due <%= with_default(@iteration.planned_debrief_date, formatter: :friendly_date) %>
Due <%= with_default(@iteration.planned_debrief_date, formatter: :friendly_date) %><br>
<% if @iteration.planned_debrief_date.future? %>
<small class="missing-text">Finished learning? <%= link_to 'Debrief early', new_project_iteration_debrief_path(@project, @iteration), class: 'link' %></small>
<% else %>
<small class="text-danger">Overdue! <%= link_to 'Add a debrief', new_project_iteration_debrief_path(@project, @iteration), class: 'link' %></small>
<% end %>
</div>
<% else %>
<div class="w-full sm:w-1/4 mb-3">
Expand Down
6 changes: 6 additions & 0 deletions test/system/debriefs_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ class DebriefsTest < ApplicationSystemTestCase
visit new_project_iteration_debrief_path(@project, @iteration)
assert_text('New debrief')
end

test 'contributors can debrief early' do
Membership.last.update(role: :contributor)
visit project_iteration_path(@project, @iteration)
assert_text('Debrief early')
end

test 'contributors can view debriefs' do
@debrief.save!
Expand Down

0 comments on commit b9a2e49

Please sign in to comment.