diff --git a/spec/dummy/app/views/posts/_post.html.erb b/spec/dummy/app/views/posts/_post.html.erb index 22350a4e..4225361c 100644 --- a/spec/dummy/app/views/posts/_post.html.erb +++ b/spec/dummy/app/views/posts/_post.html.erb @@ -20,14 +20,16 @@
Helpers from the controller:
<%= post.goodnight_moon %>
-
Path with decorator:
-
<%= post_path(post) %>
+ <% unless defined? mailer %> +
Path with decorator:
+
<%= post_url(post) %>
-
Path with model:
-
<%= post.path_with_model %>
+
Path with model:
+
<%= post.path_with_model %>
-
Path with id:
-
<%= post.path_with_id %>
+
Path with id:
+
<%= post.path_with_id %>
+ <% end %>
URL with decorator:
<%= post_url(post) %>
diff --git a/spec/integration/integration_spec.rb b/spec/integration/integration_spec.rb index 3175b3c4..00ab9d7c 100644 --- a/spec/integration/integration_spec.rb +++ b/spec/integration/integration_spec.rb @@ -38,16 +38,19 @@ expect(page).to have_text("Goodnight, moon!").in("#goodnight_moon") end - it "can be passed to path helpers" do - expect(page).to have_text("/en/posts/1").in("#path_with_decorator") - end + # _path helpers aren't available in mailers + if type == :view + it "can be passed to path helpers" do + expect(page).to have_text("/en/posts/1").in("#path_with_decorator") + end - it "can use path helpers with a model" do - expect(page).to have_text("/en/posts/1").in("#path_with_model") - end + it "can use path helpers with a model" do + expect(page).to have_text("/en/posts/1").in("#path_with_model") + end - it "can use path helpers with an id" do - expect(page).to have_text("/en/posts/1").in("#path_with_id") + it "can use path helpers with an id" do + expect(page).to have_text("/en/posts/1").in("#path_with_id") + end end it "can be passed to url helpers" do