Merge pull request #2681 from frewsxcv/patch-1

Use HTTPS if location protocol is HTTPS in iD.Connection
This commit is contained in:
Bryan Housel
2015-07-17 15:01:26 -04:00
2 changed files with 21 additions and 4 deletions
+13 -1
View File
@@ -2,13 +2,25 @@ describe('iD.Connection', function () {
var c;
beforeEach(function () {
c = new iD.Connection({});
c = new iD.Connection();
});
it('is instantiated', function () {
expect(c).to.be.ok;
});
it('allows insecure connections', function () {
expect(c.changesetURL(2)).to.match(/^http:/);
c = new iD.Connection(false);
expect(c.changesetURL(2)).to.match(/^http:/);
});
it('allows secure connections', function () {
c = new iD.Connection(true);
expect(c.changesetURL(2)).to.match(/^https:/);
});
describe('#changesetUrl', function() {
it('provides a changeset url', function() {
expect(c.changesetURL(2)).to.eql('http://www.openstreetmap.org/changeset/2');