File tree Expand file tree Collapse file tree 2 files changed +3
-8
lines changed
lib/generators/rspec/mailer/templates
spec/generators/rspec/mailer Expand file tree Collapse file tree 2 files changed +3
-8
lines changed Original file line number Diff line number Diff line change 1
1
require "rails_helper"
2
2
3
3
<% module_namespacing do -%>
4
- RSpec.describe <%= class_name %><%= Rails.version.to_f >= 5.0 ? "Mailer" : "" %> , <%= type_metatag(:mailer) %> do
4
+ RSpec.describe <%= class_name %>, <%= type_metatag(:mailer) %> do
5
5
<% for action in actions -%>
6
6
describe "<%= action %>" do
7
- let(:mail) { <%= class_name %><%= Rails.version.to_f >= 5.0 ? "Mailer" : "" %> .<%= action %> }
7
+ let(:mail) { <%= class_name %>.<%= action %> }
8
8
9
9
it "renders the headers" do
10
10
expect(mail.subject).to eq(<%= action.to_s.humanize.inspect %>)
Original file line number Diff line number Diff line change 13
13
end
14
14
it { is_expected . to exist }
15
15
it { is_expected . to contain ( /require "rails_helper"/ ) }
16
- if Rails . version . to_f >= 5.0
17
- # Rails 5 automatically appends Mailer to the provided constant so we do too
18
- it { is_expected . to contain ( /^RSpec.describe PostsMailer, #{ type_metatag ( :mailer ) } / ) }
19
- else
20
- it { is_expected . to contain ( /^RSpec.describe Posts, #{ type_metatag ( :mailer ) } / ) }
21
- end
16
+ it { is_expected . to contain ( /^RSpec.describe Posts, #{ type_metatag ( :mailer ) } / ) }
22
17
it { is_expected . to contain ( /describe "index" do/ ) }
23
18
it { is_expected . to contain ( /describe "show" do/ ) }
24
19
end
You can’t perform that action at this time.
0 commit comments