Skip to content

Commit

Permalink
Add reviewer feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
jayjay-w committed Feb 20, 2025
1 parent 2aa0258 commit 043d2f3
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions test/models/ability_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,12 @@ def teardown
create_team_user user: u, team: t, role: 'admin'
pm1 = create_project_media team: t
pm2 = create_project_media team: t2
tag1 = create_tag annotated: pm1
tag2 = create_tag annotated: pm2
a1 = create_annotation annotated: pm1
a2 = create_annotation annotated: pm2
with_current_user_and_team(u, t) do
a = Ability.new
assert a.can?(:destroy, tag1)
assert a.cannot?(:destroy, tag2)
assert a.can?(:destroy, a1)
assert a.cannot?(:destroy, a2)
end
end
end
Expand Down Expand Up @@ -611,8 +611,6 @@ def teardown
m = create_valid_media
pma = create_project_media project: pa, media: m
pmb = create_project_media project: pb, media: m
task1 = create_task annotated: pma
task2 = create_task annotated: pmb

with_current_user_and_team(u, t1) do
ability = Ability.new
Expand All @@ -621,8 +619,6 @@ def teardown
assert ability.can?(:read, pa)
assert ability.cannot?(:read, pb)
assert ability.can?(:read, m)
assert ability.can?(:read, task1)
assert ability.cannot?(:read, task2)
end
end

Expand All @@ -636,17 +632,13 @@ def teardown
m = create_valid_media
pma = create_project_media project: pa, media: m
pmb = create_project_media project: pb, media: m
task1 = create_task annotated: pma
task2 = create_task annotated: pmb
with_current_user_and_team(u, tu) do
ability = Ability.new
assert ability.can?(:read, t1)
assert ability.can?(:read, t2)
assert ability.can?(:read, pa)
assert ability.can?(:read, pb)
assert ability.can?(:read, m)
assert ability.can?(:read, task1)
assert ability.can?(:read, task2)
end
end

Expand All @@ -660,8 +652,6 @@ def teardown
m = create_valid_media
pma = create_project_media project: pa, media: m
pmb = create_project_media project: pb, media: m
task1 = create_task annotated: pma
task2 = create_task annotated: pmb

with_current_user_and_team(u, t2) do
ability = Ability.new
Expand All @@ -670,8 +660,6 @@ def teardown
assert ability.can?(:read, pa)
assert ability.cannot?(:read, pb)
assert ability.can?(:read, m)
assert ability.can?(:read, task1)
assert ability.cannot?(:read, task2)
end
end

Expand Down

0 comments on commit 043d2f3

Please sign in to comment.