Skip to content

Commit

Permalink
sug-651 default service url
Browse files Browse the repository at this point in the history
  • Loading branch information
format1981 committed Nov 28, 2016
1 parent 660aaf9 commit 9580698
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Changelog
=========

### 25.11.2016 16.10.3

* добавлен дефолтный serviceUrl

### 25.11.2016 16.10.2

* добавлена поддержка ограничения по коду ФИАС
Expand Down
6 changes: 3 additions & 3 deletions dist/js/jquery.suggestions.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* DaData.ru Suggestions jQuery plugin, version 16.10.2
* DaData.ru Suggestions jQuery plugin, version 16.10.3
*
* DaData.ru Suggestions jQuery plugin is freely distributable under the terms of MIT-style license
* Built on DevBridge Autocomplete for jQuery (https://github.com/devbridge/jQuery-Autocomplete)
Expand Down Expand Up @@ -36,7 +36,7 @@
wordPartsSplitter = new RegExp('[' + wordPartsDelimiters + ']+', 'g'),
defaultOptions = {
autoSelectFirst: false,
serviceUrl: null,
serviceUrl: 'https://suggestions.dadata.ru/suggestions/api/4_1/rs',
onSearchStart: $.noop,
onSearchComplete: $.noop,
onSearchError: $.noop,
Expand Down Expand Up @@ -984,7 +984,7 @@

Suggestions.defaultOptions = defaultOptions;

Suggestions.version = '16.10.2';
Suggestions.version = '16.10.3';

$.Suggestions = Suggestions;

Expand Down
6 changes: 3 additions & 3 deletions dist/js/jquery.suggestions.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "suggestions-jquery",
"version": "16.10.2",
"version": "16.10.3",
"description": "DaData.ru Suggestions jQuery plugin",
"homepage": "https://github.com/hflabs/suggestions-jquery",
"author": {
Expand Down
2 changes: 1 addition & 1 deletion src/jquery.suggestions.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
wordPartsSplitter = new RegExp('[' + wordPartsDelimiters + ']+', 'g'),
defaultOptions = {
autoSelectFirst: false,
serviceUrl: null,
serviceUrl: 'https://suggestions.dadata.ru/suggestions/api/4_1/rs',
onSearchStart: $.noop,
onSearchComplete: $.noop,
onSearchError: $.noop,
Expand Down
25 changes: 25 additions & 0 deletions test/specs/initialization_specs.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,31 @@ describe('Initialization', function () {

});

describe('check defaults', function () {

beforeEach(function () {
this.input = document.createElement('input');
this.$input = $(this.input).appendTo($body);
this.instance = this.$input.suggestions({
type: 'NAME'
}).suggestions();

helpers.returnGoodStatus(this.server);
});

afterEach(function () {
this.instance.dispose();
this.$input.remove();
});

it('serviceUrl', function () {
expect(this.instance.options.serviceUrl).toEqual($.Suggestions.defaultOptions.serviceUrl);
});

checkInitialized();

});

describe('hidden element', function () {

// create input, but do not add it to DOM
Expand Down

0 comments on commit 9580698

Please sign in to comment.