Merge pull request #149 from JGcarv/feature/contactable

Added a contactable contract
This commit is contained in:
Manuel Aráoz
2017-02-22 18:21:39 -03:00
committed by GitHub
2 changed files with 46 additions and 0 deletions

View File

@ -0,0 +1,16 @@
pragma solidity ^0.4.0;
import './Ownable.sol';
/*
* Contactable token
* Basic version of a contactable contract
*/
contract Contactable is Ownable{
string public contactInformation;
function setContactInformation(string info) onlyOwner{
contactInformation = info;
}
}

30
test/Contactable.js Normal file
View File

@ -0,0 +1,30 @@
'use strict';
const assertJump = require('./helpers/assertJump');
var Contactable = artifacts.require('../contracts/ownership/Contactable.sol');
contract('Contactable', function(accounts) {
let contactable;
beforeEach(async function() {
contactable = await Contactable.new();
});
it('should have an empty contact info', async function() {
let info = await contactable.contactInformation();
assert.isTrue(info == "");
});
describe('after setting the contact information', function () {
let contactInfo = "contact information"
beforeEach(async function () {
await contactable.setContactInformation(contactInfo);
});
it('should return the setted contact information', async function() {
let info = await contactable.contactInformation();
assert.isTrue(info === contactInfo);
});
});
});