pull/10638/head
Javier Torres 8 years ago
parent f127ad53ea
commit e05e190182

@ -8,6 +8,7 @@ FactoryGirl.define do
order 1
type 'formula'
title 'The Title'
source_id 'a0'
options do
{
type: "formula",

@ -69,7 +69,7 @@ shared_context 'layer hierarchy' do
title: 'the title',
options: { 'a field' => 'first', 'another field' => 'second' },
order: nil,
source: nil,
source: { id: 'a0' },
style: { 'widget_style': { 'fill': 'wadus' } })
payload = {
@ -230,6 +230,12 @@ describe Carto::Api::WidgetsController do
other_map.destroy
end
it 'returns 422 if missing source' do
post_json widgets_url(user_domain: @user1.username, map_id: @map.id, map_layer_id: @widget.layer_id, api_key: @user1.api_key), widget_payload(source: nil), http_json_headers do |response|
response.status.should == 422
end
end
it 'returns 403 if visualization is private and current user is not the owner' do
post_json widgets_url(user_domain: @user2.username, map_id: @map.id, map_layer_id: @widget.layer_id, api_key: @user2.api_key), widget_payload, http_json_headers do |response|
response.status.should == 403

Loading…
Cancel
Save