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:
@@ -6,7 +6,7 @@ RSpec.describe 'Public Survey Responses API', type: :request do
|
||||
conversation = create(:conversation)
|
||||
create(:message, conversation: conversation, content_type: 'input_csat')
|
||||
get "/public/api/v1/csat_survey/#{conversation.uuid}"
|
||||
data = JSON.parse(response.body)
|
||||
data = response.parsed_body
|
||||
expect(response).to have_http_status(:success)
|
||||
expect(data['conversation_id']).to eq conversation.id
|
||||
end
|
||||
@@ -30,7 +30,7 @@ RSpec.describe 'Public Survey Responses API', type: :request do
|
||||
params: params,
|
||||
as: :json
|
||||
expect(response).to have_http_status(:success)
|
||||
data = JSON.parse(response.body)
|
||||
data = response.parsed_body
|
||||
expect(data['conversation_id']).to eq conversation.id
|
||||
expect(data['csat_survey_response']['conversation_id']).to eq conversation.id
|
||||
expect(data['csat_survey_response']['feedback_message']).to eq 'amazing experience'
|
||||
|
||||
@@ -11,7 +11,7 @@ RSpec.describe 'Public Inbox Contact Conversations API', type: :request do
|
||||
get "/public/api/v1/inboxes/#{api_channel.identifier}/contacts/#{contact_inbox.source_id}/conversations"
|
||||
|
||||
expect(response).to have_http_status(:success)
|
||||
data = JSON.parse(response.body)
|
||||
data = response.parsed_body
|
||||
expect(data.length).to eq 1
|
||||
end
|
||||
|
||||
@@ -40,7 +40,7 @@ RSpec.describe 'Public Inbox Contact Conversations API', type: :request do
|
||||
post "/public/api/v1/inboxes/#{api_channel.identifier}/contacts/#{contact_inbox.source_id}/conversations"
|
||||
|
||||
expect(response).to have_http_status(:success)
|
||||
data = JSON.parse(response.body)
|
||||
data = response.parsed_body
|
||||
expect(data['id']).not_to be_nil
|
||||
end
|
||||
end
|
||||
|
||||
@@ -13,7 +13,7 @@ RSpec.describe 'Public Inbox Contact Conversation Messages API', type: :request
|
||||
get "/public/api/v1/inboxes/#{api_channel.identifier}/contacts/#{contact_inbox.source_id}/conversations/#{conversation.display_id}/messages"
|
||||
|
||||
expect(response).to have_http_status(:success)
|
||||
data = JSON.parse(response.body)
|
||||
data = response.parsed_body
|
||||
expect(data.length).to eq 2
|
||||
end
|
||||
end
|
||||
@@ -24,7 +24,7 @@ RSpec.describe 'Public Inbox Contact Conversation Messages API', type: :request
|
||||
params: { content: 'hello' }
|
||||
|
||||
expect(response).to have_http_status(:success)
|
||||
data = JSON.parse(response.body)
|
||||
data = response.parsed_body
|
||||
expect(data['content']).to eq('hello')
|
||||
end
|
||||
|
||||
@@ -35,7 +35,7 @@ RSpec.describe 'Public Inbox Contact Conversation Messages API', type: :request
|
||||
|
||||
expect(response).to have_http_status(:unprocessable_entity)
|
||||
|
||||
json_response = JSON.parse(response.body)
|
||||
json_response = response.parsed_body
|
||||
|
||||
expect(json_response['message']).to eq('Content is too long (maximum is 150000 characters)')
|
||||
end
|
||||
@@ -46,7 +46,7 @@ RSpec.describe 'Public Inbox Contact Conversation Messages API', type: :request
|
||||
params: { content: 'hello', attachments: [file] }
|
||||
|
||||
expect(response).to have_http_status(:success)
|
||||
data = JSON.parse(response.body)
|
||||
data = response.parsed_body
|
||||
expect(data['content']).to eq('hello')
|
||||
|
||||
expect(conversation.messages.last.attachments.first.file.present?).to be(true)
|
||||
@@ -62,7 +62,7 @@ RSpec.describe 'Public Inbox Contact Conversation Messages API', type: :request
|
||||
params: { submitted_values: [{ title: 'test' }] }
|
||||
|
||||
expect(response).to have_http_status(:success)
|
||||
data = JSON.parse(response.body)
|
||||
data = response.parsed_body
|
||||
expect(data['content_attributes']['submitted_values'].first['title']).to eq 'test'
|
||||
end
|
||||
|
||||
@@ -77,7 +77,7 @@ RSpec.describe 'Public Inbox Contact Conversation Messages API', type: :request
|
||||
as: :json
|
||||
|
||||
expect(response).to have_http_status(:success)
|
||||
data = JSON.parse(response.body)
|
||||
data = response.parsed_body
|
||||
expect(data['content_attributes']['submitted_values']['csat_survey_response']['feedback_message']).to eq 'amazing experience'
|
||||
expect(data['content_attributes']['submitted_values']['csat_survey_response']['rating']).to eq 4
|
||||
end
|
||||
|
||||
@@ -22,7 +22,7 @@ RSpec.describe 'Public Portals API', type: :request do
|
||||
get "/hc/#{portal.slug}/en"
|
||||
|
||||
expect(response).to have_http_status(:unauthorized)
|
||||
json_response = JSON.parse(response.body)
|
||||
json_response = response.parsed_body
|
||||
|
||||
expect(json_response['error']).to eql "Domain: www.example.com is not registered with us. \
|
||||
Please send us an email at support@chatwoot.com with the custom domain name and account API key"
|
||||
|
||||
Reference in New Issue
Block a user