2
* (c) Copyright 2015 Hewlett-Packard Development Company, L.P.
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
8
* http://www.apache.org/licenses/LICENSE-2.0
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
20
describe('Policy API', function() {
21
var testCall, service;
23
var toastService = {};
26
module('horizon.mock.openstack-service-api',
27
function($provide, initServices) {
28
testCall = initServices($provide, apiService, toastService);
32
beforeEach(module('horizon.app.core.openstack-service-api'));
34
beforeEach(inject(['horizon.app.core.openstack-service-api.policy', function(policyAPI) {
38
it('defines the service', function() {
39
expect(service).toBeDefined();
46
"path": "/api/policy/",
48
"error": "Policy check failed.",
52
"messageType": "warning"
56
// Iterate through the defined tests and apply as Jasmine specs.
57
angular.forEach(tests, function(params) {
58
it('defines the ' + params.func + ' call properly', function() {
59
var callParams = [apiService, service, toastService, params];
60
testCall.apply(this, callParams);