no longer warns against a lazy spec implementation if AnonymousUser is set

pull/243/head
Jens Ulferts 11 years ago
parent ceb9156a0b
commit a47e672bb2
  1. 4
      spec/spec_helper.rb

@ -86,7 +86,9 @@ module OpenProject::RSpecLazinessWarn
def self.warn_if_user_current_set(example) def self.warn_if_user_current_set(example)
# Using the hacky way of getting current_user to avoid under the hood creation of AnonymousUser # Using the hacky way of getting current_user to avoid under the hood creation of AnonymousUser
# which might break other tests and at least leaves this user in the db after the test is run. # which might break other tests and at least leaves this user in the db after the test is run.
unless User.instance_variable_get(:@current_user).nil? current_user = User.instance_variable_get(:@current_user)
unless current_user.nil? || current_user.is_a?(AnonymousUser)
# we only want an abbreviated_stacktrace because the logfiles # we only want an abbreviated_stacktrace because the logfiles
# might otherwise not be capable to show all the warnings. # might otherwise not be capable to show all the warnings.

Loading…
Cancel
Save