Merge pull request #6 from snap-cloud/remove-travel-schedule

Remove travel schedule from registration
This commit is contained in:
Michael Ball 2020-01-07 01:10:27 -08:00 committed by GitHub
commit 4ba182b1fb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
30 changed files with 91 additions and 190 deletions

View file

@ -1 +1 @@
2.5.0 2.5.5

View file

@ -4,6 +4,12 @@ Not release yet...
## Update from 1.0 ## Update from 1.0
### Dropped travel information
We have dropped input and storage of travel schedules for event registrants. If
you would like to continue to collect travel schedules, please create a custom
survey for this purpose.
_Please be aware that existing travel data will be destroyed during migration._
### Multiple Schedules ### Multiple Schedules
A conference can have multiple schedules now so it's easier for organizers to A conference can have multiple schedules now so it's easier for organizers to
test schedules and collaborate on different versions. test schedules and collaborate on different versions.

View file

@ -2,7 +2,7 @@
source 'https://rubygems.org' source 'https://rubygems.org'
ruby ENV['OSEM_RUBY_VERSION'] || '2.5.0' ruby ENV['OSEM_RUBY_VERSION'] || '2.5.5'
# rails-assets requires >= 1.8.4 # rails-assets requires >= 1.8.4
if Gem::Version.new(Bundler::VERSION) < Gem::Version.new('1.8.4') if Gem::Version.new(Bundler::VERSION) < Gem::Version.new('1.8.4')

View file

@ -373,9 +373,6 @@ GEM
public_suffix (3.1.1) public_suffix (3.1.1)
puma (3.12.2) puma (3.12.2)
rack (2.0.8) rack (2.0.8)
rack-openid (1.3.1)
rack (>= 1.1.0)
ruby-openid (>= 2.1.8)
rack-test (1.1.0) rack-test (1.1.0)
rack (>= 1.0, < 3) rack (>= 1.0, < 3)
rails (5.2.3) rails (5.2.3)
@ -715,7 +712,7 @@ DEPENDENCIES
whenever whenever
RUBY VERSION RUBY VERSION
ruby 2.5.0p0 ruby 2.5.5p157
BUNDLED WITH BUNDLED WITH
1.17.3 1.17.3

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

View file

