Skip to content

Commit

Permalink
Fixed rubocop factory class name (#3314)
Browse files Browse the repository at this point in the history
  • Loading branch information
spencerldixon authored Dec 11, 2024
1 parent 13c4a3c commit 0819a3c
Show file tree
Hide file tree
Showing 35 changed files with 36 additions and 41 deletions.
5 changes: 0 additions & 5 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ Capybara/VisibilityMatcher:
Exclude:
- "features/step_definitions/candidates/schools/filtering_steps.rb"

# Offense count: 36
# This cop supports safe autocorrection (--autocorrect).
FactoryBot/FactoryClassName:
Enabled: false

# Offense count: 3
# Configuration parameters: EnforcedStyle, AllowedGems, Include.
# SupportedStyles: Gemfile, gems.rb, gemspec
Expand Down
6 changes: 3 additions & 3 deletions spec/factories/api_factory.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FactoryBot.define do
factory :api_schools_experience_sign_up, class: GetIntoTeachingApiClient::SchoolsExperienceSignUp do
factory :api_schools_experience_sign_up, class: 'GetIntoTeachingApiClient::SchoolsExperienceSignUp' do
candidate_id { SecureRandom.uuid }
master_id { nil }
merged { false }
Expand Down Expand Up @@ -28,12 +28,12 @@
end
end

factory :api_privacy_policy, class: GetIntoTeachingApiClient::PrivacyPolicy do
factory :api_privacy_policy, class: 'GetIntoTeachingApiClient::PrivacyPolicy' do
id { SecureRandom.uuid }
text { "policy text" }
end

factory :api_teaching_subject, class: GetIntoTeachingApiClient::TeachingSubject do
factory :api_teaching_subject, class: 'GetIntoTeachingApiClient::TeachingSubject' do
id { SecureRandom.uuid }
sequence(:value) { |i| "Gitis Subject #{i}" }
end
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/bookings/placement_request_factory.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FactoryBot.define do
factory :placement_request, class: Bookings::PlacementRequest do
factory :placement_request, class: 'Bookings::PlacementRequest' do
association \
:school,
:with_profile,
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/bookings/school_factory.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FactoryBot.define do
factory :bookings_school, class: Bookings::School do
factory :bookings_school, class: 'Bookings::School' do
sequence(:name) { |n| "school #{n}" }
coordinates { Bookings::School::GEOFACTORY.point(-2.241, 53.481) }
fee { 0 }
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/candidates/feedback.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FactoryBot.define do
factory :candidates_feedback, class: Candidates::Feedback do
factory :candidates_feedback, class: 'Candidates::Feedback' do
reason_for_using_service { 'something_else' }
reason_for_using_service_explanation { 'testing the software' }
rating { 'very_satisfied' }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FactoryBot.define do
factory :availability_preference, class: Candidates::Registrations::AvailabilityPreference do
factory :availability_preference, class: 'Candidates::Registrations::AvailabilityPreference' do
urn { 11_048 }
availability { 'Every second Friday' }
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FactoryBot.define do
factory :background_check, class: Candidates::Registrations::BackgroundCheck do
factory :background_check, class: 'Candidates::Registrations::BackgroundCheck' do
urn { 11_048 }
has_dbs_check { true }
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FactoryBot.define do
factory :contact_information, class: Candidates::Registrations::ContactInformation do
factory :contact_information, class: 'Candidates::Registrations::ContactInformation' do
urn { 11_048 }
building { 'New house' }
street { 'Test street' }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FactoryBot.define do
factory :education, class: Candidates::Registrations::Education do
factory :education, class: 'Candidates::Registrations::Education' do
urn { 11_048 }
degree_stage { "Other" }
degree_stage_explaination { "Khan academy, level 3" }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FactoryBot.define do
factory :gitis_registration_session, parent: :registration_session,
class: Candidates::Registrations::GitisRegistrationSession do
class: 'Candidates::Registrations::GitisRegistrationSession' do
gitis_contact { build(:api_schools_experience_sign_up_with_name) }

initialize_with do
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# TODO: SE-1877 remove this file
FactoryBot.define do
factory :legacy_registration_session, class: Candidates::Registrations::RegistrationSession do
factory :legacy_registration_session, class: 'Candidates::Registrations::RegistrationSession' do
transient do
urn { 11_048 }
bookings_placement_date_id { 16 }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FactoryBot.define do
factory :personal_information, class: Candidates::Registrations::PersonalInformation do
factory :personal_information, class: 'Candidates::Registrations::PersonalInformation' do
urn { 11_048 }
first_name { 'Testy' }
last_name { 'Mc Test' }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FactoryBot.define do
factory :placement_preference, class: Candidates::Registrations::PlacementPreference do
factory :placement_preference, class: 'Candidates::Registrations::PlacementPreference' do
urn { 11_048 }
objectives { 'Become a teacher' }
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FactoryBot.define do
factory :registration_session, class: Candidates::Registrations::RegistrationSession do
factory :registration_session, class: 'Candidates::Registrations::RegistrationSession' do
transient do
current_time { DateTime.current }
urn { 11_048 }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FactoryBot.define do
factory :subject_and_date_information, class: Candidates::Registrations::SubjectAndDateInformation do
factory :subject_and_date_information, class: 'Candidates::Registrations::SubjectAndDateInformation' do
bookings_placement_date_id { create(:bookings_placement_date).id }
bookings_subject_id { nil }
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FactoryBot.define do
factory :teaching_preference, class: Candidates::Registrations::TeachingPreference do
factory :teaching_preference, class: 'Candidates::Registrations::TeachingPreference' do
transient do
school { FactoryBot.create :bookings_school }
end
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/schools/feedback.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FactoryBot.define do
factory :schools_feedback, class: Schools::Feedback do
factory :schools_feedback, class: 'Schools::Feedback' do
reason_for_using_service { 'something_else' }
reason_for_using_service_explanation { 'testing the software' }
rating { 'very_satisfied' }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FactoryBot.define do
factory :access_needs_detail, class: Schools::OnBoarding::AccessNeedsDetail do
factory :access_needs_detail, class: 'Schools::OnBoarding::AccessNeedsDetail' do
description { 'Here are some details' }
end
end
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FactoryBot.define do
factory :access_needs_policy, class: Schools::OnBoarding::AccessNeedsPolicy do
factory :access_needs_policy, class: 'Schools::OnBoarding::AccessNeedsPolicy' do
has_access_needs_policy { true }
url { 'https://example.com/access-needs-policy' }
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FactoryBot.define do
factory :access_needs_support, class: Schools::OnBoarding::AccessNeedsSupport do
factory :access_needs_support, class: 'Schools::OnBoarding::AccessNeedsSupport' do
supports_access_needs { true }
end
end
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FactoryBot.define do
factory :admin_contact, class: Schools::OnBoarding::AdminContact do
factory :admin_contact, class: 'Schools::OnBoarding::AdminContact' do
email { '[email protected]' }
email_secondary { '[email protected]' }
phone { '+441234567890' }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FactoryBot.define do
factory :administration_fee, class: Schools::OnBoarding::AdministrationFee do
factory :administration_fee, class: 'Schools::OnBoarding::AdministrationFee' do
amount_pounds { 100.99 }
description { 'Generic administration fee' }
interval { 'Daily' }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FactoryBot.define do
factory :candidate_requirement, class: Schools::OnBoarding::CandidateRequirement do
factory :candidate_requirement, class: 'Schools::OnBoarding::CandidateRequirement' do
requirements { true }
requirements_details { 'Gotta go fast' }
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FactoryBot.define do
factory :candidate_requirements_selection, class: Schools::OnBoarding::CandidateRequirementsSelection do
factory :candidate_requirements_selection, class: 'Schools::OnBoarding::CandidateRequirementsSelection' do
selected_requirements { %w[on_teacher_training_course has_or_working_towards_degree live_locally provide_photo_identification other] }
maximum_distance_from_school { 8 }
photo_identification_details { 'Make sure photo is clear' }
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/schools/on_boarding/confirmation_factory.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FactoryBot.define do
factory :confirmation, class: Schools::OnBoarding::Confirmation do
factory :confirmation, class: 'Schools::OnBoarding::Confirmation' do
acceptance { true }
end
end
2 changes: 1 addition & 1 deletion spec/factories/schools/on_boarding/dbs_fee_factory.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FactoryBot.define do
factory :dbs_fee, class: Schools::OnBoarding::DBSFee do
factory :dbs_fee, class: 'Schools::OnBoarding::DBSFee' do
amount_pounds { 200 }
description { 'DBS check' }
interval { 'One-off' }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FactoryBot.define do
factory :dbs_requirement, class: Schools::OnBoarding::DbsRequirement do
factory :dbs_requirement, class: 'Schools::OnBoarding::DbsRequirement' do
dbs_policy_conditions { 'required' }
dbs_policy_details { 'Must have recent dbs check' }
no_dbs_policy_details { nil }
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/schools/on_boarding/description_factory.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FactoryBot.define do
factory :description, class: Schools::OnBoarding::Description do
factory :description, class: 'Schools::OnBoarding::Description' do
details { 'Horse archery' }
end
end
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FactoryBot.define do
factory :disability_confident, class: Schools::OnBoarding::DisabilityConfident do
factory :disability_confident, class: 'Schools::OnBoarding::DisabilityConfident' do
is_disability_confident { true }
end
end
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FactoryBot.define do
factory :experience_outline, class: Schools::OnBoarding::ExperienceOutline do
factory :experience_outline, class: 'Schools::OnBoarding::ExperienceOutline' do
candidate_experience { 'Mostly teaching' }
end
end
2 changes: 1 addition & 1 deletion spec/factories/schools/on_boarding/fees_factory.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FactoryBot.define do
factory :fees, class: Schools::OnBoarding::Fees do
factory :fees, class: 'Schools::OnBoarding::Fees' do
selected_fees { %w[administration_fees dbs_fees other_fees] }
dbs_fees_specified { true }
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FactoryBot.define do
factory :key_stage_list, class: Schools::OnBoarding::KeyStageList do
factory :key_stage_list, class: 'Schools::OnBoarding::KeyStageList' do
early_years { true }
key_stage_1 { true }
key_stage_2 { true }
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/schools/on_boarding/other_fee_factory.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FactoryBot.define do
factory :other_fee, class: Schools::OnBoarding::OtherFee do
factory :other_fee, class: 'Schools::OnBoarding::OtherFee' do
amount_pounds { 300 }
description { 'Falconry lessons' }
interval { 'One-off' }
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/schools/on_boarding/phases_list_factory.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FactoryBot.define do
factory :phases_list, class: Schools::OnBoarding::PhasesList do
factory :phases_list, class: 'Schools::OnBoarding::PhasesList' do
primary { true }
secondary { true }
college { true }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FactoryBot.define do
factory :teacher_training, class: Schools::OnBoarding::TeacherTraining do
factory :teacher_training, class: 'Schools::OnBoarding::TeacherTraining' do
provides_teacher_training { true }
teacher_training_details { 'We offer teach training in house' }
teacher_training_url { 'https://example.com' }
Expand Down

0 comments on commit 0819a3c

Please sign in to comment.