Files
nairobi/spec/components/account/verify_account_component_spec.rb
Javi Martín 3f664e4ccd Don't ask verified users to verify their account
It was strange to tell users they need to verify their account in order
to perform all available actions when they've already verified their
account.
2023-01-04 16:06:29 +01:00

39 lines
1.2 KiB
Ruby

require "rails_helper"
describe Account::VerifyAccountComponent do
it "shows a link to verify account to unverified users" do
account = User.new
render_inline Account::VerifyAccountComponent.new(account)
expect(page).to have_content "To perform all the actions verify your account."
expect(page).to have_link "Verify my account"
end
it "shows a link to complete verification to level two verified users" do
account = User.new(level_two_verified_at: Time.current)
render_inline Account::VerifyAccountComponent.new(account)
expect(page).to have_content "To perform all the actions verify your account."
expect(page).to have_link "Complete verification"
end
it "shows information about a verified account to level three verified users" do
account = User.new(verified_at: Time.current)
render_inline Account::VerifyAccountComponent.new(account)
expect(page).not_to have_content "To perform all the actions verify your account."
expect(page).to have_content "Account verified"
end
it "does not show verification info to organizations" do
account = User.new(organization: Organization.new)
render_inline Account::VerifyAccountComponent.new(account)
expect(page).not_to be_rendered
end
end