Skip to content

Commit

Permalink
Don't specify team: on locations in specs
Browse files Browse the repository at this point in the history
Locations no longer belong to a team.
  • Loading branch information
tvararu committed Jul 15, 2024
1 parent 99f0d1b commit 327e46b
Show file tree
Hide file tree
Showing 17 changed files with 18 additions and 21 deletions.
2 changes: 1 addition & 1 deletion spec/components/app_activity_log_component_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
let(:component) { described_class.new(patient_session) }
let(:user) { create(:user, teams: [team], full_name: "Nurse Joy") }
let(:campaign) { create(:campaign, team:) }
let(:location) { create(:location, team:, name: "Hogwarts") }
let(:location) { create(:location, name: "Hogwarts") }
let(:session) { create(:session, campaign:, location:) }
let(:patient) { create(:patient, location:) }

Expand Down
4 changes: 1 addition & 3 deletions spec/factories/example_campaigns.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
transient do
user { create(:user) }
# this name and URN matches the data in spec/fixtures/cohort_list/valid_cohort.csv
location do
create(:location, team:, name: "Surrey Primary", urn: "123456")
end
location { create(:location, name: "Surrey Primary", urn: "123456") }
end

team { user.team || create(:team, users: [user]) }
Expand Down
2 changes: 1 addition & 1 deletion spec/features/parental_consent_authentication_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
def given_an_hpv_campaign_is_underway
@team = create(:team, :with_one_nurse)
campaign = create(:campaign, :hpv, team: @team)
location = create(:location, name: "Pilot School", team: @team)
location = create(:location, name: "Pilot School")
@session =
create(:session, :in_future, campaign:, location:, patients_in_session: 1)
@child = @session.patients.first
Expand Down
2 changes: 1 addition & 1 deletion spec/features/parental_consent_change_answers_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
def given_a_flu_campaign_is_underway
@team = create(:team, :with_one_nurse)
campaign = create(:campaign, :flu, team: @team)
location = create(:location, name: "Pilot School", team: @team)
location = create(:location, name: "Pilot School")
@session =
create(:session, :in_future, campaign:, location:, patients_in_session: 1)
@child = @session.patients.first
Expand Down
2 changes: 1 addition & 1 deletion spec/features/parental_consent_flu_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
def given_a_flu_campaign_is_underway
@team = create(:team, :with_one_nurse)
campaign = create(:campaign, :flu, team: @team)
location = create(:location, name: "Pilot School", team: @team)
location = create(:location, name: "Pilot School")
@session =
create(:session, :in_future, campaign:, location:, patients_in_session: 1)
@child = @session.patients.first
Expand Down
2 changes: 1 addition & 1 deletion spec/features/parental_consent_refused_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
def given_an_hpv_campaign_is_underway
@team = create(:team, :with_one_nurse)
campaign = create(:campaign, :hpv, team: @team)
location = create(:location, name: "Pilot School", team: @team)
location = create(:location, name: "Pilot School")
@session =
create(:session, :in_future, campaign:, location:, patients_in_session: 1)
@child = @session.patients.first
Expand Down
2 changes: 1 addition & 1 deletion spec/features/parental_consent_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
def given_an_hpv_campaign_is_underway
@team = create(:team, :with_one_nurse)
campaign = create(:campaign, :hpv, team: @team)
location = create(:location, name: "Pilot School", team: @team)
location = create(:location, name: "Pilot School")
@session =
create(:session, :in_future, campaign:, location:, patients_in_session: 1)
@child = @session.patients.first
Expand Down
2 changes: 1 addition & 1 deletion spec/features/pilot_journey_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
def given_an_hpv_campaign_is_underway
@team = create(:team, :with_one_nurse)
@campaign = create(:campaign, :hpv, team: @team)
@school = create(:location, name: "Pilot School", team: @team)
@school = create(:location, name: "Pilot School")
end

