Add email notifications for events registrations, add switch-checkboxes, create EventsRegistrations controller, separate page for events that require registration

This commit is contained in:
Stella Rouzi 2016-06-06 12:31:57 +03:00
parent 139a8565e2
commit 77af75f319
38 changed files with 1313 additions and 403 deletions

View 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