Sha256: f4059c9bb16c591cc9409dc52ae87fd685fe0402ad8f76e20174bb72e109dc1f

Contents?: true

Size: 674 Bytes

Versions: 3

Compression:

Stored size: 674 Bytes

Contents

# frozen_string_literal: true

RSpec.describe "Mailer", type: :integration do
  it "use a mailer" do
    with_project do
      generate "mailer welcome"
      write "lib/bookshelf/mailers/default_user.rb", <<~EOF
        module Mailers
          module DefaultUser
            def user_name
              "Alfonso"
            end
          end
        end
      EOF

      replace "config/environment.rb", "delivery :test", <<-EOF
    delivery :test

    prepare do
      include Mailers::DefaultUser
    end
      EOF

      console do |input, _, _|
        input.puts("Mailers::Welcome.new.user_name")
      end

      expect(out).to include("Alfonso")
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
hanami-2.0.0.beta2 spec/integration/mailer_spec.rb
hanami-2.0.0.beta1.1 spec/integration/mailer_spec.rb
hanami-2.0.0.beta1 spec/integration/mailer_spec.rb