def and_i_am_a_nurse_signed_into_the_service
Expand Down
2 changes: 1 addition & 1 deletion spec/features/pilot_upload_cohort_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

def given_the_app_is_setup
@team = create(:team, :with_one_nurse)
create(:location, team: @team, urn: "123456")
create(:location, urn: "123456")
@user = @team.users.first
end

Expand Down
2 changes: 1 addition & 1 deletion spec/features/response_matching_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def given_the_app_is_setup
@team = create(:team, :with_one_nurse)
@user = @team.users.first
@campaign = create(:campaign, :hpv, team: @team)
@school = create(:location, name: "Pilot School", team: @team)
@school = create(:location, name: "Pilot School")
@session =
create(
:session,
Expand Down
2 changes: 1 addition & 1 deletion spec/features/self_consent_gillick_competent_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
def given_an_hpv_campaign_is_underway
@team = create(:team, :with_one_nurse)
campaign = create(:campaign, :hpv, team: @team)
location = create(:location, name: "Pilot School", team: @team)
location = create(:location, name: "Pilot School")
@session =
create(:session, :in_future, campaign:, location:, patients_in_session: 1)
@child = @session.patients.first
Expand Down
2 changes: 1 addition & 1 deletion spec/features/self_consent_not_gillick_competent_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
def given_an_hpv_campaign_is_underway
@team = create(:team, :with_one_nurse)
campaign = create(:campaign, :hpv, team: @team)
location = create(:location, name: "Pilot School", team: @team)
location = create(:location, name: "Pilot School")
@session =
create(:session, :in_future, campaign:, location:, patients_in_session: 1)
@child = @session.patients.first
Expand Down
4 changes: 2 additions & 2 deletions spec/features/user_authorisation_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ def given_an_hpv_campaign_is_underway_with_two_teams
@other_team = create(:team, :with_one_nurse)
campaign = create(:campaign, :hpv, team: @team)
other_campaign = create(:campaign, :hpv, team: @other_team)
location = create(:location, name: "Pilot School", team: @team)
other_location = create(:location, name: "Other School", team: @other_team)
location = create(:location, name: "Pilot School")
other_location = create(:location, name: "Other School")
@session =
create(:session, :in_future, campaign:, location:, patients_in_session: 1)
@other_session =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
def given_an_hpv_campaign_is_underway
@team = create(:team, :with_one_nurse)
campaign = create(:campaign, :hpv, team: @team)
location = create(:location, name: "Pilot School", team: @team)
location = create(:location, name: "Pilot School")
@session =
create(:session, :in_future, campaign:, location:, patients_in_session: 0)
end
Expand Down
2 changes: 1 addition & 1 deletion spec/mailers/application_mailer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
reply_to_id: "notify-reply-to-id"
)
end
let(:location) { create(:location, name: "Hogwarts", team:) }
let(:location) { create(:location, name: "Hogwarts") }
let(:campaign) { create(:campaign, :hpv, team:) }
let(:session) do
create(:session, campaign:, location:, date: Date.new(2100, 1, 1))
Expand Down
3 changes: 1 addition & 2 deletions spec/models/session_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@
subject { FactoryBot.build :session, form_step:, campaign: }

let(:form_step) { :location }
let(:location) { create :location }
let(:team) { create :team, locations: [location] }
let(:team) { create :team }
let(:campaign) { create :campaign, team: }

it { should validate_presence_of(:location_id).on(:update) }
Expand Down
2 changes: 1 addition & 1 deletion spec/policies/session_policy_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

let(:team) { create :team }
let(:user) { create :user, teams: [team] }
let(:location) { create :location, team: }
let(:location) { create :location }
let(:campaign) { create :campaign, team: }
let(:draft_session) { create :session, draft: true, location:, campaign: }
let(:session) { create :session, location:, campaign: }
Expand Down

0 comments on commit 327e46b

Please sign in to comment.