Commit 8e3de7bb authored by Ash McKenzie's avatar Ash McKenzie

CustomAction#message was never used

parent e30e9a9b
......@@ -51,7 +51,7 @@ module EE
}
}
::Gitlab::GitAccessResult::CustomAction.new(payload, 'Attempting to proxy to primary.', messages)
::Gitlab::GitAccessResult::CustomAction.new(payload, messages)
end
def messages
......
......@@ -50,8 +50,8 @@ shared_examples 'a read-only GitLab instance' do
project.add_maintainer(user)
expect(push_changes).to be_a(Gitlab::GitAccessResult::CustomAction)
expect(push_changes.message).to eql('Attempting to proxy to primary.')
expect(push_changes.payload).to eql(payload)
expect(push_changes.console_messages).to include(*console_messages)
end
end
end
......
......@@ -77,7 +77,7 @@ module API
response_with_status(**payload)
when ::Gitlab::GitAccessResult::CustomAction
response_with_status(code: 300, message: check_result.message, payload: check_result.payload, gl_console_messages: check_result.console_messages)
response_with_status(code: 300, payload: check_result.payload, gl_console_messages: check_result.console_messages)
else
response_with_status(code: 500, success: false, message: UNKNOWN_CHECK_RESULT_ERROR)
end
......
......@@ -3,7 +3,7 @@
module Gitlab
module GitAccessResult
class CustomAction
attr_reader :payload, :message, :console_messages
attr_reader :payload, :console_messages
# Example of payload:
#
......@@ -16,9 +16,8 @@ module Gitlab
# }
# }
#
def initialize(payload, message, console_messages)
def initialize(payload, console_messages)
@payload = payload
@message = message
@console_messages = console_messages
end
end
......
......@@ -407,7 +407,6 @@ describe API::Internal::Base do
context "custom action" do
let(:access_checker) { double(Gitlab::GitAccess) }
let(:message) { 'CustomActionError message' }
let(:payload) do
{
'action' => 'geo_proxy_to_primary',
......@@ -418,8 +417,8 @@ describe API::Internal::Base do
}
}
end
let(:custom_action_result) { Gitlab::GitAccessResult::CustomAction.new(payload, message) }
let(:console_messages) { ['informational message'] }
let(:custom_action_result) { Gitlab::GitAccessResult::CustomAction.new(payload, console_messages) }
before do
project.add_guest(user)
......@@ -446,8 +445,8 @@ describe API::Internal::Base do
expect(response).to have_gitlab_http_status(300)
expect(json_response['status']).to be_truthy
expect(json_response['message']).to eql(message)
expect(json_response['payload']).to eql(payload)
expect(json_response['gl_console_messages']).to eql(console_messages)
expect(user.reload.last_activity_on).to be_nil
end
end
......
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