thin_man 0.19.10 → 0.19.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
1
  module ThinMan
2
- VERSION = "0.19.10"
2
+ VERSION = "0.19.11"
3
3
  end
@@ -10,7 +10,7 @@ module.exports = function(config) {
10
10
 
11
11
  // frameworks to use
12
12
  // available frameworks: https://npmjs.org/browse/keyword/karma-adapter
13
- frameworks: ['jasmine-ajax', 'jasmine', 'requirejs'],
13
+ frameworks: ['jasmine-ajax', 'jasmine', 'requirejs', ],
14
14
 
15
15
 
16
16
  // list of files / patterns to load in the browser
@@ -93,7 +93,6 @@ describe("thin_man", function(){
93
93
  thin.ajaxError(TestResponses.conflict);
94
94
  expect($('#test_dom_id').html()).toMatch('Required field');
95
95
  });
96
-
97
96
  });
98
97
  });
99
98
 
@@ -189,6 +188,50 @@ describe("thin_man", function(){
189
188
  });
190
189
  });
191
190
 
191
+ describe('help link functions', function(){
192
+ beforeEach(function(){
193
+ $form = affix('form');
194
+ var $meta2 = affix('meta[name="userName"]');
195
+ $meta2.attr('content', 'Name');
196
+ var $meta3 = affix('meta[name="userEmail"]');
197
+ $meta3.attr('content', 'Email');
198
+ var $meta4 = affix('meta[name="userTimeZone"]');
199
+ $meta4.attr('content', 'Mountain');
200
+ });
201
+
202
+ it('decides to send help link', function(){
203
+ var $meta1 = affix('meta[name="sendHelpLink"]');
204
+ $meta1.attr('content', 'true');
205
+ var thin = new thin_man.AjaxFormSubmission($form);
206
+ expect(thin.sendHelpLink()).toEqual(true);
207
+
208
+ $meta1.attr('content', 'false');
209
+ expect(thin.sendHelpLink()).toEqual(false);
210
+ });
211
+
212
+ it('fetches current user data', function(){
213
+ var thin = new thin_man.AjaxFormSubmission($form);
214
+ expect(thin.getCurrentUser()).toEqual({ name: 'Name', email: 'Email', time_zone: 'Mountain' })
215
+ });
216
+
217
+ it('builds help link', function(){
218
+ var thin = new thin_man.AjaxLinkSubmission($form);
219
+ thin.ajax_options = {
220
+ url: 'test.com',
221
+ type: 'GET',
222
+ data: {test: 'testing'}
223
+ };
224
+ thin.ajaxComplete(TestResponses.error);
225
+ link = thin.buildHelpLink();
226
+ expect(link).toMatch('test.com');
227
+ expect(link).toMatch('GET');
228
+ expect(link).toMatch('testing');
229
+ expect(link).toMatch('Name');
230
+ expect(link).toMatch('Email');
231
+ expect(link).toMatch('Mountain');
232
+ })
233
+ });
234
+
192
235
  describe("POST/PATCH/DELETE request", function(){
193
236
  var $form;
194
237
  beforeEach(function(){
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.19.10
4
+ version: 0.19.11
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: 2018-03-01 00:00:00.000000000 Z
11
+ date: 2018-06-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -128,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
128
128
  version: '0'
129
129
  requirements: []
130
130
  rubyforge_project:
131
- rubygems_version: 2.6.12
131
+ rubygems_version: 2.6.13
132
132
  signing_key:
133
133
  specification_version: 4
134
134
  summary: A Rails library that makes web apps lively while keeping all the logic on
@@ -139,9 +139,9 @@ test_files:
139
139
  - test/dummy/README.rdoc
140
140
  - test/javascript/spec/thinManSpec.js
141
141
  - test/javascript/jasmine-fixture.js
142
- - test/javascript/package.json
142
+ - test/javascript/jquery.js
143
143
  - test/javascript/karma.conf.js
144
+ - test/javascript/package.json
144
145
  - test/javascript/test-main.js
145
- - test/javascript/jquery.js
146
- - test/thin_man_test.rb
147
146
  - test/test_helper.rb
147
+ - test/thin_man_test.rb