Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Add spec for direct login case

Oliver Günther5663a557eec0
diff --git a/spec/controllers/account_controller_spec.rb b/spec/controllers/account_controller_spec.rb
index d405fb1c64d..3e321e63d53 100644
--- a/spec/controllers/account_controller_spec.rb
+++ b/spec/controllers/account_controller_spec.rb
@@ -320,6 +320,22 @@ describe AccountController, type: :controller do
end
end
+ context 'with direct login and redirecting callback',
+ with_settings: { login_required?: true },
+ with_config: { omniauth_direct_login_provider: 'foo' } do
+
+ it 'will still call the callback' do
+ # Set the previous session
+ session[:foo] = 'bar'
+
+ get :logout
+ expect(response).to redirect_to '/login'
+
+ # Expect session to be cleared
+ expect(session[:foo]).to eq nil
+ end
+ end
+
it 'will call the callback' do
# Set the previous session
session[:foo] = 'bar'