邮件程序生成器规范

邮件程序生成器

当我运行 bundle exec rails generate mailer posts index show

那么功能应该通过

那么输出应该包含

      create  app/mailers/posts_mailer.rb
      invoke  erb
      create    app/views/posts_mailer
      create    app/views/posts_mailer/index.text.erb
      create    app/views/posts_mailer/index.html.erb
      create    app/views/posts_mailer/show.text.erb
      create    app/views/posts_mailer/show.html.erb
      invoke  rspec
      create    spec/mailers/posts_mailer_spec.rb
      create    spec/fixtures/posts/index
      create    spec/fixtures/posts/show
      create    spec/mailers/previews/posts_mailer_preview.rb

具有自定义 default-path 的邮件程序生成器

给定一个名为 “.rspec” 的文件,其中包含

--default-path behaviour

并且我运行 bundle exec rails generate mailer posts index show

那么功能应该通过

那么输出应该包含

      create  app/mailers/posts_mailer.rb
      invoke  erb
      create    app/views/posts_mailer
      create    app/views/posts_mailer/index.text.erb
      create    app/views/posts_mailer/index.html.erb
      create    app/views/posts_mailer/show.text.erb
      create    app/views/posts_mailer/show.html.erb
      invoke  rspec
      create    behaviour/mailers/posts_mailer_spec.rb
      create    behaviour/fixtures/posts/index
      create    behaviour/fixtures/posts/show
      create    behaviour/mailers/previews/posts_mailer_preview.rb