Commit 7cc9a101 authored by Beat Seeliger's avatar Beat Seeliger
Browse files

Merge branch 'changes/semester-process-volunteer-filter-through-semester' into 'develop'

Changes: Filter semester process volunteer index on semester

See merge request !837
parents d8e450dd 9d5c633e
Pipeline #30630 passed with stage
in 43 minutes and 56 seconds
......@@ -26,10 +26,10 @@ class SemesterProcessVolunteersController < ApplicationController
review_semester_semester_process_volunteer_path(@semester_process_volunteer),
notice: 'Successfully reviewed.'
)
rescue ActiveRecord::RecordInvalid => exception
null_reviewed
@hours.reload
render :review_semester, notice: exception
rescue ActiveRecord::RecordInvalid => exception
null_reviewed
@hours.reload
render :review_semester, notice: exception
end
end
......@@ -66,7 +66,8 @@ class SemesterProcessVolunteersController < ApplicationController
params.require(:semester_process_volunteer).permit(
volunteer_attributes: [:waive, :iban, :bank],
semester_feedback: [:goals, :achievements, :future, :comments, :conversation],
hour: [:hours])
hour: [:hours]
)
end
def set_semester_process_volunteer
......
......@@ -2,4 +2,5 @@ nav.navbar.section-navigation
hr
ul.list-inline
li= button_link 'Neuen Semester Prozess erstellen', new_semester_process_path, dimension: 'sm'
li= render 'semester_filter'
hr
.btn-group
button.btn.btn-default.dropdown-toggle type='button' data-toggle='dropdown' aria-label="Semester" aria-haspopup='true' aria-expanded='false' class="btn-md"
= "Semester: "
= params[:semester] || @semester
= ' '
span.caret aria-hidden='true'
ul.dropdown-menu
li
-@semester.collection.each do |name, semester_code|
li= link_to name[0..15], semester_process_volunteers_path(semester: semester_code)
require 'application_system_test_case'
class SemesterProcessVolunteersTest < ApplicationSystemTestCase
setup do
@current_semester = Semester.new
create :semester_process, :with_volunteers, semester: @current_semester.previous_s
create :semester_process, :with_volunteers, semester: @current_semester.previous_s(2)
create :semester_process, :with_volunteers, semester: @current_semester.previous_s(3)
login_as create(:user)
visit semester_process_volunteers_path
end
test 'filter semester process volunteer shows previous semester by default' do
assert page.has_text? "#{@current_semester.previous_s[5]}. Semester #{@current_semester.previous_s[0..3]}"
assert_not page.has_text? "#{@current_semester.previous_s(2)[5]}. Semester #{@current_semester.previous_s(2)[0..3]}"
end
test 'filter semester process volunteer on semester' do
click_button "Semester: #{@current_semester.previous_s[0..3]},#{@current_semester.previous_s[5]}", match: :first
click_link "#{@current_semester.previous_s(2)[5]}. Semester #{@current_semester.previous_s(2)[0..3]}"
assert_not page.has_text? "#{@current_semester.previous_s[5]}. Semester #{@current_semester.previous_s[0..3]}"
assert page.has_text? "#{@current_semester.previous_s(2)[5]}. Semester #{@current_semester.previous_s(2)[0..3]}"
assert_not page.has_text? "#{@current_semester.previous_s(3)[5]}. Semester #{@current_semester.previous_s(3)[0..3]}"
end
end
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment