Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
open-source
aoz-003
Commits
1bba203a
Verified
Commit
1bba203a
authored
Jan 30, 2018
by
Kaspar Vollenweider
👻
Browse files
fix group offer missing as dependent action from volunteer
parent
de6ad1d1
Changes
3
Hide whitespace changes
Inline
Side-by-side
app/models/volunteer.rb
View file @
1bba203a
...
...
@@ -48,7 +48,7 @@ class Volunteer < ApplicationRecord
has_many
:billing_expenses
has_many
:group_assignments
has_many
:group_assignments
,
dependent: :delete_all
has_many
:group_assignment_logs
has_many
:group_offers
,
through: :group_assignments
...
...
app/views/group_offers/_group_assignments_index.html.slim
View file @
1bba203a
...
...
@@ -12,7 +12,7 @@
-
group_assignments
.
each
do
|
group_assignment
|
tr
td
=
link_to_if
(
policy
(
V
olunteer
).
show?
,
group_assignment
.
volunteer
.
contact
.
full_name
,
volunteer_path
(
group_assignment
.
volunteer
))
=
link_to_if
(
policy
(
group_assignment
.
v
olunteer
).
show?
,
group_assignment
.
volunteer
.
contact
.
full_name
,
volunteer_path
(
group_assignment
.
volunteer
))
-
if
params
[
:format
]
==
'pdf'
td
=
group_assignment
.
volunteer
.
contact
.
primary_email
td
=
group_assignment
.
responsible
?
t_attr
(
:responsible
,
GroupAssignment
)
:
t_attr
(
:member
,
GroupAssignment
)
...
...
test/system/group_offers_test.rb
View file @
1bba203a
...
...
@@ -140,12 +140,14 @@ class GroupOffersTest < ApplicationSystemTestCase
assert
page
.
has_text?
title
end
test
'deleting
volunteer
does
not
crash
group
offer
show'
do
test
'deleting
_
volunteer
_
does
_
not
_
crash
_
group
_
offer
_
show'
do
login_as
create
(
:user
)
volunteer1
=
create
:volunteer
volunteer2
=
create
:volunteer
group_offer
=
create
:group_offer
,
volunteers:
[
volunteer1
,
volunteer2
]
group_offer
=
create
:group_offer
[
volunteer1
,
volunteer2
].
map
do
|
volunteer
|
create
(
:group_assignment
,
volunteer:
volunteer
,
group_offer:
group_offer
)
end
visit
group_offer_path
(
group_offer
)
assert
page
.
has_link?
volunteer1
.
contact
.
full_name
assert
page
.
has_link?
volunteer2
.
contact
.
full_name
...
...
@@ -153,8 +155,8 @@ class GroupOffersTest < ApplicationSystemTestCase
Volunteer
.
find
(
volunteer1
.
id
).
destroy
visit
group_offer_path
(
group_offer
)
refute
page
.
has_link?
volunteer1
.
contact
.
full_name
assert
page
.
has_link?
volunteer2
.
contact
.
full_name
refute
page
.
has_link?
volunteer1
.
contact
.
full_name
end
test
'department_manager_has_group_assignment_select_dropdowns_in_edit_form_filled'
do
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment