Skip to content

Commit

Permalink
fix app signal error
Browse files Browse the repository at this point in the history
  • Loading branch information
adrienpoly committed Sep 3, 2024
1 parent ef686a8 commit fb0a8c7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/talks/recommendations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class Talks::RecommendationsController < ApplicationController

def index
redirect_to talk_path(@talk) unless turbo_frame_request?
@talks = @talk.related_talks
@talks = @talk&.related_talks || []
end

private
Expand Down
6 changes: 6 additions & 0 deletions test/controllers/talks/recommended_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ def setup
assert_not_nil assigns(:talks)
end

test "should return random talk if no talk is found" do
get talk_recommendations_url("999999999"), headers: {"Turbo-Frame" => "true"}
assert_response :success
assert_not_nil assigns(:talks)
end

test "a none turbo stream request should redirect to the talk" do
get talk_recommendations_url(@talk)
assert_redirected_to talk_url(@talk)
Expand Down

0 comments on commit fb0a8c7

Please sign in to comment.