Add missing require 'rails_helper' to spec files - #2859
Merged
Conversation
135 of 160 spec files did not require rails_helper. They only worked because .rspec requires spec_helper, and spec_helper requires config/environment. Running such a file alone depended on that implicit load chain. Prepend require 'rails_helper' to each affected file so single-file runs are self-contained. Suggested by @olleolleolle in a review comment on #2846. Fixes #2858.
…r-in-specs * origin/master: chore(deps): bump the ruby-deps group across 1 directory with 4 updates Pin json gem to ~> 2.3 Fix flaky add-all-chapters feature spec chore: enable RSpecRails/InferredSpecType and drop redundant spec types # Conflicts: # spec/controllers/admin/chapters_controller_spec.rb # spec/controllers/admin/events_controller_spec.rb # spec/controllers/admin/invitations_controller_spec.rb # spec/controllers/admin/member_notes_controller_spec.rb # spec/controllers/admin/member_search_controller_spec.rb # spec/controllers/admin/sponsors_controller_spec.rb # spec/controllers/admin/workshops_controller_spec.rb # spec/controllers/workshop_invitation_controller_spec.rb # spec/features/accepting_invitation_spec.rb # spec/features/accepting_terms_and_conditions_spec.rb # spec/features/admin/accessing_portal_spec.rb # spec/features/admin/add_user_to_workshop_spec.rb # spec/features/admin/announcements_spec.rb # spec/features/admin/chapter/feedback_spec.rb # spec/features/admin/chapters_spec.rb # spec/features/admin/event_spec.rb # spec/features/admin/feedback_spec.rb # spec/features/admin/filtering_sponsors_list_spec.rb # spec/features/admin/groups_spec.rb # spec/features/admin/manage_event_spec.rb # spec/features/admin/manage_sponsor_spec.rb # spec/features/admin/manage_workshop_attendances_spec.rb # spec/features/admin/managing_meeting_invitations_spec.rb # spec/features/admin/managing_organisers_spec.rb # spec/features/admin/managing_testimonials_spec.rb # spec/features/admin/meeting_spec.rb # spec/features/admin/member_search_spec.rb # spec/features/admin/members_spec.rb # spec/features/admin/sponsor_spec.rb # spec/features/admin/workshops_spec.rb # spec/features/chapter_spec.rb # spec/features/coach_accepting_invitation_spec.rb # spec/features/internationalization_spec.rb # spec/features/listing_coaches_spec.rb # spec/features/listing_events_spec.rb # spec/features/manage_contact_preferences_spec.rb # spec/features/managing_workshop_attendance_spec.rb # spec/features/member/login_spec.rb # spec/features/member_feedback_spec.rb # spec/features/member_joining_spec.rb # spec/features/member_portal_spec.rb # spec/features/member_updating_details_spec.rb # spec/features/sponsors_spec.rb # spec/features/subscribing_to_emails_spec.rb # spec/features/subscribing_to_newsletter_spec.rb # spec/features/view_event_spec.rb # spec/features/viewing_a_meeting_spec.rb # spec/features/viewing_a_workshop_invitation_spec.rb # spec/features/viewing_a_workshop_spec.rb # spec/features/viewing_pages_spec.rb # spec/features/visiting_homepage_spec.rb # spec/helpers/email_header_helper_spec.rb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
require 'rails_helper'to the 135 spec files that were missing it. Single-file runs previously depended on an implicit load chain:.rspecrequiresspec_helper, andspec/spec_helper.rbrequiresconfig/environment. That line could disappear during a refactor and break every spec run individually.spec/models/,spec/services/, andspec/presenters/require 'rails_helper'plus a blank line, nothing elseSuggested by @olleolleolle in a review comment on #2846. Fixes #2858.
Review notes