Commit 05425d79 authored by Shinya Maeda's avatar Shinya Maeda

Merge branch 'fix-typo-releases-latest-permalink' into 'master'

Fix typo bug in releases latest permalink

See merge request gitlab-org/gitlab!82896
parents 97cb6f48 f9f9f830
......@@ -72,7 +72,7 @@ class Projects::ReleasesController < Projects::ApplicationController
def fetch_latest_tag
allowed_values = ['released_at']
params.reject! { |key, value| key.to_sym == :order_by && allowed_values.any?(value) }
params.reject! { |key, value| key.to_sym == :order_by && !allowed_values.any?(value) }
@latest_tag = releases(order_by: params[:order_by]).first&.tag
end
......
......@@ -343,6 +343,8 @@ RSpec.describe Projects::ReleasesController do
shared_examples_for 'redirects to latest release ordered by using released_at' do
it do
expect(Release).to receive(:order_released_desc).and_call_original
subject
expect(response).to redirect_to("#{project_releases_path(project)}/#{latest_release.tag}")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment