diff --git a/spec/helpers/tasklist_helper_spec.rb b/spec/helpers/tasklist_helper_spec.rb index 728b19c3a..18b436a8a 100644 --- a/spec/helpers/tasklist_helper_spec.rb +++ b/spec/helpers/tasklist_helper_spec.rb @@ -57,13 +57,13 @@ RSpec.describe TasklistHelper do describe "subsection link" do let(:subsection) { case_log.form.get_subsection("household_characteristics") } - context "for a subsection that's enabled" do + context "with a subsection that's enabled" do it "returns the subsection link url" do expect(subsection_link(subsection, case_log)).to match(/household-characteristics/) end end - context "for a subsection that cannot be started yet" do + context "with a subsection that cannot be started yet" do before do allow(subsection).to receive(:status).with(case_log).and_return(:cannot_start_yet) end diff --git a/spec/lib/tasks/form_definition_validator_spec.rb b/spec/lib/tasks/form_definition_validator_spec.rb index e08b69f58..a6b4650e6 100644 --- a/spec/lib/tasks/form_definition_validator_spec.rb +++ b/spec/lib/tasks/form_definition_validator_spec.rb @@ -1,33 +1,35 @@ require "rails_helper" require "rake" -describe "rake form_definition:validate_all", type: :task do - subject(:task) { Rake::Task["form_definition:validate_all"] } +RSpec.describe "form_definition" do + describe ":validate_all", type: :task do + subject(:task) { Rake::Task["form_definition:validate_all"] } - before do - Rake.application.rake_require("tasks/form_definition") - Rake::Task.define_task(:environment) - task.reenable - end + before do + Rake.application.rake_require("tasks/form_definition") + Rake::Task.define_task(:environment) + task.reenable + end - it "runs the validate task for each form definition in the project" do - expect(Rake::Task["form_definition:validate"]).to receive(:invoke).exactly(4).times - task.invoke + it "runs the validate task for each form definition in the project" do + expect(Rake::Task["form_definition:validate"]).to receive(:invoke).exactly(4).times + task.invoke + end end -end -describe "rake form_definition:validate", type: :task do - subject(:task) { Rake::Task["form_definition:validate"] } + describe ":validate", type: :task do + subject(:task) { Rake::Task["form_definition:validate"] } - before do - Rake.application.rake_require("tasks/form_definition") - Rake::Task.define_task(:environment) - allow(JSON::Validator).to receive(:validate).and_return(true) - task.reenable - end + before do + Rake.application.rake_require("tasks/form_definition") + Rake::Task.define_task(:environment) + allow(JSON::Validator).to receive(:validate).and_return(true) + task.reenable + end - it "runs the validate task for the given form definition" do - expect(JSON::Validator).to receive(:validate!).at_least(1).time - task.invoke("config/forms/2021_2022.json") + it "runs the validate task for the given form definition" do + expect(JSON::Validator).to receive(:validate!).at_least(1).time + task.invoke("config/forms/2021_2022.json") + end end end