Browse Source

test

pull/1832/head
Kat 3 years ago
parent
commit
7f69d1ce1a
  1. 2
      spec/helpers/filters_helper_spec.rb
  2. 9
      spec/services/csv/lettings_log_csv_service_spec.rb

2
spec/helpers/filters_helper_spec.rb

@ -176,7 +176,7 @@ RSpec.describe FiltersHelper do
let(:user) { FactoryBot.create(:user, :support, organisation: child_organisation) } let(:user) { FactoryBot.create(:user, :support, organisation: child_organisation) }
it "returns a list of all organisations" do it "returns a list of all organisations" do
expect(owning_organisation_filter_options(user)).to eq([ expect(owning_organisation_filter_options(user)).to match_array([
OpenStruct.new(id: "", name: "Select an option"), OpenStruct.new(id: "", name: "Select an option"),
OpenStruct.new(id: child_organisation.id, name: "Child organisation"), OpenStruct.new(id: child_organisation.id, name: "Child organisation"),
OpenStruct.new(id: absorbed_organisation.id, name: "Absorbed organisation"), OpenStruct.new(id: absorbed_organisation.id, name: "Absorbed organisation"),

9
spec/services/csv/lettings_log_csv_service_spec.rb

@ -28,6 +28,15 @@ RSpec.describe Csv::LettingsLogCsvService do
let(:logs) { [log] } let(:logs) { [log] }
let(:headers) { csv.first } let(:headers) { csv.first }
before do
Timecop.freeze(fixed_time)
Singleton.__init__(FormHandler)
end
after do
Timecop.return
end
it "calls the form handler to get all questions in order when initialized" do it "calls the form handler to get all questions in order when initialized" do
allow(FormHandler).to receive(:instance).and_return(form_handler_mock) allow(FormHandler).to receive(:instance).and_return(form_handler_mock)
allow(form_handler_mock).to receive(:ordered_lettings_questions_for_all_years).and_return([]) allow(form_handler_mock).to receive(:ordered_lettings_questions_for_all_years).and_return([])

Loading…
Cancel
Save