peteshow 0.8.4 → 0.8.5

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.
@@ -188,8 +188,9 @@
188
188
  <script src='../vendor/jquery.formatdatetime.js'></script>
189
189
  <script src='../vendor/jquery.cookie.js'></script>
190
190
  <script src='../src/peteshow.js'></script>
191
- <script src='../src/peteshow-core.js'></script>
191
+ <script src='../src/peteshow-storage.js'></script>
192
192
  <script src='../src/peteshow-helpers.js'></script>
193
+ <script src='../src/peteshow-core.js'></script>
193
194
 
194
195
  <script>
195
196
  Peteshow.init({
@@ -9,7 +9,7 @@ module('reusing values from cookies', {
9
9
  },
10
10
  teardown: function() {
11
11
  Peteshow.destroy();
12
- Peteshow.clearCookies();
12
+ Peteshow.storage.clear();
13
13
  }
14
14
  });
15
15
 
@@ -22,7 +22,7 @@ test('fields are saved into cookies', function() {
22
22
  // field was saved
23
23
  ok($.cookie('peteshow') != null, 'cookie isnt null')
24
24
 
25
- var saved = Peteshow.getSavedFields();
25
+ var saved = Peteshow.storage.get();
26
26
 
27
27
  // saved values equal the initial values
28
28
  equal(saved[field], input, 'saved value equals initial input');
@@ -11,7 +11,8 @@ module('core plugin', {
11
11
  'input[name*=zip]' : '60611',
12
12
  'input[name*=middle_name]' : Faker.Name.firstName(),
13
13
  'input[name*=custom_name]' : function() { return 'Custom' },
14
- }
14
+ },
15
+ ignore : ['phone', 'input[name=phone]', '#qunit-modulefilter'],
15
16
  });
16
17
  },
17
18
  teardown: function() {
@@ -19,6 +20,10 @@ module('core plugin', {
19
20
  }
20
21
  });
21
22
 
23
+ test('should be defined on window', function() {
24
+ equal(true, $.isPlainObject(Peteshow), 'window.Peteshow exists');
25
+ });
26
+
22
27
  test('should have been added to the dom', function() {
23
28
  equal(1, $('#peteshow').length, 'peteshow exists')
24
29
  });
@@ -31,7 +36,6 @@ test('should have valid values from defaults after filling out forms', function(
31
36
  'input[type=text]' : TEXT_REGEX,
32
37
  'input[type=email], input[name*=email]' : EMAIL_REGEX,
33
38
  'input[name*=number], input[type=number]' : NUMBER_REGEX,
34
- 'input[name*=phone]' : PHONE_NUMBER_REGEX,
35
39
  'input[type=date]' : DATE_REGEX,
36
40
  'input[name*=first_name]' : TEXT_REGEX,
37
41
  'input[name*=last_name]' : TEXT_REGEX,
@@ -57,6 +61,11 @@ test('should have valid values from defaults after filling out forms', function(
57
61
  });
58
62
  });
59
63
 
64
+ test('should ignore fields', function() {
65
+ Peteshow.fillOutForms();
66
+ equal(true, $('input[name=phone]').val() == '');
67
+ });
68
+
60
69
  test('should have valid values from plugin after filling out forms', function() {
61
70
  Peteshow.fillOutForms();
62
71
 
@@ -8,7 +8,7 @@ module('reusing values from localstorage', {
8
8
  },
9
9
  teardown: function() {
10
10
  Peteshow.destroy();
11
- Peteshow.clearLocalStorage();
11
+ Peteshow.storage.clear();
12
12
  }
13
13
  });
14
14
 
@@ -21,6 +21,8 @@ test('fields are saved into localstorage', function() {
21
21
  // field was saved
22
22
  ok(localStorage.getItem('peteshow') != null, 'localstorge isnt null')
23
23
 
24
+ var saved = Peteshow.storage.get();
25
+
24
26
  // saved values equal the initial values
25
27
  equal(saved[field], input, 'saved value equals initial input');
26
28
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: peteshow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.4
4
+ version: 0.8.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-08-19 00:00:00.000000000 Z
12
+ date: 2014-08-20 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Javascript plugin for filling out forms with fake data for testing purposes
15
15
  email: brousapg@gmail.com
@@ -38,12 +38,12 @@ files:
38
38
  - src/css/peteshow.css
39
39
  - src/peteshow-core.js
40
40
  - src/peteshow-helpers.js
41
+ - src/peteshow-storage.js
41
42
  - src/peteshow.js
42
43
  - tests/index.html
43
44
  - tests/playground.html
44
45
  - tests/suite/cookies.js
45
46
  - tests/suite/core.js
46
- - tests/suite/helpers.js
47
47
  - tests/suite/keybindings.js
48
48
  - tests/suite/localstorage.js
49
49
  - tests/suite/options.js
@@ -1,29 +0,0 @@
1
- module('helpers');
2
-
3
- test('should be defined on window', function() {
4
- equal(true, $.isPlainObject(Peteshow), 'window.Peteshow exists');
5
- });
6
-
7
- // replace this nonsense with functional tests
8
- test('should exist in peteshow', function() {
9
- equal(true, $.isFunction(Peteshow.randomChars), 'randomChars is a function');
10
- equal(true, $.isFunction(Peteshow.randomLetters), 'randomLetters is a function');
11
- equal(true, $.isFunction(Peteshow.randomNumberRange), 'randomNumberRange is a function');
12
- equal(true, $.isFunction(Peteshow.randomNumber), 'randomNumber is a function');
13
- equal(true, $.isFunction(Peteshow.randomDate), 'randomDate is a function');
14
- equal(true, $.isFunction(Peteshow.randomEmail), 'randomEmail is a function');
15
- equal(true, $.isFunction(Peteshow.formatDate), 'formatDate is a function');
16
-
17
- equal(true, $.isFunction(Peteshow.init), 'init helper is a function');
18
- equal(true, $.isFunction(Peteshow.hide), 'hide helper is a function');
19
- equal(true, $.isFunction(Peteshow.toggle), 'toggle helper is a function');
20
- equal(true, $.isFunction(Peteshow.show), 'show helper is a function');
21
- equal(true, $.isFunction(Peteshow.destroy), 'destroy helper is a function');
22
- equal(true, $.isFunction(Peteshow.fillOutForms), 'fillOutForms helper is a function');
23
- equal(true, $.isFunction(Peteshow.submitForm), 'submitForm helper is a function');
24
- equal(true, $.isFunction(Peteshow.clearLocalStorage), 'clearLocalStorage helper is a function');
25
- equal(true, $.isFunction(Peteshow.clearCookies), 'clearCookies helper is a function');
26
- equal(true, $.isFunction(Peteshow.clearSaved), 'clearSaved helper is a function');
27
- equal(true, $.isFunction(Peteshow.getSavedFields), 'getSavedFields helper is a function');
28
- equal(true, $.isFunction(Peteshow.setSavedFields), 'setSavedFields helper is a function');
29
- });