Merge branch 'master' into admin-ticketing
* master: (61 commits) Replace more Commercials with Materials Rename more commericals to materials UI -- Repalce "Commerials" with "Materials". Re-order Conference Associations Cleanup CSS add Snap! style block attachments hide venue link if there is no venue link No dropshadow Text with drop shadow for now Tidy up the look of lodging panels Show reg status for tickets. Tweak CSS, fix loding order Move the venue description to below the map. Update lodging styling. Add description for venu when map is shown. CSS tweaks... Make the edit form not so wide. Support markdown in more fields Cleanup CSS ordering, fix coloring for navdropdowns dumb...fix order of link_to args ARRRGHHH, another typo...same line... fix typo ...
This commit is contained in:
commit
4306fbe636
82 changed files with 423 additions and 428 deletions
|
|
@ -290,14 +290,15 @@ describe ConferenceRegistrationsController, type: :controller do
|
|||
before do
|
||||
@registration = create(:registration,
|
||||
conference: conference,
|
||||
user: user,
|
||||
arrival: Date.new(2014, 04, 25))
|
||||
user: user)
|
||||
end
|
||||
|
||||
context 'updates successfully' do
|
||||
before do
|
||||
patch :update, params: { registration: attributes_for(:registration, arrival: Date.new(2014, 04, 29)),
|
||||
conference_id: conference.short_title }
|
||||
patch :update, params: {
|
||||
registration: attributes_for(:registration, volunteer: true),
|
||||
conference_id: conference.short_title
|
||||
}
|
||||
end
|
||||
|
||||
it 'redirects to registration show path' do
|
||||
|
|
@ -309,16 +310,17 @@ describe ConferenceRegistrationsController, type: :controller do
|
|||
end
|
||||
|
||||
it 'updates the registration' do
|
||||
@registration.reload
|
||||
expect(@registration.arrival).to eq Date.new(2014, 04, 29)
|
||||
expect{ @registration.reload }.to change(@registration, :updated_at)
|
||||
end
|
||||
end
|
||||
|
||||
context 'update fails' do
|
||||
before do
|
||||
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)),
|
||||
conference_id: conference.short_title }
|
||||
patch :update, params: {
|
||||
registration: attributes_for(:registration, volunteer: true),
|
||||
conference_id: conference.short_title
|
||||
}
|
||||
end
|
||||
|
||||
it 'renders edit template' do
|
||||
|
|
@ -331,7 +333,7 @@ describe ConferenceRegistrationsController, type: :controller do
|
|||
|
||||
it 'does not update the registration' do
|
||||
@registration.reload
|
||||
expect(@registration.arrival).to eq Date.new(2014, 04, 25)
|
||||
expect { @registration.reload }.not_to change(@registration, :updated_at)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -17,9 +17,9 @@ feature Commercial do
|
|||
|
||||
# Create valid commercial
|
||||
fill_in 'commercial_url', with: 'https://www.youtube.com/watch?v=M9bq_alk-sw'
|
||||
click_button 'Create Commercial'
|
||||
click_button 'Save Materials'
|
||||
page.find('#flash')
|
||||
expect(flash).to eq('Commercial was successfully created.')
|
||||
expect(flash).to eq('Materials were successfully created.')
|
||||
page.find('#flash .button.close').click
|
||||
expect(conference.commercials.count).to eq(1)
|
||||
|
||||
|
|
@ -28,7 +28,7 @@ feature Commercial do
|
|||
fill_in "commercial_url_#{commercial.id}", with: 'https://www.youtube.com/watch?v=VNkDJk5_9eU'
|
||||
click_button 'Update'
|
||||
page.find('#flash')
|
||||
expect(flash).to eq('Commercial was successfully updated.')
|
||||
expect(flash).to eq('Materials were successfully updated.')
|
||||
page.find('#flash .button.close').click
|
||||
expect(conference.commercials.count).to eq(1)
|
||||
commercial.reload
|
||||
|
|
@ -39,7 +39,7 @@ feature Commercial do
|
|||
click_link 'Delete'
|
||||
end
|
||||
page.find('#flash')
|
||||
expect(flash).to eq('Commercial was successfully destroyed.')
|
||||
expect(flash).to eq('Materials were successfully destroyed.')
|
||||
expect(conference.commercials.count).to eq(0)
|
||||
end
|
||||
end
|
||||
|
|
@ -56,23 +56,23 @@ feature Commercial do
|
|||
|
||||
scenario 'adds a valid commercial of an event', feature: true, js: true do
|
||||
visit edit_conference_program_proposal_path(conference.short_title, event.id)
|
||||
click_link 'Commercials'
|
||||
click_link 'Materials'
|
||||
fill_in 'commercial_url', with: 'https://www.youtube.com/watch?v=M9bq_alk-sw'
|
||||
|
||||
# Workaround to enable the 'Create Commercial' button
|
||||
# Workaround to enable the 'Save Materials' button
|
||||
page.execute_script("$('#commercial_submit_action').prop('disabled', false)")
|
||||
|
||||
click_button 'Create Commercial'
|
||||
click_button 'Save Materials'
|
||||
page.find('#flash')
|
||||
expect(flash).to eq('Commercial was successfully created.')
|
||||
expect(flash).to eq('Materials were successfully created.')
|
||||
end
|
||||
|
||||
scenario 'does not add an invalid commercial of an event', feature: true, js: true do
|
||||
visit edit_conference_program_proposal_path(conference.short_title, event.id)
|
||||
click_link 'Commercials'
|
||||
click_link 'Materials'
|
||||
fill_in 'commercial_url', with: 'invalid_commercial_url'
|
||||
expect(page).to have_content('No embeddable content')
|
||||
expect(page).to have_css("button[type='submit']:disabled", text: 'Create Commercial')
|
||||
expect(page).to have_css("button[type='submit']:disabled", text: 'Save Materials')
|
||||
end
|
||||
|
||||
scenario 'updates a commercial of an event', feature: true, js: true do
|
||||
|
|
@ -80,11 +80,11 @@ feature Commercial do
|
|||
commercialable_id: event.id,
|
||||
commercialable_type: 'Event')
|
||||
visit edit_conference_program_proposal_path(conference.short_title, event.id)
|
||||
click_link 'Commercials'
|
||||
click_link 'Materials'
|
||||
fill_in "commercial_url_#{commercial.id}", with: 'https://www.youtube.com/watch?v=M9bq_alk-sw'
|
||||
click_button 'Update'
|
||||
page.find('#flash')
|
||||
expect(flash).to eq('Commercial was successfully updated.')
|
||||
expect(flash).to eq('Materials were successfully updated.')
|
||||
TransactionalCapybara::AjaxHelpers.wait_for_ajax(page)
|
||||
expect(event.commercials.count).to eq(1)
|
||||
commercial.reload
|
||||
|
|
@ -97,12 +97,12 @@ feature Commercial do
|
|||
commercialable_type: 'Event',
|
||||
url: 'https://www.youtube.com/watch?v=BTTygyxuGj8')
|
||||
visit edit_conference_program_proposal_path(conference.short_title, event.id)
|
||||
click_link 'Commercials'
|
||||
click_link 'Materials'
|
||||
fill_in "commercial_url_#{commercial.id}", with: 'invalid_commercial_url'
|
||||
click_button 'Update'
|
||||
find('#flash')
|
||||
expect(current_path).to eq edit_conference_program_proposal_path(conference.short_title, event.id)
|
||||
expect(flash).to include('An error prohibited this Commercial from being saved:')
|
||||
expect(flash).to include('An error prohibited materials from being saved:')
|
||||
commercial.reload
|
||||
expect(commercial.url).to eq('https://www.youtube.com/watch?v=BTTygyxuGj8')
|
||||
end
|
||||
|
|
@ -112,12 +112,12 @@ feature Commercial do
|
|||
commercialable_id: event.id,
|
||||
commercialable_type: 'Event')
|
||||
visit edit_conference_program_proposal_path(conference.short_title, event.id)
|
||||
click_link 'Commercials'
|
||||
click_link 'Materials'
|
||||
page.accept_alert do
|
||||
click_link 'Delete'
|
||||
end
|
||||
page.find('#flash')
|
||||
expect(flash).to eq('Commercial was successfully destroyed.')
|
||||
expect(flash).to eq('Materials were successfully destroyed.')
|
||||
TransactionalCapybara::AjaxHelpers.wait_for_ajax(page)
|
||||
expect(event.commercials.count).to eq(0)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ feature 'Has correct abilities' do
|
|||
expect(page).to_not have_link('Basics', href: "/admin/conferences/#{conference.short_title}/edit")
|
||||
expect(page).to have_text('Basics')
|
||||
expect(page).to_not have_link('Contact', href: "/admin/conferences/#{conference.short_title}/contact/edit")
|
||||
expect(page).to have_link('Commercials', href: "/admin/conferences/#{conference.short_title}/commercials")
|
||||
expect(page).to have_link('Materials', href: "/admin/conferences/#{conference.short_title}/commercials")
|
||||
expect(page).to_not have_link('Splashpage', href: "/admin/conferences/#{conference.short_title}/splashpage")
|
||||
expect(page).to_not have_link('Lodgings', href: "/admin/conferences/#{conference.short_title}/lodgings")
|
||||
expect(page).to_not have_link('Registration Period', href: "/admin/conferences/#{conference.short_title}/registration_period")
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ feature 'Has correct abilities' do
|
|||
expect(page).to have_selector('li.nav-header.nav-header-bigger a', text: 'Dashboard')
|
||||
expect(page).to have_link('Basics', href: "/admin/conferences/#{conference.short_title}/edit")
|
||||
expect(page).to have_link('Contact', href: "/admin/conferences/#{conference.short_title}/contact/edit")
|
||||
expect(page).to have_link('Commercials', href: "/admin/conferences/#{conference.short_title}/commercials")
|
||||
expect(page).to have_link('Materials', href: "/admin/conferences/#{conference.short_title}/commercials")
|
||||
expect(page).to have_link('Splashpage', href: "/admin/conferences/#{conference.short_title}/splashpage")
|
||||
expect(page).to have_link('Venue', href: "/admin/conferences/#{conference.short_title}/venue")
|
||||
expect(page).to have_link('Rooms', href: "/admin/conferences/#{conference.short_title}/venue/rooms")
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ feature 'Has correct abilities' do
|
|||
expect(page).to have_selector('li.nav-header.nav-header-bigger a', text: 'Dashboard')
|
||||
expect(page).to have_link('Basics', href: "/admin/conferences/#{conference.short_title}/edit")
|
||||
expect(page).to have_link('Contact', href: "/admin/conferences/#{conference.short_title}/contact/edit")
|
||||
expect(page).to have_link('Commercials', href: "/admin/conferences/#{conference.short_title}/commercials")
|
||||
expect(page).to have_link('Materials', href: "/admin/conferences/#{conference.short_title}/commercials")
|
||||
expect(page).to have_link('Splashpage', href: "/admin/conferences/#{conference.short_title}/splashpage")
|
||||
expect(page).to have_link('Venue', href: "/admin/conferences/#{conference.short_title}/venue")
|
||||
expect(page).to have_link('Rooms', href: "/admin/conferences/#{conference.short_title}/venue/rooms")
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ feature 'Has correct abilities' do
|
|||
expect(page).to_not have_link('Basics', href: "/admin/conferences/#{conference.short_title}/edit")
|
||||
expect(page).to have_text('Basics')
|
||||
expect(page).to_not have_link('Contact', href: "/admin/conferences/#{conference.short_title}/contact/edit")
|
||||
expect(page).to have_link('Commercials', href: "/admin/conferences/#{conference.short_title}/commercials")
|
||||
expect(page).to have_link('Materials', href: "/admin/conferences/#{conference.short_title}/commercials")
|
||||
expect(page).to_not have_link('Splashpage', href: "/admin/conferences/#{conference.short_title}/splashpage")
|
||||
expect(page).to_not have_link('Venue', href: "/admin/conferences/#{conference.short_title}/venue")
|
||||
expect(page).to_not have_link('Rooms', href: "/admin/conferences/#{conference.short_title}/venue/rooms")
|
||||
|
|
|
|||
|
|
@ -277,9 +277,9 @@ feature 'Version' do
|
|||
conference_commercial.destroy
|
||||
|
||||
visit admin_revision_history_path
|
||||
expect(page).to have_text("Someone (probably via the console) created new commercial in conference #{conference.short_title}")
|
||||
expect(page).to have_text("Someone (probably via the console) updated url of commercial in conference #{conference.short_title}")
|
||||
expect(page).to have_text("Someone (probably via the console) deleted commercial in conference #{conference.short_title}")
|
||||
expect(page).to have_text("Someone (probably via the console) created new materials in conference #{conference.short_title}")
|
||||
expect(page).to have_text("Someone (probably via the console) updated url of materials in conference #{conference.short_title}")
|
||||
expect(page).to have_text("Someone (probably via the console) deleted materials in conference #{conference.short_title}")
|
||||
end
|
||||
|
||||
scenario 'display changes in event commercials', feature: true, versioning: true, js: true do
|
||||
|
|
@ -288,9 +288,9 @@ feature 'Version' do
|
|||
event_commercial.destroy
|
||||
|
||||
visit admin_revision_history_path
|
||||
expect(page).to have_text("Someone (probably via the console) created new commercial in event #{event_with_commercial.title} in conference #{conference.short_title}")
|
||||
expect(page).to have_text("Someone (probably via the console) updated url of commercial in event #{event_with_commercial.title} in conference #{conference.short_title}")
|
||||
expect(page).to have_text("Someone (probably via the console) deleted commercial in event #{event_with_commercial.title} in conference #{conference.short_title}")
|
||||
expect(page).to have_text("Someone (probably via the console) created new materals in event #{event_with_commercial.title} in conference #{conference.short_title}")
|
||||
expect(page).to have_text("Someone (probably via the console) updated url of materials in event #{event_with_commercial.title} in conference #{conference.short_title}")
|
||||
expect(page).to have_text("Someone (probably via the console) deleted materials in event #{event_with_commercial.title} in conference #{conference.short_title}")
|
||||
end
|
||||
|
||||
scenario 'display changes in event commercials in event history', feature: true, versioning: true, js: true do
|
||||
|
|
@ -299,10 +299,10 @@ feature 'Version' do
|
|||
|
||||
visit admin_conference_program_event_path(conference.short_title, event_with_commercial)
|
||||
click_link 'History'
|
||||
expect(page).to have_text('Someone (probably via the console) created new commercial')
|
||||
expect(page).to have_text('Someone (probably via the console) created new materials')
|
||||
visit admin_conference_program_event_path(conference.short_title, event_without_commercial)
|
||||
click_link 'History'
|
||||
expect(page).to have_no_text('Someone (probably via the console) created new commercial')
|
||||
expect(page).to have_no_text('Someone (probably via the console) created new materials')
|
||||
end
|
||||
|
||||
scenario 'display changes in organization', feature: true, versioning: true, js: true do
|
||||
|
|
|
|||
|
|
@ -51,26 +51,4 @@ describe Registration do
|
|||
expect(subject).to receive(:send_registration_mail)
|
||||
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue