Skip to content

Commit aa40168

Browse files
qcoralclaude
andcommitted
Update discount tests to flat per-tier values
The accrual is now a flat per-tier discount (S = 100% of the 300✦ base), so all three tier-3 cases yield 300 regardless of approved amount. Also retitled the "approve for less" test, which now verifies the discount is unchanged by the approved amount rather than increased by it. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 4fee370 commit aa40168

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

test/models/certification/funding_request_test.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,30 +72,30 @@ def setup
7272
fr.update!(reviewer: @reviewer, status: :approved)
7373

7474
assert_equal "build", @project.reload.hardware_stage
75-
# tier 3 (S) max $180, approved $60 => $120 unused * 2 = 240
76-
assert_equal 240, @owner.reload.outpost_discount_stardust
75+
# tier 3 (S) => flat 100% discount on the 300✦ Outpost Ticket = 300
76+
assert_equal 300, @owner.reload.outpost_discount_stardust
7777
assert_equal Certification::FundingRequest::REVIEW_BOUNTY, fr.reload.stardust_earned
7878
end
7979

80-
test "reviewer can approve for less than requested, increasing the discount" do
80+
test "approving for less than requested still grants the full flat tier discount" do
8181
fr = @project.certification_funding_requests.create!(
8282
user: @owner, complexity_tier: 3, requested_amount_cents: 10_000, status: :pending
8383
)
8484
fr.update!(reviewer: @reviewer, status: :approved, approved_amount_dollars: 40)
8585

86-
# approved $40 of $180 (S) max => $140 unused * 2 = 280
87-
assert_equal 280, @owner.reload.outpost_discount_stardust
86+
# flat per-tier discount: the approved amount no longer affects it; tier 3 (S) = 300
87+
assert_equal 300, @owner.reload.outpost_discount_stardust
8888
end
8989

9090
test "discount accrual is idempotent across re-saves" do
9191
fr = @project.certification_funding_requests.create!(
9292
user: @owner, complexity_tier: 3, requested_amount_cents: 6_000, status: :pending
9393
)
9494
fr.update!(reviewer: @reviewer, status: :approved)
95-
assert_equal 240, @owner.reload.outpost_discount_stardust
95+
assert_equal 300, @owner.reload.outpost_discount_stardust
9696

9797
fr.update!(feedback: "nice work")
98-
assert_equal 240, @owner.reload.outpost_discount_stardust
98+
assert_equal 300, @owner.reload.outpost_discount_stardust
9999
end
100100

101101
test "returned requests leave the project and discount untouched" do

0 commit comments

Comments
 (0)