Skip to content

Commit

Permalink
chore: update samples create service test to simplify samples_count v…
Browse files Browse the repository at this point in the history
…alidation
  • Loading branch information
ericenns committed Dec 18, 2024
1 parent 85dcdde commit f0b4558
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions test/services/samples/create_service_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,18 +110,13 @@ def setup
project31 = projects(:project31)
valid_params = { name: 'sample36', description: 'new sample for project31' }

assert_equal(2, subgroup12aa.samples_count)
assert_equal(3, subgroup12a.samples_count)
assert_equal(1, subgroup12b.samples_count)
assert_equal(4, group12.samples_count)

assert_no_changes -> { subgroup12b.reload.samples_count } do
assert_difference -> { project31.reload.samples.size } => 1,
-> { subgroup12aa.reload.samples_count } => 1,
-> { subgroup12a.reload.samples_count } => 1,
-> { subgroup12b.reload.samples_count } => 0,
-> { group12.reload.samples_count } => 1 do
Samples::CreateService.new(@user, project31, valid_params).execute
end

assert_equal(3, subgroup12aa.reload.samples_count)
assert_equal(4, subgroup12a.reload.samples_count)
assert_equal(5, group12.reload.samples_count)
end
end
end

0 comments on commit f0b4558

Please sign in to comment.