1
0
mirror of synced 2026-08-06 02:16:55 +00:00

Fix specs.

This commit is contained in:
Guo Xiang Tan
2016-08-19 16:46:03 +08:00
parent e1475f4c5c
commit 891be329d7
+21 -7
View File
@@ -29,13 +29,27 @@ describe DataExplorer::QueryController do
end
it 'denies every request' do
get :index; expect(response.body).to be_empty # check_xhr fail
expect { xhr :get, :index }.to raise_error ApplicationController::PluginDisabled
expect { xhr :get, :schema }.to raise_error ApplicationController::PluginDisabled
expect { xhr :get, :show, id: 3 }.to raise_error ApplicationController::PluginDisabled
expect { xhr :post, :create, id: 3 }.to raise_error ApplicationController::PluginDisabled
expect { xhr :post, :run, id: 3 }.to raise_error ApplicationController::PluginDisabled
expect { xhr :put, :update, id: 3 }.to raise_error ApplicationController::PluginDisabled
expect { xhr :delete, :destroy, id: 3 }.to raise_error ApplicationController::PluginDisabled
xhr :get, :index
expect(response.status).to eq(404)
xhr :get, :schema
expect(response.status).to eq(404)
xhr :get, :show, id: 3
expect(response.status).to eq(404)
xhr :post, :create, id: 3
expect(response.status).to eq(404)
xhr :post, :run, id: 3
expect(response.status).to eq(404)
xhr :put, :update, id: 3
expect(response.status).to eq(404)
xhr :delete, :destroy, id: 3
expect(response.status).to eq(404)
end
end