cyperful 0.1.9 → 0.1.10

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
  SHA256:
3
- metadata.gz: ddb5aa08c0bf4e4821d84a2bd2ddb99a53563684b611ec8a481f95108ec04124
4
- data.tar.gz: 89d6bb89b2c159a7f413616ba6e18066d0623d4c11efa15636f506069127fb8b
3
+ metadata.gz: f340215ffcef3e16c1738d36eb2b71461bbd32e2011598d000793326f806b6d4
4
+ data.tar.gz: 545e19084294a2d481a7e9d156f6ba5e4758fb52332c17dc2e2574be820b2256
5
5
  SHA512:
6
- metadata.gz: 4d5660be1316a7e1e125d8fbc602dedcf5b7322867f8b073106c52d91ea3c56394f49073fc17c1dd1acb58125799815b54e574b0dd51d5a93ecee1e4cea8a32a
7
- data.tar.gz: 0d430e0557fbd4494864e7136c49a7fa8288d03bb1c010590dbe5507d11749ef2673ec2baafec0275a2c8c1c9c96800284d8ba8ffdf1741da7b030d637d8e4e4
6
+ metadata.gz: 524bbb91d707a457adfa888bc8db5a2d97886714dedc026d8647d2f243f8ff381f46a47af8cffe3fb4d46242aacfd515f2dda1b2a794252f758b5899ca312e9a
7
+ data.tar.gz: e20223308f8c0df25df5aab64d97f24d4ef6f0b57bb530106e82a3234f5701f1ca434afa87dad9b50155f73043aef6b1afbe328ebb99aed35ad53fac29dc5ef9
@@ -98,15 +98,5 @@ ActionDispatch::SystemTesting::Driver.prepend(PrependSystemTestingDriver)
98
98
  # Minitest::Test::PASSTHROUGH_EXCEPTIONS << Cyperful::AbstractCommand
99
99
  # end
100
100
 
101
- # we need to allow the iframe to be embedded in the cyperful server
102
- # TODO: use Rack middleware instead to support non-Rails apps
103
- if defined?(Rails)
104
- Rails.application.config.content_security_policy do |policy|
105
- policy.frame_ancestors(:self, "localhost:#{Cyperful.config.port}")
106
- end
107
- else
108
- warn "Cyperful: Rails not detected, skipping content_security_policy fix.\nThe Cyperful UI may not work correctly."
109
- end
110
-
111
101
  # fix for: Set-Cookie (SameSite=Lax) doesn't work when within an iframe with host 127.0.0.1
112
102
  Capybara.server_host = "localhost"
@@ -0,0 +1,9 @@
1
+ # we need to allow the iframe to be embedded in the cyperful server
2
+ # TODO: consider Rack middleware instead to support non-Rails apps?
3
+ class Cyperful::Railtie < Rails::Railtie
4
+ config.after_initialize do |app|
5
+ app.config.content_security_policy do |policy|
6
+ policy.frame_ancestors(:self, "localhost:#{Cyperful.config.port}")
7
+ end
8
+ end
9
+ end
data/lib/cyperful.rb CHANGED
@@ -66,3 +66,4 @@ require "cyperful/test_parser"
66
66
  require "cyperful/ui_server"
67
67
  require "cyperful/driver"
68
68
  require "cyperful/framework_injections"
69
+ require "cyperful/railtie" if defined?(Rails::Railtie)