Skip to content

Commit

Permalink
avoid AnonymousUser persisting in after(:all) block
Browse files Browse the repository at this point in the history
  • Loading branch information
ulferts committed Mar 18, 2024
1 parent a481074 commit 6f5095a
Showing 1 changed file with 4 additions and 4 deletions.
Expand Up @@ -36,13 +36,13 @@
include UserPermissionsHelper

def enable_module(project, modul)
project.enabled_module_names = project.enabled_module_names + [modul]
project.save
project.enabled_modules.create(name: modul)
end

def disable_module(project, modul)
project.enabled_module_names = project.enabled_module_names - [modul]
project.save
# Avoid project.enabled_module_names and a subsequent save as that would create an AnonymousUser in an
# after(:all) block, which persists the user in the RequestStore.
project.enabled_modules.detect { |m| m.name == modul }.destroy
end

shared_association_default(:priority) { create(:priority) }
Expand Down

0 comments on commit 6f5095a

Please sign in to comment.