Skip to content

Commit a90f3bb

Browse files
authored
Merge pull request #5389 from brodyf42/5384_fix_kit_show_not_found
[5384] Redirect to the allocations view when clicking on a kit link from the history report
2 parents 7e567fd + cd01cb6 commit a90f3bb

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

app/controllers/kits_controller.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
class KitsController < ApplicationController
2+
def show
3+
redirect_to allocations_kit_path
4+
end
5+
26
def index
37
@kits = current_organization.kits.includes(:item, line_items: :item).class_filter(filter_params)
48
@inventory = View::Inventory.new(current_organization.id)

spec/requests/kit_requests_spec.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@
1212
sign_in(user)
1313
end
1414

15+
describe "GET #show" do
16+
it "should redirect to the allocations page" do
17+
get kit_url(kit)
18+
expect(response).to redirect_to allocations_kit_path(kit.id)
19+
end
20+
end
21+
1522
describe "GET #index" do
1623
before do
1724
# this shouldn't be shown

0 commit comments

Comments
 (0)