Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sets the mobile app up to run tests, adds a test in for the sharing s…
…ervice and fixes the sharing service
- Loading branch information
Leah Jones
committed
Nov 14, 2014
1 parent
a5ed48c
commit 4060b50
Showing
14 changed files
with
166 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
|
||
"MODE": "development" | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
{ | ||
|
||
"MODE": "production", | ||
|
||
"API": { | ||
"VERSION": 1, | ||
"ENDPOINT": "http://127.0.0.1:5000/api" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
|
||
"MODE": "test", | ||
|
||
"SHARING": { | ||
"URL": "testURL", | ||
"MESSAGES": { | ||
"SMS": "test: %s", | ||
"EMAIL": { | ||
"SUBJECT": "test", | ||
"BODY": "test: %s" | ||
}, | ||
"FACEBOOK": "test: %s", | ||
"TWITTER": "test: %s", | ||
"OTHER": "test: %s" | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/** | ||
* Runs mocha tests for the app. | ||
*/ | ||
|
||
var gulp = require('gulp'); | ||
var karma = require('karma').server; | ||
|
||
var config = require('../config').test; | ||
|
||
gulp.task('test', ['build'], function(done) { | ||
|
||
karma.start(config.karma, function(exitCode) { | ||
done(); | ||
}); | ||
|
||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
describe('Unit: Sharing Service', function() { | ||
|
||
beforeEach(module('acm')); | ||
|
||
var mock; | ||
before(function() { | ||
|
||
window.plugins.socialsharing = { | ||
shareViaEmail: function() {}, | ||
shareViaSMS: function() {}, | ||
shareViaFacebook: function() {}, | ||
shareViaTwitter: function() {}, | ||
share: function() {} | ||
}; | ||
|
||
mock = sinon.mock(window.plugins.socialsharing); | ||
|
||
mock.expects('shareViaEmail').once().withExactArgs('test: testURL', 'test', null, null, null, null); | ||
mock.expects('shareViaSMS').once().withExactArgs('test: testURL', undefined); | ||
mock.expects('shareViaFacebook').once().withExactArgs('test: testURL', undefined, 'testURL'); | ||
mock.expects('shareViaTwitter').once().withExactArgs('test: testURL', undefined, 'testURL'); | ||
mock.expects('share').once().withExactArgs('test: testURL', null, null, 'testURL'); | ||
}); | ||
|
||
var acmSharing; | ||
beforeEach(inject(function(_acmSharing_) { | ||
acmSharing = _acmSharing_; | ||
})); | ||
|
||
it('should do something', function() { | ||
acmSharing.shareApp('EMAIL'); | ||
acmSharing.shareApp('SMS'); | ||
acmSharing.shareApp('FACEBOOK'); | ||
acmSharing.shareApp('TWITTER'); | ||
acmSharing.shareApp('OTHER'); | ||
mock.verify(); | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,11 @@ | ||
/** | ||
* Mocha setup. | ||
*/ | ||
|
||
before(function() { | ||
window.plugins = window.plugins || {}; | ||
}); | ||
|
||
after(function() { | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters