Sha256: 8c07526d6131f799630ebdfa041c9ac660b71c5619403db2a9f2b822a83025ad

Contents?: true

Size: 1.23 KB

Versions: 1

Compression:

Stored size: 1.23 KB

Contents

if defined?(CypressOnRails)
  CypressOnRails.configure do |c|
    c.api_prefix = "<%= options.api_prefix %>"
    c.install_folder = File.expand_path("#{__dir__}/../../<%= options.install_folder %>")
    # WARNING!! CypressOnRails can execute arbitrary ruby code
    # please use with extra caution if enabling on hosted servers or starting your local server on 0.0.0.0
    c.use_middleware = !Rails.env.production?
    <% unless options.experimental %># <% end %> c.use_vcr_middleware = !Rails.env.production?
    c.logger = Rails.logger

    # If you want to enable a before_request logic, such as authentication, logging, sending metrics, etc.
    #   Refer to https://www.rubydoc.info/gems/rack/Rack/Request for the `request` argument.
    #   Return nil to continue through the Cypress command. Return a response [status, header, body] to halt.
    # c.before_request = lambda { |request|
    #   unless request.env['warden'].authenticate(:secret_key)
    #     return [403, {}, ["forbidden"]]
    #   end
    # }
  end

  # # if you compile your asssets on CI
  # if ENV['CYPRESS'].present? && ENV['CI'].present?
  #  Rails.application.configure do
  #    config.assets.compile = false
  #    config.assets.unknown_asset_fallback = false
  #  end
  # end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cypress-on-rails-1.16.0 lib/generators/cypress_on_rails/templates/config/initializers/cypress_on_rails.rb.erb