@ -13,40 +13,6 @@ $(function () {
format: 'YYYY-MM-DD HH:mm' format: 'YYYY-MM-DD HH:mm'
}); });
$("#registration-arrival-datepicker").datetimepicker({
useCurrent: false,
stepping: 15,
sideBySide: true,
format: "YYYY-MM-DD HH:mm",
// current_date <= arrival_date <= end_date
maxDate : $("#registration-arrival-datepicker").attr('end_date'),
minDate : today
});
$("#registration-departure-datepicker").datetimepicker({
useCurrent: false,
stepping: 15,
sideBySide: true,
format: "YYYY-MM-DD HH:mm",
// departure_date > start_date
minDate : $("#registration-arrival-datepicker").attr('start_date')
});
$("#registration-arrival-datepicker").on("dp.change",function (e) {
// departure_date > start_date,arrival_date
if ((new Date(e.date).getTime()) > (new Date($("#registration-arrival-datepicker").attr('start_date')).getTime())){
$('#registration-departure-datepicker').data("DateTimePicker").minDate(e.date);
}
else{
$('#registration-departure-datepicker').data("DateTimePicker").minDate($("#registration-arrival-datepicker").attr('start_date'));
}
});
// departure_date >= arrival_date
$("#registration-departure-datepicker").on("dp.change",function (e) {
$('#registration-arrival-datepicker').data("DateTimePicker").maxDate(e.date);
});
$("#conference-start-datepicker").datetimepicker({ $("#conference-start-datepicker").datetimepicker({
useCurrent: false, useCurrent: false,
format: "YYYY-MM-DD", format: "YYYY-MM-DD",

View file

@ -34,4 +34,9 @@
.navbar-default .navbar-nav>.open>a, .navbar-default .navbar-nav>.open>a:hover, .navbar-default .navbar-nav>.open>a:focus { .navbar-default .navbar-nav>.open>a, .navbar-default .navbar-nav>.open>a:hover, .navbar-default .navbar-nav>.open>a:focus {
color: #FFF; color: #FFF;
} }
.navbar-brand img {
margin-top: -5px;
max-height: 100%;
}
} }

View file

@ -92,7 +92,9 @@ module Admin
@booth.reject! @booth.reject!
if @booth.save if @booth.save
if @conference.email_settings.send_on_booths_rejection
Mailbot.conference_booths_rejection_mail(@booth).deliver_later Mailbot.conference_booths_rejection_mail(@booth).deliver_later
end
redirect_to admin_conference_booths_path(conference_id: @conference.short_title), redirect_to admin_conference_booths_path(conference_id: @conference.short_title),
notice: "#{(t'booth').capitalize} successfully rejected." notice: "#{(t'booth').capitalize} successfully rejected."
else else

View file

@ -82,7 +82,7 @@ module Admin
def registration_params def registration_params
params.require(:registration).permit( params.require(:registration).permit(
:user_id, :conference_id, :arrival, :departure, :attended, :user_id, :conference_id, :attended,
:volunteer, :other_special_needs, :accepted_code_of_conduct, :volunteer, :other_special_needs, :accepted_code_of_conduct,
vchoice_ids: [], qanswer_ids: [], qanswers_attributes: [], event_ids: [] vchoice_ids: [], qanswer_ids: [], qanswers_attributes: [], event_ids: []
) )

View file

@ -108,9 +108,9 @@ class ConferenceRegistrationsController < ApplicationController
end end
def registration_params def registration_params
params.require(:registration) params.permit(:registration)
.permit( .permit(
:conference_id, :arrival, :departure, :conference_id,
:volunteer, :accepted_code_of_conduct, :volunteer, :accepted_code_of_conduct,
vchoice_ids: [], qanswer_ids: [], vchoice_ids: [], qanswer_ids: [],
qanswers_attributes: [], qanswers_attributes: [],

View file

@ -35,8 +35,7 @@ module Users
openid.save! openid.save!
sign_in user sign_in user
redirect_to request.env['omniauth.origin'] || root_path, redirect_to root_path, notice: "#{user.email} signed in successfully with #{provider}"
notice: "#{user.email} signed in successfully with #{provider}"
rescue => e rescue => e
flash[:error] = e.message flash[:error] = e.message
redirect_back_or_to new_user_registration_path redirect_back_or_to new_user_registration_path

View file

@ -10,8 +10,6 @@ class RegistrationDatatable < AjaxDatatablesRails::Base
roles: { source: 'Role.name' }, roles: { source: 'Role.name' },
email: { source: 'User.email' }, email: { source: 'User.email' },
accepted_code_of_conduct: { source: 'Registration.accepted_code_of_conduct', searchable: false }, accepted_code_of_conduct: { source: 'Registration.accepted_code_of_conduct', searchable: false },
arrival: { source: 'Registration.arrival', searchable: false },
departure: { source: 'Registration.departure', searchable: false },
actions: { source: 'Registration.id', searchable: false, orderable: false } actions: { source: 'Registration.id', searchable: false, orderable: false }
} }
end end
@ -36,8 +34,6 @@ class RegistrationDatatable < AjaxDatatablesRails::Base
roles: conference_role_titles(record.user), roles: conference_role_titles(record.user),
email: record.email, email: record.email,
accepted_code_of_conduct: !!record.accepted_code_of_conduct, # rubocop:disable Style/DoubleNegation accepted_code_of_conduct: !!record.accepted_code_of_conduct, # rubocop:disable Style/DoubleNegation
arrival: record.arrival&.utc,
departure: record.departure&.utc,
questions: {}, questions: {},
edit_url: edit_admin_conference_registration_path(conference, record), edit_url: edit_admin_conference_registration_path(conference, record),
DT_RowId: record.id DT_RowId: record.id

View file

@ -185,7 +185,7 @@ module ApplicationHelper
'OSEM' 'OSEM'
) )
link_to( link_to(
link_text, image_tag('snapcon_logo.png'),
root_path, root_path,
class: 'navbar-brand', class: 'navbar-brand',
title: 'Open Source Event Manager' title: 'Open Source Event Manager'

View file

@ -1,4 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
require 'redcarpet/render_strip'
module FormatHelper module FormatHelper
## ##
@ -206,6 +207,11 @@ module FormatHelper
markdown("#{text} Please look at #{link_to '**Markdown Syntax**', 'https://daringfireball.net/projects/markdown/syntax', target: '_blank'} to format your text", false) markdown("#{text} Please look at #{link_to '**Markdown Syntax**', 'https://daringfireball.net/projects/markdown/syntax', target: '_blank'} to format your text", false)
end end
# Return a plain text markdown stripped of formatting.
def plain_text(content)
Redcarpet::Markdown.new(Redcarpet::Render::StripDown).render(content)
end
def quantity_left_of(resource) def quantity_left_of(resource)
return '-/-' if resource.quantity.blank? return '-/-' if resource.quantity.blank?

View file

@ -28,8 +28,6 @@ class Registration < ApplicationRecord
validates :user_id, uniqueness: { scope: :conference_id, message: 'already Registered!' } validates :user_id, uniqueness: { scope: :conference_id, message: 'already Registered!' }
validate :registration_limit_not_exceed, on: :create validate :registration_limit_not_exceed, on: :create
validate :registration_to_events_only_if_present
validates :accepted_code_of_conduct, acceptance: { validates :accepted_code_of_conduct, acceptance: {
if: -> { conference.try(:code_of_conduct).present? } if: -> { conference.try(:code_of_conduct).present? }
} }
@ -48,19 +46,6 @@ class Registration < ApplicationRecord
private private
##
# If the user registers to attend events that are already scheduled,
# only allow registration to events if the user will be present
# (based on arrival and departure attributes)
# No validation if arrival/departure attributes are empty
def registration_to_events_only_if_present
if (arrival || departure) && events.pluck(:start_time).any?
errors.add(:arrival, 'is too late! You cannot register for events that take place before your arrival') if events.pluck(:start_time).compact.map { |x| x < arrival }.any?
errors.add(:departure, 'is too early! You cannot register for events that take place after your departure') if events.pluck(:start_time).compact.map { |x| x > departure }.any?
end
end
def subscribe_to_conference def subscribe_to_conference
Subscription.create(conference_id: conference.id, user_id: user.id) Subscription.create(conference_id: conference.id, user_id: user.id)
end end

View file

@ -30,8 +30,6 @@
%th{ width: '0' } E-Mail %th{ width: '0' } E-Mail
%th{ width: '0' } %th{ width: '0' }
%abbr{ title: 'Code of Conduct' } CoC %abbr{ title: 'Code of Conduct' } CoC
%th{ width: '0' } Arrival
%th{ width: '0' } Departure
%th{ width: '0' } Actions %th{ width: '0' } Actions
%tbody %tbody
@ -81,22 +79,6 @@
"className": "code-of-conduct text-center", "className": "code-of-conduct text-center",
"searchable": false "searchable": false
}, },
{
"data": "arrival",
"searchable": false,
"render": function(data, type, row) {
if (data) { return moment(data).format('ll LT'); }
return '';
}
},
{
"data": "departure",
"searchable": false,
"render": function(data, type, row) {
if (data) { return moment(data).format('ll LT'); }
return '';
}
},
{ {
"data": null, "data": null,
"className": "actions", "className": "actions",

View file

@ -4,9 +4,7 @@ prawn_document(force_download: true, filename: @pdf_filename, page_layout: :land
'Name', 'Name',
'Nickname', 'Nickname',
'Affiliation', 'Affiliation',
'Email', 'Email']
'Arrival Date',
'Departure Date']
@conference.questions.each do |question| @conference.questions.each do |question|
header_array << question.title header_array << question.title
end end
@ -19,8 +17,6 @@ prawn_document(force_download: true, filename: @pdf_filename, page_layout: :land
row << registration.nickname row << registration.nickname
row << registration.affiliation row << registration.affiliation
row << registration.email row << registration.email
row << registration.arrival.to_s || ''
row << registration.departure.to_s || ''
@conference.questions.each do |question| @conference.questions.each do |question|
qa = registration.qanswers.find_by(question: question) qa = registration.qanswers.find_by(question: question)

View file

@ -3,7 +3,7 @@
wb = xlsx_package.workbook wb = xlsx_package.workbook
wb.add_worksheet(name: 'registrations') do |sheet| wb.add_worksheet(name: 'registrations') do |sheet|
bold_style = wb.styles.add_style(b: true) bold_style = wb.styles.add_style(b: true)
row = ['Attended', 'Name', 'Nickname', 'Affilιation', 'Email', 'Arrival', 'Departure'] row = ['Attended', 'Name', 'Nickname', 'Affilιation', 'Email']
@conference.questions.each do |question| @conference.questions.each do |question|
row << question.title row << question.title
@ -18,8 +18,6 @@ wb.add_worksheet(name: 'registrations') do |sheet|
row << registration.nickname row << registration.nickname
row << registration.affiliation row << registration.affiliation
row << registration.email row << registration.email
row << registration.arrival.to_s
row << registration.departure.to_s
@conference.questions.each do |question| @conference.questions.each do |question|
qa = registration.qanswers.find_by(question: question) qa = registration.qanswers.find_by(question: question)
answer = ( qa ? qa.answer.title : '' ) answer = ( qa ? qa.answer.title : '' )
@ -30,4 +28,3 @@ wb.add_worksheet(name: 'registrations') do |sheet|
sheet.add_row row sheet.add_row row
end end
end end

View file

@ -22,6 +22,7 @@
= render partial: 'devise/shared/sign_up_form_embedded' = render partial: 'devise/shared/sign_up_form_embedded'
= render partial: 'registration_info', locals: { f: f } = render partial: 'registration_info', locals: { f: f }
= f.input :conference_id, as: :hidden, value: @conference.id
.row .row
.col-md-12 .col-md-12
%p.pull-right %p.pull-right

View file

@ -24,10 +24,4 @@
(Scheduled on: #{event.time.to_date}) (Scheduled on: #{event.time.to_date})
%br %br
= f.inputs 'Your Travel Info' do
= f.input :arrival, as: :string, label: 'Your arrival time', hint: "Leave blank if not sure", input_html: { value: (f.object.arrival.to_formatted_s(:db_without_seconds) unless f.object.arrival.nil?), id: 'registration-arrival-datepicker',start_date: @conference.start_date,end_date: @conference.end_date }
= f.input :departure, as: :string, label: 'Your departure time', hint: "Leave blank if not sure", input_html: { value: (f.object.departure.to_formatted_s(:db_without_seconds) unless f.object.departure.nil?), id: 'registration-departure-datepicker' }
= render 'conferences/code_of_conduct', organization: @conference.organization = render 'conferences/code_of_conduct', organization: @conference.organization

View file

@ -33,28 +33,6 @@
data: { toggle: 'modal', target: '#modal-code-of-conduct'} data: { toggle: 'modal', target: '#modal-code-of-conduct'}
= render 'conferences/code_of_conduct', = render 'conferences/code_of_conduct',
organization: @conference.organization organization: @conference.organization
.row
.col-md-12
%h4
%span.fa-stack
%i.fa.fa-square-o.fa-stack-2x
%i.fa.fa-plane.fa-stack-1x
Travel Schedule
%ul
%li
- if @registration.arrival.present?
arrive at
%strong
= @registration.arrival.strftime('%A, %B %-d. %Y %H:%M')
- else
You haven't scheduled your arrival
%li
- if @registration.departure.present?
depart at
%strong
= @registration.departure.strftime('%A, %B %-d. %Y %H:%M')
- else
You haven't scheduled your departure
- if @conference.surveys.for_registration.any? - if @conference.surveys.for_registration.any?
.row .row
.col-md-12 .col-md-12

View file

@ -16,7 +16,7 @@
We recommend the following accommodations for your visit. We recommend the following accommodations for your visit.
.row.row-centered .row.row-centered
- lodgings.each do |lodging| - lodgings.order(created_at: :asc).each do |lodging|
.col-md-4.col-sm-4.col-centered.col-top .col-md-4.col-sm-4.col-centered.col-top
.thumbnail .thumbnail
- if lodging.picture? - if lodging.picture?
@ -36,6 +36,9 @@
%i.fa.fa-home.fa-5x %i.fa.fa-home.fa-5x
.caption .caption
%h3.text-center %h3.text-center
- if lodging.website_link.present?
= link_to(loding.website_link, lodiging.name)
- else
= lodging.name = lodging.name
- if lodging.description.present? - if lodging.description.present?
= markdown(lodging.description) = markdown(lodging.description)

View file

@ -27,9 +27,9 @@
.row .row
.col-md-12 .col-md-12
%h3.text-center %h3.text-center
Want to sponsor? = "Interested in sponsoring #{conference.title}?"
= link_to(sponsorship_mailto(conference)) do = link_to(sponsorship_mailto(conference)) do
Contact us! Please, contact us!
- sponsors.each do |sponsor| - sponsors.each do |sponsor|
- content_for :modals do - content_for :modals do

View file

@ -1,10 +1,10 @@
- content_for :head do - content_for :head do
%meta{ property: "og:title", content: @conference.title } %meta{ property: "og:title", content: @conference.title }
%meta{ property: "og:site_name", content: (ENV['OSEM_NAME'] || 'OSEM') } %meta{ property: "og:site_name", content: (ENV['OSEM_NAME'] || 'OSEM') }
%meta{ property: "og:description", content: @conference.description } %meta{ property: "og:description", content: plain_text(@conference.description) }
%meta{ property: "og:url", content: conference_url(@conference.short_title) } %meta{ property: "og:url", content: conference_url(@conference.short_title) }
%meta{ property: "twitter:title", content: (@conference.title) } %meta{ property: "twitter:title", content: (@conference.title) }
%meta{ property: "twitter:description", content: @conference.description } %meta{ property: "twitter:description", content: plain_text(@conference.description) }
- if @conference.picture? - if @conference.picture?
%meta{ property: "og:image", content: @image_url } %meta{ property: "og:image", content: @image_url }
%meta{ property: "og:image:secure_url", content: @image_url } %meta{ property: "og:image:secure_url", content: @image_url }

View file

@ -14,7 +14,7 @@
%span.icon-bar %span.icon-bar
%span.icon-bar %span.icon-bar
%span.icon-bar %span.icon-bar
= nav_root_link_for conference = nav_root_link_for(conference)
.collapse.navbar-collapse#main-nav .collapse.navbar-collapse#main-nav
- if content_for :splash_nav - if content_for :splash_nav
@ -42,33 +42,37 @@
= link_to(new_registration_path('user')) do = link_to(new_registration_path('user')) do
%span.fa.fa-heart %span.fa.fa-heart
Sign Up Sign Up
%li.dropdown.visible-desktop %li{class: ""}
%a.dropdown-toggle{"data-toggle" => "dropdown", href: '#'} = link_to(sign_in_path) do
%span.fa.fa-user %span.fa.fa-user
Sign In Sign In
%span.caret -# %li.dropdown.visible-desktop
.dropdown-menu -# %a.dropdown-toggle{"data-toggle" => "dropdown", href: '#'}
- if ENV['OSEM_ICHAIN_ENABLED'] == 'true' -# %span.fa.fa-user
= form_tag User.ichain_login_url do -# Sign In
= text_field_tag 'username', nil, id: 'user_ichain_email_dd', class: 'form-control', placeholder: 'Username' -# %span.caret
= password_field_tag 'password', nil, id: 'user_ichain_password_dd', class: 'form-control', placeholder: 'Password' -# .dropdown-menu
%button.btn.btn-success.btn-block Sign in -# - if ENV['OSEM_ICHAIN_ENABLED'] == 'true'
- else -# = form_tag User.ichain_login_url do
%div{style: "padding: 6px"} -# = text_field_tag 'username', nil, id: 'user_ichain_email_dd', class: 'form-control', placeholder: 'Username'
= form_tag new_user_session_path, class: 'form-group' do -# = password_field_tag 'password', nil, id: 'user_ichain_password_dd', class: 'form-control', placeholder: 'Password'
= text_field_tag 'user[login]', nil, id: 'user_login_dd', class: 'form-control', placeholder: 'Username / E-Mail' -# %button.btn.btn-success.btn-block Sign in
= password_field_tag 'user[password]', nil, id: 'user_password_dd', class: 'form-control', placeholder: 'Password' -# - else
%p.text-right -# %div{style: "padding: 6px"}
%small -# = form_tag new_user_session_path, class: 'form-group' do
%label{for: 'user_remember_me'} Remember me -# = text_field_tag 'user[login]', nil, id: 'user_login_dd', class: 'form-control', placeholder: 'Username / E-Mail'
= check_box_tag 'user[remember_me]' -# = password_field_tag 'user[password]', nil, id: 'user_password_dd', class: 'form-control', placeholder: 'Password'
%br -# %p.text-right
%button.btn.btn-success.btn-block Sign in -# %small
- unless omniauth_configured.empty? -# %label{for: 'user_remember_me'} Remember me
.divider -# = check_box_tag 'user[remember_me]'
%h6.text-center -# %br
or -# %button.btn.btn-success.btn-block Sign in
= render 'devise/shared/openid_links' -# - unless omniauth_configured.empty?
-# .divider
-# %h6.text-center
-# or
-# = render 'devise/shared/openid_links'
-# %p.text-right -# %p.text-right
-# %br -# %br
-# %a.small.btn.btn-xs.btn-default{"data-toggle" => "collapse", "data-target" => "#navbar-devise-help"} -# %a.small.btn.btn-xs.btn-default{"data-toggle" => "collapse", "data-target" => "#navbar-devise-help"}

View file

@ -27,7 +27,7 @@
.row .row
.col-md-3 .col-md-3
%h3 %h3
- if event.speakers.any? - if @event.speakers.any?
Presented by: Presented by:
- @speakers_ordered.each do |speaker| - @speakers_ordered.each do |speaker|
.speakerinfo .speakerinfo

View file

@ -0,0 +1,6 @@
class RemoveArrivalDepartureFromRegistrations < ActiveRecord::Migration[5.0]
def change
remove_column :registrations, :arrival, :datetime
remove_column :registrations, :departure, :datetime
end
end

View file

@ -10,7 +10,7 @@
# #
# It's strongly recommended that you check this file into your version control system. # It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20181113195810) do ActiveRecord::Schema.define(version: 20181229233811) do
create_table "answers", force: :cascade do |t| create_table "answers", force: :cascade do |t|
t.string "title" t.string "title"
@ -364,8 +364,6 @@ ActiveRecord::Schema.define(version: 20181113195810) do
create_table "registrations", force: :cascade do |t| create_table "registrations", force: :cascade do |t|
t.integer "conference_id" t.integer "conference_id"
t.datetime "arrival"
t.datetime "departure"
t.datetime "created_at" t.datetime "created_at"
t.datetime "updated_at" t.datetime "updated_at"
t.text "other_special_needs" t.text "other_special_needs"

View file

@ -290,14 +290,15 @@ describe ConferenceRegistrationsController, type: :controller do
before do before do
@registration = create(:registration, @registration = create(:registration,
conference: conference, conference: conference,
user: user, user: user)
arrival: Date.new(2014, 04, 25))
end end
context 'updates successfully' do context 'updates successfully' do
before do before do
patch :update, params: { registration: attributes_for(:registration, arrival: Date.new(2014, 04, 29)), patch :update, params: {
conference_id: conference.short_title } registration: attributes_for(:registration, volunteer: true),
conference_id: conference.short_title
}
end end
it 'redirects to registration show path' do it 'redirects to registration show path' do
@ -309,16 +310,17 @@ describe ConferenceRegistrationsController, type: :controller do
end end
it 'updates the registration' do it 'updates the registration' do
@registration.reload expect{ @registration.reload }.to change(@registration, :updated_at)
expect(@registration.arrival).to eq Date.new(2014, 04, 29)
end end
end end
context 'update fails' do context 'update fails' do
before do before do
allow_any_instance_of(Registration).to receive(:update_attributes).and_return(false) allow_any_instance_of(Registration).to receive(:update_attributes).and_return(false)
patch :update, params: { registration: attributes_for(:registration, arrival: Date.new(2014, 04, 27)), patch :update, params: {
conference_id: conference.short_title } registration: attributes_for(:registration, volunteer: true),
conference_id: conference.short_title
}
end end
it 'renders edit template' do it 'renders edit template' do
@ -331,7 +333,7 @@ describe ConferenceRegistrationsController, type: :controller do
it 'does not update the registration' do it 'does not update the registration' do
@registration.reload @registration.reload
expect(@registration.arrival).to eq Date.new(2014, 04, 25) expect { @registration.reload }.not_to change(@registration, :updated_at)
end end
end end
end end

View file

@ -51,26 +51,4 @@ describe Registration do
expect(subject).to receive(:send_registration_mail) expect(subject).to receive(:send_registration_mail)
end end
end end
describe 'registration_to_events_only_if_present' do
context 'valid' do
it 'when user registers for events happening while user is at the conference' do
registration.arrival = conference.start_date
registration.departure = conference.end_date
registration.events << create(:event, program: conference.program, start_time: conference.end_date)
expect(registration.valid?).to eq true
end
end
context 'invalid' do
it 'when user registers for events happening while user is not at the conference' do
registration.arrival = conference.start_date
registration.departure = conference.start_date
registration.events << create(:event, program: conference.program, start_time: conference.end_date)
expect(registration.valid?).to eq false
end
end
end
end end