effective_test_bot 0.5.11 → 0.5.12

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e716315d415bfb20ba64a443552660e343a2de2e
4
- data.tar.gz: 42ffbf4212b65bcd964affd294ca9fb5d8eb37ae
3
+ metadata.gz: 3b045d2c032fc0145a60800fb2e84911471be1f0
4
+ data.tar.gz: d8ee655c75f178669a99cdb32d1ce08baa9cb1af
5
5
  SHA512:
6
- metadata.gz: 15909967a589dbfde8b12a5e7f7075d8433bb4c92833e603438835f8961f96bd3b09889e565aa1eda32cc56fff65bdfe98ae708cbdd8f22306d03d22fb9a7a1d
7
- data.tar.gz: f269d0c2095a982c2a4549dfa212b7669f010d61e0611aa6ab3c172b63ce6cc1ee85c427cc6e2238ca9de4af97700d8a78a87e5e08d846b6ee817e8474a42630
6
+ metadata.gz: 0b2b1f7f9841417c498aef5fa39d11af3000dcd0e88db929e3b1d32c8945170c16f34e940f8f0c5cd64f21a043d5d812aa59c63b9814d9c77e80c4accce1af02
7
+ data.tar.gz: 9d2259b56764e2faf7d12ef302557317f315ba51d0aca63491e177daf28205d44b1613e1b3625358ef01930f207a9dd28dbcb04f7233d84b8020f0f64d70e8ba
@@ -1,3 +1,3 @@
1
1
  module EffectiveTestBot
2
- VERSION = '0.5.11'.freeze
2
+ VERSION = '0.5.12'.freeze
3
3
  end
@@ -83,10 +83,14 @@ module EffectiveTestBotAssertions
83
83
  assert errors.blank?, message || "(no_js_errors) Unexpected javascript error:\n#{errors.first.to_s}"
84
84
  end
85
85
 
86
- def assert_no_unpermitted_params(message = "(no_unpermitted_params) Encountered unpermitted params:\n:unpermitted_params:")
86
+ def assert_no_unpermitted_params(message = "(no_unpermitted_params) Unexpected unpermitted params:\n:unpermitted_params:")
87
87
  assert unpermitted_params.blank?, message.sub(':unpermitted_params:', unpermitted_params.to_s)
88
88
  end
89
89
 
90
+ def assert_no_flash_errors(message = "(no_flash_errors) Unexpected flash error:\n:flash_errors:")
91
+ assert (!flash.key?('error') && !flash.key?('danger')), message.sub(':flash_errors:', flash.to_s)
92
+ end
93
+
90
94
  def assert_no_exceptions(message = "(no_exceptions) Unexpected rails server exception:\n:exception:")
91
95
  # this file is created by EffectiveTestBot::Middleware when an exception is encountered in the rails app
92
96
  file = File.join(Dir.pwd, 'tmp', 'test_bot', 'exception.txt')
@@ -3,7 +3,7 @@ require 'faker'
3
3
 
4
4
  module EffectiveTestBotFormFiller
5
5
  DIGITS = ('1'..'9').to_a
6
- LETTERS = %w(A B C E G H J K L M N P R S T V X Y)
6
+ LETTERS = %w(A B C E G H J K L M N P R S T V X Y) # valid letters of a canadian postal code, eh?
7
7
 
8
8
  # Fill a boostrap tabs based form
9
9
  def fill_bootstrap_tabs_form(fills = {}, boostrap_tab_elements = nil)
@@ -182,6 +182,8 @@ module EffectiveTestBotFormFiller
182
182
  LETTERS.sample + DIGITS.sample + LETTERS.sample + ' ' + DIGITS.sample + LETTERS.sample + DIGITS.sample
183
183
  elsif attribute.include?('zip') && attribute.include?('code') # Make a US zip code
184
184
  DIGITS.sample + DIGITS.sample + DIGITS.sample + DIGITS.sample + DIGITS.sample
185
+ elsif attribute.include?('social_insurance_number') || attributes.include?('sin_number')
186
+ "#{DIGITS.sample(3).join} #{DIGITS.sample(3).join} #{DIGITS.sample(3).join}"
185
187
  elsif attribute.include?('slug')
186
188
  Faker::Lorem.words(3).join(' ').parameterize
187
189
  else
@@ -246,13 +248,15 @@ module EffectiveTestBotFormFiller
246
248
  end
247
249
 
248
250
  def value_for_input_checkbox_field(field, fill_value)
249
- if truthy?(fill_value)
250
- true
251
- elsif falsey?(fill_value)
252
- false
253
- elsif fill_value.present?
254
- fill_values = Array(fill_value) # Allow an array of fill values to be passed
255
- (fill_values.include?(field['value']) || fill_values.include?(field.find(:xpath, '..').text))
251
+ if !fill_value.nil?
252
+ if truthy?(fill_value)
253
+ true
254
+ elsif falsey?(fill_value)
255
+ false
256
+ else
257
+ fill_values = Array(fill_value) # Allow an array of fill values to be passed
258
+ (fill_values.include?(field['value']) || fill_values.include?(field.find(:xpath, '..').text))
259
+ end
256
260
  elsif field['required'].nil? == false
257
261
  true
258
262
  elsif field['value'] == 'true'
@@ -10,6 +10,7 @@ module BaseTest
10
10
  assert_no_exceptions unless test_bot_skip?(:exceptions)
11
11
  assert_page_status unless test_bot_skip?(:page_status)
12
12
  assert_no_js_errors unless test_bot_skip?(:no_js_errors)
13
+ assert_no_flash_errors unless test_bot_skip?(:no_flash_errors)
13
14
  assert_page_title unless (test_bot_skip?(:page_title) || all('head').blank? || was_download?)
14
15
  end
15
16
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_test_bot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.11
4
+ version: 0.5.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-24 00:00:00.000000000 Z
11
+ date: 2016-10-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails