Merge lp:~trapnine/maas/fix-1509535 into lp:maas/trunk

Proposed by Jeffrey C Jones on 2015-11-04
Status: Merged
Approved by: Andres Rodriguez on 2015-11-05
Approved revision: 4453
Merged at revision: 4466
Proposed branch: lp:~trapnine/maas/fix-1509535
Merge into: lp:maas/trunk
Diff against target: 36 lines (+26/-0)
1 file modified
src/maasserver/static/js/angular/controllers/tests/test_node_details_storage.js (+26/-0)
To merge this branch: bzr merge lp:~trapnine/maas/fix-1509535
Reviewer Review Type Date Requested Status
Blake Rouse 2015-11-04 Approve on 2015-11-05
Review via email: mp+276698@code.launchpad.net

Commit message

Add corresponding test for createPartition.

To post a comment you must log in.
Blake Rouse (blake-rouse) wrote :

Looks good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/maasserver/static/js/angular/controllers/tests/test_node_details_storage.js'
2--- src/maasserver/static/js/angular/controllers/tests/test_node_details_storage.js 2015-11-04 19:14:20 +0000
3+++ src/maasserver/static/js/angular/controllers/tests/test_node_details_storage.js 2015-11-04 20:46:43 +0000
4@@ -2312,6 +2312,32 @@
5 node, disk.block_id, 2.6 * 1000 * 1000 * 1000);
6 });
7
8+ // regression test for https://bugs.launchpad.net/maas/+bug/1509535
9+ it("calls createPartition with available_size bytes" +
10+ " even when human size gets rounded down", function() {
11+
12+ var controller = makeController();
13+ var disk = {
14+ block_id: makeInteger(0, 100),
15+ original: {
16+ partition_table_type: "mbr",
17+ available_size: 2.035 * 1000 * 1000 * 1000,
18+ available_size_human: "2.0 GB",
19+ block_size: 512
20+ },
21+ $options: {
22+ size: "2.0",
23+ sizeUnits: "GB"
24+ }
25+ };
26+ spyOn(NodesManager, "createPartition");
27+
28+ $scope.availableConfirmPartition(disk);
29+
30+ expect(NodesManager.createPartition).toHaveBeenCalledWith(
31+ node, disk.block_id, 2.035 * 1000 * 1000 * 1000);
32+ });
33+
34 it("calls createPartition with bytes minus partition table extra",
35 function() {
36 var controller = makeController();