We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It's possible to add emails into test flows using actionmailer test deliveries.
The core code below:
config/initializers/cypress_on_rails.rb
if defined?(CypressOnRails) CypressOnRails.configure do |c| c.cypress_folder = File.expand_path("#{__dir__}/../../cypress") c.use_middleware = !Rails.env.production? c.logger = Rails.logger end if ENV['CYPRESS'].present? Rails.application.configure do config.active_job.queue_adapter = :inline ActionMailer::Base.delivery_method = :test config.action_mailer.delivery_method = :test config.action_mailer.default_url_options = { host: 'http://localhost:5017' } end end end
routes.rb
Rails.application.routes.draw do scope path: '/__cypress__', controller: 'cypress' do get 'view_email', action: 'view_email' end end
app/controllers/cypress_controller.rb
class CypressController < ActionController::Base # rubocop:disable Rails/ApplicationController def view_email email = params.require(:email) @mail = ActionMailer::Base.deliveries.reverse.find { |mail| mail.to.include?(email) } render layout: false end end
app/views/cypress/view_email
<% if @mail %> Subject: <%= @mail.subject %> <hr> <%= raw(@mail.html_part ? @mail.html_part.body : @mail.body) %> <% else %> No Email found <% end %>
This needs to be converted to work automatically and README example needs to be added
The text was updated successfully, but these errors were encountered:
No branches or pull requests
It's possible to add emails into test flows using actionmailer test deliveries.
The core code below:
config/initializers/cypress_on_rails.rb
routes.rb
app/controllers/cypress_controller.rb
app/views/cypress/view_email
This needs to be converted to work automatically and README example needs to be added
The text was updated successfully, but these errors were encountered: