mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-02 03:57:52 +00:00
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:
@@ -26,7 +26,7 @@ RSpec.describe 'Api::V1::Accounts::Portals', type: :request do
|
||||
headers: agent.create_new_auth_token
|
||||
|
||||
expect(response).to have_http_status(:success)
|
||||
json_response = JSON.parse(response.body)
|
||||
json_response = response.parsed_body
|
||||
expect(json_response['payload'].length).to be 2
|
||||
expect(json_response['payload'][0]['id']).to be portal.id
|
||||
end
|
||||
@@ -48,7 +48,7 @@ RSpec.describe 'Api::V1::Accounts::Portals', type: :request do
|
||||
headers: agent.create_new_auth_token
|
||||
|
||||
expect(response).to have_http_status(:success)
|
||||
json_response = JSON.parse(response.body)
|
||||
json_response = response.parsed_body
|
||||
expect(json_response['name']).to eq portal.name
|
||||
expect(json_response['meta']['all_articles_count']).to eq 0
|
||||
end
|
||||
@@ -65,7 +65,7 @@ RSpec.describe 'Api::V1::Accounts::Portals', type: :request do
|
||||
headers: agent.create_new_auth_token
|
||||
|
||||
expect(response).to have_http_status(:success)
|
||||
json_response = JSON.parse(response.body)
|
||||
json_response = response.parsed_body
|
||||
expect(json_response['name']).to eq portal.name
|
||||
expect(json_response['meta']['all_articles_count']).to eq 2
|
||||
expect(json_response['meta']['mine_articles_count']).to eq 1
|
||||
@@ -98,7 +98,7 @@ RSpec.describe 'Api::V1::Accounts::Portals', type: :request do
|
||||
headers: admin.create_new_auth_token
|
||||
|
||||
expect(response).to have_http_status(:success)
|
||||
json_response = JSON.parse(response.body)
|
||||
json_response = response.parsed_body
|
||||
expect(json_response['name']).to eql('test_portal')
|
||||
expect(json_response['custom_domain']).to eql('support.chatwoot.dev')
|
||||
end
|
||||
@@ -130,7 +130,7 @@ RSpec.describe 'Api::V1::Accounts::Portals', type: :request do
|
||||
headers: admin.create_new_auth_token
|
||||
|
||||
expect(response).to have_http_status(:success)
|
||||
json_response = JSON.parse(response.body)
|
||||
json_response = response.parsed_body
|
||||
expect(json_response['name']).to eql(portal_params[:portal][:name])
|
||||
expect(json_response['config']).to eql({ 'allowed_locales' => [{ 'articles_count' => 0, 'categories_count' => 0, 'code' => 'en' },
|
||||
{ 'articles_count' => 0, 'categories_count' => 0, 'code' => 'es' }] })
|
||||
@@ -150,7 +150,7 @@ RSpec.describe 'Api::V1::Accounts::Portals', type: :request do
|
||||
headers: admin.create_new_auth_token
|
||||
|
||||
expect(response).to have_http_status(:success)
|
||||
json_response = JSON.parse(response.body)
|
||||
json_response = response.parsed_body
|
||||
expect(json_response['archived']).to eql(portal_params[:portal][:archived])
|
||||
|
||||
portal.reload
|
||||
@@ -204,7 +204,7 @@ RSpec.describe 'Api::V1::Accounts::Portals', type: :request do
|
||||
headers: admin.create_new_auth_token
|
||||
|
||||
expect(response).to have_http_status(:success)
|
||||
json_response = JSON.parse(response.body)
|
||||
json_response = response.parsed_body
|
||||
expect(portal.reload.member_ids).to include(agent_1.id)
|
||||
expect(json_response['portal_members'].length).to be(3)
|
||||
end
|
||||
@@ -221,7 +221,7 @@ RSpec.describe 'Api::V1::Accounts::Portals', type: :request do
|
||||
|
||||
expect(response).to have_http_status(:success)
|
||||
|
||||
blob = JSON.parse(response.body)
|
||||
blob = response.parsed_body
|
||||
|
||||
expect(blob['blob_key']).to be_present
|
||||
expect(blob['blob_id']).to be_present
|
||||
|
||||
Reference in New Issue
Block a user