chore: Enable the new Rubocop rules (#7122)
fixes: https://linear.app/chatwoot/issue/CW-1574/renable-the-disabled-rubocop-rules
This commit is contained in:
@@ -22,7 +22,7 @@ RSpec.describe 'Integration Apps API', type: :request do
|
||||
as: :json
|
||||
|
||||
expect(response).to have_http_status(:success)
|
||||
apps = JSON.parse(response.body)['payload'].first
|
||||
apps = response.parsed_body['payload'].first
|
||||
expect(apps['id']).to eql(first_app.id)
|
||||
expect(apps['name']).to eql(first_app.name)
|
||||
expect(apps['action']).to be_nil
|
||||
@@ -36,7 +36,7 @@ RSpec.describe 'Integration Apps API', type: :request do
|
||||
|
||||
expect(response).to have_http_status(:success)
|
||||
|
||||
app = JSON.parse(response.body)['payload'].find { |int_app| int_app['id'] == openai.app.id }
|
||||
app = response.parsed_body['payload'].find { |int_app| int_app['id'] == openai.app.id }
|
||||
expect(app['hooks'].first['settings']).to be_nil
|
||||
end
|
||||
|
||||
@@ -47,7 +47,7 @@ RSpec.describe 'Integration Apps API', type: :request do
|
||||
as: :json
|
||||
|
||||
expect(response).to have_http_status(:success)
|
||||
apps = JSON.parse(response.body)['payload'].first
|
||||
apps = response.parsed_body['payload'].first
|
||||
expect(apps['id']).to eql(first_app.id)
|
||||
expect(apps['name']).to eql(first_app.name)
|
||||
expect(apps['action']).to eql(first_app.action)
|
||||
@@ -60,7 +60,7 @@ RSpec.describe 'Integration Apps API', type: :request do
|
||||
as: :json
|
||||
|
||||
expect(response).to have_http_status(:success)
|
||||
apps = JSON.parse(response.body)['payload']
|
||||
apps = response.parsed_body['payload']
|
||||
slack_app = apps.find { |app| app['id'] == 'slack' }
|
||||
expect(slack_app['action']).to include('client_id=client_id')
|
||||
end
|
||||
@@ -74,7 +74,7 @@ RSpec.describe 'Integration Apps API', type: :request do
|
||||
|
||||
expect(response).to have_http_status(:success)
|
||||
|
||||
app = JSON.parse(response.body)['payload'].find { |int_app| int_app['id'] == openai.app.id }
|
||||
app = response.parsed_body['payload'].find { |int_app| int_app['id'] == openai.app.id }
|
||||
expect(app['hooks'].first['settings']).not_to be_nil
|
||||
end
|
||||
end
|
||||
@@ -98,7 +98,7 @@ RSpec.describe 'Integration Apps API', type: :request do
|
||||
as: :json
|
||||
|
||||
expect(response).to have_http_status(:success)
|
||||
app = JSON.parse(response.body)
|
||||
app = response.parsed_body
|
||||
expect(app['id']).to eql('slack')
|
||||
expect(app['name']).to eql('Slack')
|
||||
end
|
||||
@@ -111,7 +111,7 @@ RSpec.describe 'Integration Apps API', type: :request do
|
||||
|
||||
expect(response).to have_http_status(:success)
|
||||
|
||||
app = JSON.parse(response.body)
|
||||
app = response.parsed_body
|
||||
expect(app['hooks'].first['settings']).to be_nil
|
||||
end
|
||||
|
||||
@@ -123,7 +123,7 @@ RSpec.describe 'Integration Apps API', type: :request do
|
||||
|
||||
expect(response).to have_http_status(:success)
|
||||
|
||||
app = JSON.parse(response.body)
|
||||
app = response.parsed_body
|
||||
expect(app['hooks'].first['settings']).not_to be_nil
|
||||
end
|
||||
end
|
||||
|
||||
@@ -53,7 +53,7 @@ RSpec.describe 'Dyte Integration API', type: :request do
|
||||
headers: agent.create_new_auth_token,
|
||||
as: :json
|
||||
expect(response).to have_http_status(:success)
|
||||
response_body = JSON.parse(response.body)
|
||||
response_body = response.parsed_body
|
||||
last_message = conversation.reload.messages.last
|
||||
expect(conversation.display_id).to eq(response_body['conversation_id'])
|
||||
expect(last_message.id).to eq(response_body['id'])
|
||||
@@ -76,7 +76,7 @@ RSpec.describe 'Dyte Integration API', type: :request do
|
||||
headers: agent.create_new_auth_token,
|
||||
as: :json
|
||||
expect(response).to have_http_status(:unprocessable_entity)
|
||||
response_body = JSON.parse(response.body)
|
||||
response_body = response.parsed_body
|
||||
expect(response_body['error']).to eq({ 'data' => { 'message' => 'Title is required' }, 'success' => false })
|
||||
end
|
||||
end
|
||||
@@ -126,7 +126,7 @@ RSpec.describe 'Dyte Integration API', type: :request do
|
||||
headers: agent.create_new_auth_token,
|
||||
as: :json
|
||||
expect(response).to have_http_status(:success)
|
||||
response_body = JSON.parse(response.body)
|
||||
response_body = response.parsed_body
|
||||
expect(response_body['authResponse']).to eq(
|
||||
{
|
||||
'userAdded' => true, 'id' => 'random_uuid', 'auth_token' => 'json-web-token'
|
||||
|
||||
@@ -35,7 +35,7 @@ RSpec.describe 'Integration Hooks API', type: :request do
|
||||
as: :json
|
||||
|
||||
expect(response).to have_http_status(:success)
|
||||
data = JSON.parse(response.body)
|
||||
data = response.parsed_body
|
||||
expect(data['app_id']).to eq params[:app_id]
|
||||
end
|
||||
end
|
||||
@@ -71,7 +71,7 @@ RSpec.describe 'Integration Hooks API', type: :request do
|
||||
as: :json
|
||||
|
||||
expect(response).to have_http_status(:success)
|
||||
data = JSON.parse(response.body)
|
||||
data = response.parsed_body
|
||||
expect(data['app_id']).to eq 'slack'
|
||||
end
|
||||
end
|
||||
@@ -131,7 +131,7 @@ RSpec.describe 'Integration Hooks API', type: :request do
|
||||
as: :json
|
||||
|
||||
expect(response).to have_http_status(:success)
|
||||
expect(::Integrations::Hook.exists?(hook.id)).to be false
|
||||
expect(Integrations::Hook.exists?(hook.id)).to be false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user