Skip to content
Snippets Groups Projects
Commit f7f36b35 authored by Vitali Tatarintev's avatar Vitali Tatarintev
Browse files

Check custom mapping params from the response

Check the custom mapping's payloadExamle and payloadAttributeMappings
from the GraphQL query response instead of check the model itself
parent ae79a7c1
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -40,6 +40,10 @@
name
active
url
payloadExample
payloadAttributeMappings {
fieldName
}
}
QL
end
Loading
Loading
@@ -51,10 +55,11 @@
it 'updates integration without the custom mapping params', :aggregate_failures do
post_graphql_mutation(mutation, current_user: current_user)
 
integration_response = mutation_response['integration']
expect(response).to have_gitlab_http_status(:success)
integration.reload
expect(integration.payload_example).to eq({})
expect(integration.payload_attribute_mapping).to eq({})
expect(integration_response['payloadExample']).to eq('{}')
expect(integration_response['payloadAttributeMappings']).to be_empty
end
end
 
Loading
Loading
@@ -116,10 +121,8 @@
expect(response).to have_gitlab_http_status(:success)
expect(integration_response['id']).to eq(GitlabSchema.id_from_object(integration).to_s)
expect(integration_response['name']).to eq('Modified Name')
integration.reload
expect(integration.payload_example).to eq({})
expect(integration.payload_attribute_mapping).to eq({})
expect(integration_response['payloadExample']).to eq('{}')
expect(integration_response['payloadAttributeMappings']).to be_empty
end
end
 
Loading
Loading
@@ -135,10 +138,8 @@
expect(response).to have_gitlab_http_status(:success)
expect(integration_response['id']).to eq(GitlabSchema.id_from_object(integration).to_s)
expect(integration_response['name']).to eq('Modified Name')
integration.reload
expect(integration.payload_example).to eq({})
expect(integration.payload_attribute_mapping).to eq({})
expect(integration_response['payloadExample']).to eq('{}')
expect(integration_response['payloadAttributeMappings']).to be_empty
end
end
 
Loading
Loading
@@ -155,6 +156,10 @@
integration {
id
name
payloadExample
payloadAttributeMappings {
fieldName
}
}
QL
end
Loading
Loading
@@ -168,6 +173,8 @@
expect(response).to have_gitlab_http_status(:success)
expect(integration_response['id']).to eq(GitlabSchema.id_from_object(integration).to_s)
expect(integration_response['name']).to eq('Modified Name')
expect(integration_response['payloadExample']).not_to eq('{}')
expect(integration_response['payloadAttributeMappings']).to be_present
 
integration.reload
expect(integration.payload_example).to eq(current_payload_example)
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment