Skip to content

Commit 7ce37af

Browse files
committed
removed rails 5.0 check for mailer spec generator
1 parent 063f035 commit 7ce37af

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

lib/generators/rspec/mailer/templates/mailer_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
require "rails_helper"
22

33
<% 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
55
<% for action in actions -%>
66
describe "<%= action %>" do
7-
let(:mail) { <%= class_name %><%= Rails.version.to_f >= 5.0 ? "Mailer" : "" %>.<%= action %> }
7+
let(:mail) { <%= class_name %>.<%= action %> }
88
99
it "renders the headers" do
1010
expect(mail.subject).to eq(<%= action.to_s.humanize.inspect %>)

spec/generators/rspec/mailer/mailer_generator_spec.rb

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,7 @@
1313
end
1414
it { is_expected.to exist }
1515
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)}/) }
2217
it { is_expected.to contain(/describe "index" do/) }
2318
it { is_expected.to contain(/describe "show" do/) }
2419
end

0 commit comments

Comments
 (0)