Skip to content

Commit

Permalink
Reorder interview field specs
Browse files Browse the repository at this point in the history
  • Loading branch information
zachlatta committed Jan 28, 2018
1 parent 7e8d01c commit 91ce005
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions api/spec/models/new_club_application_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,29 @@
it { should have_db_column :interview_duration }
it { should have_db_column :interview_notes }

## enums ##

it { should define_enum_for :high_school_type }

## validations ##

it_behaves_like 'Geocodeable'

## relationships ##

it { should have_many(:leader_profiles) }
it { should have_many(:users).through(:leader_profiles) }
it { should belong_to(:point_of_contact) }

it 'requires points of contact to be associated users' do
bad_poc = create(:user)

subject.update_attributes(point_of_contact: bad_poc)

expect(subject.errors[:point_of_contact])
.to include('must be an associated applicant')
end

describe 'interview fields' do
subject { create(:completed_new_club_application) }
before { subject.submit! }
Expand Down Expand Up @@ -105,29 +128,6 @@
end
end

## enums ##

it { should define_enum_for :high_school_type }

## validations ##

it_behaves_like 'Geocodeable'

## relationships ##

it { should have_many(:leader_profiles) }
it { should have_many(:users).through(:leader_profiles) }
it { should belong_to(:point_of_contact) }

it 'requires points of contact to be associated users' do
bad_poc = create(:user)

subject.update_attributes(point_of_contact: bad_poc)

expect(subject.errors[:point_of_contact])
.to include('must be an associated applicant')
end

describe ':submit!' do
subject { create(:completed_new_club_application, profile_count: 3) }
let(:user) { subject.point_of_contact }
Expand Down

0 comments on commit 91ce005

Please sign in to comment.