Skip to content

Commit

Permalink
Add test about name parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
gjgd committed Jul 24, 2018
1 parent 2d63dc6 commit a50a55c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 0 additions & 1 deletion contracts/JobManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ contract JobManager {
mapping(uint => Job) public jobs;

function submitMineral(string _name, uint _category) external {
// TODO name must be non null
// Mineral has to be one of two categories: Compute or Storage
MineralCategory mc;
if(_category == uint(MineralCategory.Compute)) {
Expand Down
8 changes: 8 additions & 0 deletions test/JobManager.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ contract('JobManager', accounts => {
}
});
});

it('should accept no name for Mineral', async () => {
const mineralId = (await jm.numberOfMinerals.call()).toNumber();
await jm.submitMineral("", MINERAL_COMPUTE);
const mineral = await jm.minerals.call(mineralId);
let [name, _] = mineral;
assert.equal("", name);
});
});

describe('job', () => {
Expand Down

0 comments on commit a50a55c

Please sign in to comment.