Skip to content

Commit

Permalink
admin can view amendments after payrolled
Browse files Browse the repository at this point in the history
  • Loading branch information
asmega committed Oct 4, 2024
1 parent 572e8cc commit 205cbb3
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/admin/amendments_controller.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class Admin::AmendmentsController < Admin::BaseAdminController
before_action :load_claim
before_action :ensure_service_operator
before_action :ensure_claim_is_amendable
before_action :ensure_claim_is_amendable, only: [:new, :create]

def index
end
Expand Down
25 changes: 25 additions & 0 deletions spec/features/admin/admin_amend_claim_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -186,4 +186,29 @@
expect(page).to have_content("Claim has been amended successfully")
end
end

context "when claim is no longer amendable" do
let!(:payment) do
create(
:payment,
claims: [claim]
)
end

scenario "admin can view amendments" do
visit admin_claim_url(claim)
click_link "View tasks"
click_on "Claim amendments"

expect(page).to have_content "Claim amendments"
end

scenario "admin cannot make amendments" do
visit admin_claim_url(claim)
expect(page).not_to have_content "Amend claim"

visit new_admin_claim_amendment_path(claim)
expect(page).to have_content "This claim cannot be amended"
end
end
end

0 comments on commit 205cbb3

Please sign in to comment.