File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -65,6 +65,7 @@ def welsh?
6565 end
6666
6767 def copy_of_answers_enabled?
68+ return false unless Settings . copy_of_answers_enabled
6869 return false unless form_document . respond_to? ( :send_copy_of_answers )
6970
7071 form_document . send_copy_of_answers == "enabled"
Original file line number Diff line number Diff line change @@ -74,3 +74,6 @@ show_browser_during_tests: false
7474cloudwatch_metrics_enabled : false
7575
7676analytics_enabled : false
77+
78+ # Allows us to globally disable users getting a copy of their answers in the case that One Login is unavailable.
79+ copy_of_answers_enabled : true
Original file line number Diff line number Diff line change 186186 it "returns true" do
187187 expect ( form . copy_of_answers_enabled? ) . to be true
188188 end
189+
190+ context "when the global copy_of_answers_enabled setting is set to false" do
191+ before do
192+ allow ( Settings ) . to receive ( :copy_of_answers_enabled ) . and_return ( false )
193+ end
194+
195+ it "returns false" do
196+ expect ( form . copy_of_answers_enabled? ) . to be false
197+ end
198+ end
189199 end
190200
191201 context "when send_copy_of_answers is \" disabled\" " do
You can’t perform that action at this time.
0 commit comments