From caf6d951b36727646c7f0c85dfb0c288874a1bd3 Mon Sep 17 00:00:00 2001 From: JG Date: Fri, 20 May 2022 06:35:03 +0100 Subject: [PATCH] test for user being in dev env not being asked for 2fa --- spec/models/user_spec.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index b7d421fef..2f6fc824d 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -139,6 +139,16 @@ RSpec.describe User, type: :model do it "can filter case logs by user, year, status and organisation" do expect(user.case_logs_filters).to eq(%w[status years user organisation]) end + + context "when the user is in development environment" do + before do + allow(Rails.env).to receive(:development?).and_return(true) + end + + it "doesn't require 2FA" do + expect(user.need_two_factor_authentication?(nil)).to be false + end + end end end