Show verification info only if verification is enabled
This commit is contained in:
@@ -6,6 +6,6 @@ class Account::VerifyAccountComponent < ApplicationComponent
|
|||||||
end
|
end
|
||||||
|
|
||||||
def render?
|
def render?
|
||||||
!account.organization?
|
Setting["feature.user.skip_verification"].blank? && !account.organization?
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
require "rails_helper"
|
require "rails_helper"
|
||||||
|
|
||||||
describe Account::VerifyAccountComponent do
|
describe Account::VerifyAccountComponent do
|
||||||
|
context "verification is enabled" do
|
||||||
|
before { Setting["feature.user.skip_verification"] = false }
|
||||||
|
|
||||||
it "shows a link to verify account to unverified users" do
|
it "shows a link to verify account to unverified users" do
|
||||||
account = User.new
|
account = User.new
|
||||||
|
|
||||||
@@ -35,4 +38,17 @@ describe Account::VerifyAccountComponent do
|
|||||||
|
|
||||||
expect(page).not_to be_rendered
|
expect(page).not_to be_rendered
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
context "verification is disabled" do
|
||||||
|
before { Setting["feature.user.skip_verification"] = true }
|
||||||
|
|
||||||
|
it "does not show verification info to anyone" do
|
||||||
|
account = User.new
|
||||||
|
|
||||||
|
render_inline Account::VerifyAccountComponent.new(account)
|
||||||
|
|
||||||
|
expect(page).not_to be_rendered
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user