FIX: action_code_path not being loaded for user-stream-item (#18577)

This commit fixes an issue where we had a typo in the
UserAction.stream query which meant that action_code_path
was not loaded correctly. Once that was fixed, we were also
not actually using the action_code_path in the user-stream-item,
so that has been fixed here too.

The bug this caused was that, when the link for the action was
clicked within the user-stream-item, the user would be redirected
to a URL ending with `[missing%20%%7Bpath%7D%20value]` because
the I18n call did not have the path present.
This commit is contained in:
Martin Brennan
2022-10-13 19:10:18 +10:00
committed by GitHub
parent c16cb0e00b
commit beaf009b4a
4 changed files with 17 additions and 4 deletions

View File

@ -122,6 +122,7 @@ RSpec.describe UserAction do
log_test_action(action_type: UserAction::ASSIGNED)
private_post.custom_fields ||= {}
private_post.custom_fields["action_code_who"] = 'testing'
private_post.custom_fields["action_code_path"] = '/p/1234'
private_post.custom_fields["random_field"] = 'random_value'
private_post.save!
end
@ -133,6 +134,7 @@ RSpec.describe UserAction do
expect(user_action_row.action_type).to eq(UserAction::ASSIGNED)
expect(user_action_row.action_code_who).to eq('testing')
expect(user_action_row.action_code_path).to eq('/p/1234')
end
end