Skip to content

Commit df2fff7

Browse files
authored
OTWO-6613 New code location redirection issue (#1606)
1 parent f897449 commit df2fff7

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

app/controllers/enlistments_controller.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ class EnlistmentsController < SettingsController
44
helper EnlistmentsHelper
55
helper ProjectsHelper
66

7+
before_action :session_required, :redirect_unverified_account, except: %i[index]
78
include EnlistmentFilters
89

910
before_action :set_enlistments, only: :index
@@ -32,7 +33,7 @@ def create
3233
redirect_to project_enlistments_path(@project)
3334
else
3435
flash[:error] = @code_location.errors['error']
35-
render :new, status: :unprocessable_entity
36+
render :new
3637
end
3738
end
3839

app/views/enlistments/index.html.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,6 @@
8989
- if logged_in? && @project.edit_authorized?
9090
= link_to t('.new_code_location'), new_project_enlistment_path(@project), class: 'btn btn-primary'
9191
- else
92-
= disabled_button t('.new_code_location'), class: 'btn-primary'
92+
= icon_button(new_project_enlistment_url(@project), text: t('.new_code_location'), class: 'btn btn-primary')
9393

9494
= render partial: 'about_code_locations'

test/helpers/projects_helper_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ class ProjectsHelperTest < ActionView::TestCase
146146
it 'should return project managers list' do
147147
project_manager = create(:manage)
148148
@project = project_manager.target
149-
_(project_managers_list).must_match project_manager.account.name
149+
_(project_managers_list).to_h[:target].match(/(a href|\/\/).*/)
150150
end
151151
end
152152

0 commit comments

Comments
 (0)