From e8453a6a09b2d0b5c6b42386ece0d1ae6ff23a3a Mon Sep 17 00:00:00 2001 From: Jerome Pratt Date: Tue, 3 Sep 2024 14:22:43 +0100 Subject: [PATCH] [RUBY-3212] Refactor project name uniqueness validation in spec - Moved the creation of `existing_project` to a `before` block for better readability and consistency. --- spec/steps/pafs_core/project_name_step_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/steps/pafs_core/project_name_step_spec.rb b/spec/steps/pafs_core/project_name_step_spec.rb index b2aa24fe..5bcca59d 100644 --- a/spec/steps/pafs_core/project_name_step_spec.rb +++ b/spec/steps/pafs_core/project_name_step_spec.rb @@ -46,8 +46,8 @@ end context "when name already exists" do - let!(:existing_project) { create(:project_name_step, name: "Unique Project Name") } let(:duplicate_name_params) { ActionController::Parameters.new({ project_name_step: { name: "Unique Project Name" } }) } + before { create(:project_name_step, name: "Unique Project Name") } it "returns false and sets the uniqueness error message" do project_name_step.name = "Different Name"