effective_test_bot 1.1.28 → 1.1.29

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5590f0c1b7be5d9eae672f585d6171c64bc9a49a809b7deb63c3cb77c6d26180
4
- data.tar.gz: bb8d8cea77300a83004d96d206a8f8ed8a11f96b7ddad4b71b71da7179f11f5b
3
+ metadata.gz: 720882b4c8bc15be729ff26a90638d345786b523862ae226b86c15f2de18e8a8
4
+ data.tar.gz: c495c1463653e9c3ab5c0ff6eefc1b935dff9ce1808bb8bb15855a3eae5beb11
5
5
  SHA512:
6
- metadata.gz: ebe2ca7bff109d9d3a844e734ab1d29112e0c88aca0c9bc7d0efc3324fb2a7c04a3947d90bb160195379d24a9f828aa9bf2483d7f2b8d6744a2da058841023b8
7
- data.tar.gz: '09d8abd2735e66d95ece47b509022cfed74372faaca8543d7c202eaa602407eb69528ed5dad2178ee5aff2bcc6bca54797897b81395cbf918f823c4c3d721cc4'
6
+ metadata.gz: f435286f63ddbe6990fa6bf09aef992b982df7542b7c2ea7cbfc60086fe8403d9b85003c22ebb0a3b77e6f856f991583895783f60c6a319dc1871debfb77eff3
7
+ data.tar.gz: 369ec84101fb1e56135d4b92939a6b296adbc9199bc7d1970ac7ceae7bd4f86cca4c068ff707df2a3c30c38bfe1b938d0d9e4553ccade05b536c22b3bd04e4d8
@@ -5,12 +5,14 @@ module EffectiveTestBotControllerHelper
5
5
  def assign_test_bot_payload(payload = {})
6
6
  payload.merge!({ response_code: response.code, assigns: test_bot_view_assigns, flash: flash.to_hash })
7
7
 
8
- if response.content_type.to_s.start_with?('text/html') && response.body[BODY_TAG].present?
8
+ media_type = (response.respond_to?(:media_type) ? response.media_type : response.content_type).to_s
9
+
10
+ if media_type.start_with?('text/html') && response.body[BODY_TAG].present?
9
11
  payload = view_context.content_tag(:script, build_payload_javascript(payload), id: 'test_bot_payload')
10
12
 
11
13
  split = response.body.split(BODY_TAG)
12
14
  response.body = "#{split.first}#{payload}#{BODY_TAG}#{split.last if split.size > 1}"
13
- elsif response.content_type.to_s.start_with?('text/javascript') && response.body.present?
15
+ elsif media_type.start_with?('text/javascript') && response.body.present?
14
16
  payload = build_payload_javascript(payload)
15
17
 
16
18
  response.body = "#{response.body};#{payload}"
@@ -1,3 +1,3 @@
1
1
  module EffectiveTestBot
2
- VERSION = '1.1.28'.freeze
2
+ VERSION = '1.1.29'.freeze
3
3
  end
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: 1.1.28
4
+ version: 1.1.29
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: 2020-09-28 00:00:00.000000000 Z
11
+ date: 2020-11-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -191,7 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
191
191
  - !ruby/object:Gem::Version
192
192
  version: '0'
193
193
  requirements: []
194
- rubygems_version: 3.1.4
194
+ rubygems_version: 3.1.2
195
195
  signing_key:
196
196
  specification_version: 4
197
197
  summary: A shared library of rails model & system tests that should pass in every