Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CAPT-1615] Admin can view amendments after payrolled #3268

Merged
merged 1 commit into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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