Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

Commit

Permalink
modernize
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephen Sawchuk committed Oct 29, 2018
1 parent c5d97ce commit 4496918
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions test/firewall.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe('Firewall', function() {
createFirewall: util.noop,
};
const FIREWALL_NAME = 'tcp-3000';
const FIREWALL_NETWORK = 'global/networks/default';
const DEFAULT_FIREWALL_NETWORK = 'global/networks/default';

before(function() {
Firewall = proxyquire('../src/firewall.js', {
Expand Down Expand Up @@ -76,7 +76,9 @@ describe('Firewall', function() {
});

it('should default to the global network', function() {
assert.deepStrictEqual(firewall.metadata, {network: FIREWALL_NETWORK});
assert.deepStrictEqual(firewall.metadata, {
network: DEFAULT_FIREWALL_NETWORK,
});
});

it('should inherit from ServiceObject', function() {
Expand Down Expand Up @@ -187,8 +189,8 @@ describe('Firewall', function() {
assert.strictEqual(reqOpts.uri, '');
assert.strictEqual(reqOpts.json, metadata);
assert.deepStrictEqual(metadata, {
name: FIREWALL_NAME,
network: FIREWALL_NETWORK,
name: firewall.name,
network: DEFAULT_FIREWALL_NETWORK,
});

done();
Expand All @@ -198,17 +200,10 @@ describe('Firewall', function() {
});

it('should respect network specification', function(done) {
var metadata = {network: 'custom-network'};
const metadata = {network: 'custom-network'};

firewall.request = function(reqOpts) {
assert.strictEqual(reqOpts.method, 'PATCH');
assert.strictEqual(reqOpts.uri, '');
assert.strictEqual(reqOpts.json, metadata);
assert.deepStrictEqual(metadata, {
name: FIREWALL_NAME,
network: 'custom-network',
});

assert.strictEqual(reqOpts.json.network, metadata.network);
done();
};

Expand Down

0 comments on commit 4496918

Please sign in to comment.