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

Move tests to the right one

Klaus Zandersdf21e50ba5d8
diff --git a/modules/two_factor_authentication/spec/models/devices/default_device_spec.rb b/modules/two_factor_authentication/spec/models/device/default_device_spec.rb
similarity index 100%
rename from modules/two_factor_authentication/spec/models/devices/default_device_spec.rb
rename to modules/two_factor_authentication/spec/models/device/default_device_spec.rb
diff --git a/modules/two_factor_authentication/spec/models/devices/totp_spec.rb b/modules/two_factor_authentication/spec/models/device/totp_spec.rb
similarity index 100%
rename from modules/two_factor_authentication/spec/models/devices/totp_spec.rb
rename to modules/two_factor_authentication/spec/models/device/totp_spec.rb
diff --git a/modules/two_factor_authentication/spec/models/device/webauthn_spec.rb b/modules/two_factor_authentication/spec/models/device/webauthn_spec.rb
new file mode 100644
index 00000000000..5e504e99159
--- /dev/null
+++ b/modules/two_factor_authentication/spec/models/device/webauthn_spec.rb
@@ -0,0 +1,9 @@
+require 'spec_helper'
+
+RSpec.describe TwoFactorAuthentication::Device::Webauthn do
+ subject { create(:two_factor_authentication_device_webauthn) }
+
+ it { is_expected.to validate_presence_of(:webauthn_external_id) }
+ it { is_expected.to validate_uniqueness_of(:webauthn_external_id).scoped_to(:user_id) }
+ it { is_expected.to validate_presence_of(:webauthn_public_key) }
+end
diff --git a/modules/two_factor_authentication/spec/spec_helper.rb b/modules/two_factor_authentication/spec/spec_helper.rb
index 4351818bd68..f74661bbe40 100644
--- a/modules/two_factor_authentication/spec/spec_helper.rb
+++ b/modules/two_factor_authentication/spec/spec_helper.rb
@@ -1,2 +1,3 @@
# -- load spec_helper from OpenProject core
require "spec_helper"
+require "webauthn/fake_client"