thin_man 0.12.2 → 0.12.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/thin_man.js +7 -1
- data/lib/thin_man/version.rb +1 -1
- data/test/javascript/spec/thinManSpec.js +25 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7876c85cc5ac8eba96b68d282342768f4c324fea
|
4
|
+
data.tar.gz: 5d6e382a7d82aa90622dfaf35cd9a72630f58208
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f89b005636a4a6994b1bc23f64d9ca9d45dcdcf13c2e4166f5f44d3754a3c55cee066cec6e63fda161e0b530b05cb30e9560312335d52167bb8ff99d71c3a03
|
7
|
+
data.tar.gz: 008f8123e5847514aafff0168dfb392c5c50feb633f2acf975332cb63ebc6aab09a2b16206d62cda84e6d82c39a2cbf71c1741ffcf195c520c47493f6050cccd
|
@@ -47,7 +47,13 @@ var initThinMan = function(){
|
|
47
47
|
getTarget: function(){
|
48
48
|
var target_selector = this.jq_obj.data('ajax-target');
|
49
49
|
if(target_selector){
|
50
|
-
|
50
|
+
if($(target_selector).length > 0){
|
51
|
+
this.target = $(target_selector);
|
52
|
+
}else{
|
53
|
+
console.log('Warning! Thin Man selector ' + target_selector + ' not found')
|
54
|
+
}
|
55
|
+
}else{
|
56
|
+
console.log('Warning! Thin Man selector not given')
|
51
57
|
}
|
52
58
|
},
|
53
59
|
getErrorTarget: function(){
|
data/lib/thin_man/version.rb
CHANGED
@@ -182,5 +182,30 @@ describe("thin_man", function(){
|
|
182
182
|
});
|
183
183
|
});
|
184
184
|
|
185
|
+
describe("Log", function(){
|
186
|
+
beforeEach(function(){
|
187
|
+
spyOn(console, 'log');
|
188
|
+
});
|
189
|
+
|
190
|
+
it("Don't show a warning with a valid target", function(){
|
191
|
+
$link = affix('a[data-ajax-link="true"][data-ajax-target="#test_dom_id"]');
|
192
|
+
$target = affix('#test_dom_id');
|
193
|
+
thin = new thin_man.AjaxLinkSubmission($link);
|
194
|
+
expect(console.log).not.toHaveBeenCalled();
|
195
|
+
});
|
196
|
+
|
197
|
+
it("Show a warning when target not found", function(){
|
198
|
+
$link = affix('a[data-ajax-link="true"][data-ajax-target="#not_valid_target"]');
|
199
|
+
thin = new thin_man.AjaxLinkSubmission($link);
|
200
|
+
expect(console.log).toHaveBeenCalledWith('Warning! Thin Man selector #not_valid_target not found');
|
201
|
+
});
|
202
|
+
|
203
|
+
it("Show a warning when target not provided", function(){
|
204
|
+
$link = affix('a[data-ajax-link="true"]');
|
205
|
+
thin = new thin_man.AjaxLinkSubmission($link);
|
206
|
+
expect(console.log).toHaveBeenCalledWith('Warning! Thin Man selector not given');
|
207
|
+
});
|
208
|
+
});
|
209
|
+
|
185
210
|
});
|
186
211
|
});
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: thin_man
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.12.
|
4
|
+
version: 0.12.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Draut, Adam Bialek
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-02-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|