chore: rename linked_issues route
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
class Api::V1::Accounts::Integrations::LinearController < Api::V1::Accounts::BaseController
|
||||
before_action :fetch_conversation, only: [:link_issue, :linked_issue]
|
||||
before_action :fetch_conversation, only: [:link_issue, :linked_issues]
|
||||
|
||||
def teams
|
||||
teams = linear_processor_service.teams
|
||||
@@ -51,7 +51,7 @@ class Api::V1::Accounts::Integrations::LinearController < Api::V1::Accounts::Bas
|
||||
end
|
||||
end
|
||||
|
||||
def linked_issue
|
||||
def linked_issues
|
||||
issues = linear_processor_service.linked_issues(conversation_link)
|
||||
|
||||
if issues[:error]
|
||||
|
||||
+1
-1
@@ -235,7 +235,7 @@ Rails.application.routes.draw do
|
||||
post :link_issue
|
||||
post :unlink_issue
|
||||
get :search_issue
|
||||
get :linked_issue
|
||||
get :linked_issues
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -222,7 +222,7 @@ RSpec.describe 'Linear Integration API', type: :request do
|
||||
end
|
||||
end
|
||||
|
||||
describe 'GET /api/v1/accounts/:account_id/integrations/linear/linked_issue' do
|
||||
describe 'GET /api/v1/accounts/:account_id/integrations/linear/linked_issues' do
|
||||
let(:conversation) { create(:conversation, account: account) }
|
||||
let(:link) { "#{ENV.fetch('FRONTEND_URL', nil)}/app/accounts/#{account.id}/conversations/#{conversation.display_id}" }
|
||||
|
||||
@@ -232,7 +232,7 @@ RSpec.describe 'Linear Integration API', type: :request do
|
||||
|
||||
it 'returns linked issue' do
|
||||
allow(processor_service).to receive(:linked_issues).with(link).and_return(linked_issue)
|
||||
get "/api/v1/accounts/#{account.id}/integrations/linear/linked_issue",
|
||||
get "/api/v1/accounts/#{account.id}/integrations/linear/linked_issues",
|
||||
params: { conversation_id: conversation.display_id },
|
||||
headers: agent.create_new_auth_token,
|
||||
as: :json
|
||||
@@ -244,7 +244,7 @@ RSpec.describe 'Linear Integration API', type: :request do
|
||||
context 'when linked issue is not found' do
|
||||
it 'returns error message' do
|
||||
allow(processor_service).to receive(:linked_issues).with(link).and_return(error: 'error message')
|
||||
get "/api/v1/accounts/#{account.id}/integrations/linear/linked_issue",
|
||||
get "/api/v1/accounts/#{account.id}/integrations/linear/linked_issues",
|
||||
params: { conversation_id: conversation.display_id },
|
||||
headers: agent.create_new_auth_token,
|
||||
as: :json
|
||||
|
||||
Reference in New Issue
Block a user