Browse Source

feat: test unconfirmed locations aren't options in location_id

pull/1455/head
natdeanlewissoftwire 3 years ago
parent
commit
3bf0f30d10
  1. 14
      spec/models/form/lettings/questions/location_id_spec.rb

14
spec/models/form/lettings/questions/location_id_spec.rb

@ -111,7 +111,19 @@ RSpec.describe Form::Lettings::Questions::LocationId, type: :model do
lettings_log.update!(scheme:)
end
it "the displayed_answer_options shows the active location" do
it "the displayed_answer_options shows only the active location" do
expect(question.displayed_answer_options(lettings_log).count).to eq(1)
end
end
context "and some locations are not confirmed" do
before do
FactoryBot.create(:location, scheme:, confirmed: false)
FactoryBot.create(:location, scheme:, confirmed: true)
lettings_log.update!(scheme:)
end
it "the displayed_answer_options shows only the confirmed location" do
expect(question.displayed_answer_options(lettings_log).count).to eq(1)
end
end

Loading…
Cancel
Save