Merge branch 'master' of https://github.com/CactusPuppy/snapcon into 176895512-automatically-redirect-to-registration-after-buying-a-ticket
This commit is contained in:
commit
85c7b31a77
85 changed files with 740 additions and 509 deletions
|
|
@ -39,6 +39,34 @@
|
|||
# !/bin/env ruby
|
||||
require 'spec_helper'
|
||||
|
||||
context 'Delegation' do
|
||||
subject do
|
||||
FactoryBot.create(:conference, start_date: 1.month.from_now, end_date: 2.month.from_now)
|
||||
end
|
||||
|
||||
context 'Venue' do
|
||||
context 'when venue has not been set' do
|
||||
it 'the accessors should be nil' do
|
||||
expect(subject.city).to eq(nil)
|
||||
expect(subject.country_name).to eq(nil)
|
||||
expect(subject.venue_name).to eq(nil)
|
||||
expect(subject.venue_street).to eq(nil)
|
||||
end
|
||||
end
|
||||
|
||||
context 'when venue has been set' do
|
||||
it 'should delegate to venue' do
|
||||
venue = FactoryBot.create(:venue)
|
||||
subject.update(venue: venue)
|
||||
expect(subject.city).to eq(venue.city)
|
||||
expect(subject.country_name).to eq(venue.country_name)
|
||||
expect(subject.venue_name).to eq(venue.name)
|
||||
expect(subject.venue_street).to eq(venue.street)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe Conference do
|
||||
|
||||
let(:subject) { create(:conference, start_date: Date.new(2014, 06, 30), end_date: Date.new(2014, 06, 30)) }
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
# id :bigint not null, primary key
|
||||
# abstract :text
|
||||
# comments_count :integer default(0), not null
|
||||
# committee_review :text
|
||||
# description :text
|
||||
# guid :string not null
|
||||
# is_highlight :boolean default(FALSE)
|
||||
|
|
@ -18,6 +19,7 @@
|
|||
# require_registration :boolean
|
||||
# start_time :datetime
|
||||
# state :string default("new"), not null
|
||||
# submission_text :text
|
||||
# subtitle :string
|
||||
# title :string not null
|
||||
# week :integer
|
||||
|
|
@ -109,6 +111,21 @@ describe Event do
|
|||
end
|
||||
end
|
||||
|
||||
describe '#submission_limit' do
|
||||
before :each do
|
||||
event.event_type.maximum_abstract_length = 3
|
||||
event.event_type.minimum_abstract_length = 2
|
||||
end
|
||||
|
||||
context 'is valid' do
|
||||
it 'when submission text is within limts' do
|
||||
event.abstract = 'the magic three'
|
||||
expect(event.valid?).to eq true
|
||||
expect(event.errors.size).to eq 0
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe '#before_end_of_conference' do
|
||||
context 'is invalid' do
|
||||
it 'when event is created after the conference end_date, and returns an error message' do
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
# length :integer default(30)
|
||||
# maximum_abstract_length :integer default(500)
|
||||
# minimum_abstract_length :integer default(0)
|
||||
# submission_instructions :text
|
||||
# title :string not null
|
||||
# created_at :datetime
|
||||
# updated_at :datetime
|
||||
|
|
|
|||
|
|
@ -493,7 +493,7 @@ describe User do
|
|||
end
|
||||
|
||||
describe 'assigns admin attribute' do
|
||||
it 'to second user when first user is deleted_user' do
|
||||
xit 'to second user when first user is deleted_user' do
|
||||
deleted_user = User.find_by(email: 'deleted@localhost.osem')
|
||||
expect(deleted_user.is_admin).to be false
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue