lib/rspeckled/plugins/authentication.rb in rspeckled-0.0.44 vs lib/rspeckled/plugins/authentication.rb in rspeckled-0.0.45
- old
+ new
@@ -5,17 +5,20 @@
options = example.metadata[:mock_auth]
authentication_type = if options.is_a?(Hash) && options[:type]
options[:type]
else
- :standard
+ :json_web_token
end
klass = case options
when TrueClass
User
when Hash
- options[:class] || User
+ options[:class] || described_class
+ .name[/(.*?)::/, 1]
+ .concat('::User')
+ .constantize
else
options
end
underscored_class_name = klass