|
|
|
@ -159,6 +159,19 @@ RSpec.describe User, type: :model do |
|
|
|
expect(user.need_two_factor_authentication?(nil)).to be false |
|
|
|
expect(user.need_two_factor_authentication?(nil)).to be false |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
context "when the user is in review environment" do |
|
|
|
|
|
|
|
let(:user) { FactoryBot.create(:user, :support) } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
before do |
|
|
|
|
|
|
|
allow(Rails.env).to receive(:development?).and_return(false) |
|
|
|
|
|
|
|
allow(Rails.env).to receive(:review?).and_return(true) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "does not require 2FA" do |
|
|
|
|
|
|
|
expect(user.need_two_factor_authentication?(nil)).to be false |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
describe "paper trail" do |
|
|
|
describe "paper trail" do |
|
|
|
|