diff --git a/app/views/hooks/login/_providers.html.erb b/app/views/hooks/login/_providers.html.erb
index 11bc2c50de..c172d1eeaf 100644
--- a/app/views/hooks/login/_providers.html.erb
+++ b/app/views/hooks/login/_providers.html.erb
@@ -40,19 +40,21 @@ See doc/COPYRIGHT.rdoc for more details.
end
%>
-
<% end %>
-
+ <% end -%>
<%= pro[:display_name] || pro[:name] %>
<% end %>
diff --git a/spec/views/hooks/login/_providers.html.erb_spec.rb b/spec/views/hooks/login/_providers.html.erb_spec.rb
index 60ea99e042..a6a313ea38 100644
--- a/spec/views/hooks/login/_providers.html.erb_spec.rb
+++ b/spec/views/hooks/login/_providers.html.erb_spec.rb
@@ -37,6 +37,7 @@ describe 'rendering the login buttons for all providers' do
]
end
+
before do
allow(OpenProject::Plugins::AuthPlugin).to receive(:providers).and_return(providers)
@@ -52,6 +53,6 @@ describe 'rendering the login buttons for all providers' do
end
it 'should render a custom icon if defined' do
- expect(rendered).to match /#{providers[2][:icon]}/
+ expect(view.content_for(:header_tags)).to match /#{providers[2][:icon]}/
end
end