Add email notifications for events registrations, add switch-checkboxes, create EventsRegistrations controller, separate page for events that require registration
This commit is contained in:
parent
139a8565e2
commit
77af75f319
38 changed files with 1313 additions and 403 deletions
21
spec/models/events_registration_spec.rb
Normal file
21
spec/models/events_registration_spec.rb
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe Sponsor do
|
||||
subject { create(:events_registration) }
|
||||
|
||||
describe 'association' do
|
||||
it { is_expected.to belong_to :event }
|
||||
it { is_expected.to belong_to :registration }
|
||||
it { is_expected.to have_one :user }
|
||||
end
|
||||
|
||||
describe 'validations' do
|
||||
it 'has a valid factory' do
|
||||
expect(build(:events_registration)).to be_valid
|
||||
end
|
||||
|
||||
it { is_expected.to validate_presence_of(:event) }
|
||||
it { is_expected.to validate_presence_of(:registration) }
|
||||
it { is_expected.to validate_uniqueness_of(:event).scoped_to(:registration_id) }
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue