Rebuild rubocop TODOs after auto-correcting

This commit is contained in:
James Mason 2018-04-04 10:18:51 -07:00
parent 31c50255e9
commit 84dbb52d11
No known key found for this signature in database
GPG key ID: 1B3951886C449023
580 changed files with 3689 additions and 3133 deletions

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
feature 'BaseController' do

View file

@ -1,7 +1,8 @@
# frozen_string_literal: true
require 'spec_helper'
feature Campaign do
let!(:conference) { create(:conference, short_title: 'osc14') }
let!(:organizer_role) { Role.find_by(name: 'organizer', resource: conference) }
let!(:organizer) { create(:user, role_ids: [organizer_role.id]) }

View file

@ -1,7 +1,8 @@
# frozen_string_literal: true
require 'spec_helper'
feature 'Has correct abilities' do
let(:organization) { create(:organization) }
let(:conference) { create(:full_conference, organization: organization) }
let(:role_cfp) { Role.find_by(name: 'cfp', resource: conference) }

View file

@ -1,7 +1,8 @@
# frozen_string_literal: true
require 'spec_helper'
feature Conference do
let!(:conference) { create(:conference) }
let!(:organizer_role) { Role.find_by(name: 'organizer', resource: conference) }
let!(:organizer) { create(:user, role_ids: [organizer_role.id]) }
@ -17,20 +18,22 @@ feature Conference do
click_button 'Create Cfp'
expect(flash)
.to eq('Creating the call for papers failed. ' +
.to eq('Creating the call for papers failed. ' \
"Start date can't be blank. End date can't be blank.")
today = Date.today - 1
page.execute_script(
"$('#registration-period-start-datepicker').val('#{today.strftime('%d/%m/%Y')}')")
"$('#registration-period-start-datepicker').val('#{today.strftime('%d/%m/%Y')}')"
)
page.execute_script(
"$('#registration-period-end-datepicker').val('#{(today + 6).strftime('%d/%m/%Y')}')")
"$('#registration-period-end-datepicker').val('#{(today + 6).strftime('%d/%m/%Y')}')"
)
click_button 'Create Cfp'
# Validations
expect(flash)
.to eq('Call for papers successfully created.')
.to eq('Call for papers successfully created.')
visit admin_conference_program_cfp_path(conference.short_title, conference.program.cfp)
expect(find('#start_date').text).to eq(today.strftime('%A, %B %-d. %Y'))
@ -49,24 +52,27 @@ feature Conference do
# Validate update with empty start date will not saved
page.execute_script(
"$('#registration-period-start-datepicker').val('')")
"$('#registration-period-start-datepicker').val('')"
)
click_button 'Update Cfp'
expect(flash)
.to eq('Updating call for papers failed. ' +
.to eq('Updating call for papers failed. ' \
"Start date can't be blank.")
# Fill in date
today = Date.today - 9
page.execute_script(
"$('#registration-period-start-datepicker').val('#{today.strftime('%d/%m/%Y')}')")
"$('#registration-period-start-datepicker').val('#{today.strftime('%d/%m/%Y')}')"
)
page.execute_script(
"$('#registration-period-end-datepicker').val('#{(today + 14).strftime('%d/%m/%Y')}')")
"$('#registration-period-end-datepicker').val('#{(today + 14).strftime('%d/%m/%Y')}')"
)
click_button 'Update Cfp'
# Validations
expect(flash)
.to eq('Call for papers successfully updated.')
.to eq('Call for papers successfully updated.')
visit admin_conference_program_cfp_path(conference.short_title, conference.program.cfp)
expect(find('#start_date').text).to eq(today.strftime('%A, %B %-d. %Y'))

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
feature Commercial do

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
feature Registration do

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
feature Conference do
@ -18,20 +20,20 @@ feature Conference do
today = Time.zone.today - 1
page
.execute_script("$('#conference-start-datepicker').val('" +
.execute_script("$('#conference-start-datepicker').val('" \
"#{today.strftime('%d/%m/%Y')}')")
page
.execute_script("$('#conference-end-datepicker').val('" +
.execute_script("$('#conference-end-datepicker').val('" \
"#{(today + 7).strftime('%d/%m/%Y')}')")
click_button 'Create Conference'
expect(flash)
.to eq('Conference was successfully created.')
.to eq('Conference was successfully created.')
expect(Conference.count).to eq(expected_count)
expect(Conference.last.organization).to eq(organization)
user.reload
expect(user.has_cached_role? :organizer, Conference.last).to eq(true)
expect(user.has_cached_role?(:organizer, Conference.last)).to eq(true)
end
scenario 'update conference', feature: true, js: true do
@ -49,22 +51,22 @@ feature Conference do
click_button 'Update Conference'
expect(flash)
.to eq("Updating conference failed. Short title can't be blank.")
.to eq("Updating conference failed. Short title can't be blank.")
fill_in 'conference_title', with: 'New Con'
fill_in 'conference_short_title', with: 'NewCon'
day = Time.zone.today + 10
page
.execute_script("$('#conference-start-datepicker').val('" +
.execute_script("$('#conference-start-datepicker').val('" \
"#{day.strftime('%d/%m/%Y')}')")
page
.execute_script("$('#conference-end-datepicker').val('" +
.execute_script("$('#conference-end-datepicker').val('" \
"#{(day + 7).strftime('%d/%m/%Y')}')")
click_button 'Update Conference'
expect(flash)
.to eq('Conference was successfully updated.')
.to eq('Conference was successfully updated.')
conference.reload
expect(conference.title).to eq('New Con')

View file

@ -1,13 +1,13 @@
# frozen_string_literal: true
require 'spec_helper'
feature Contact do
let!(:conference) { create(:conference) }
let!(:organizer_role) { Role.find_by(name: 'organizer', resource: conference) }
let!(:organizer) { create(:user, email: 'admin@example.com', role_ids: [organizer_role.id]) }
shared_examples 'update a contact' do
scenario 'sucessfully', feature: true, js: true do
contact = conference.contact
expected_count = Contact.count
@ -26,7 +26,7 @@ feature Contact do
click_button 'Update Contact'
expect(flash)
.to eq('Contact details were successfully updated.')
.to eq('Contact details were successfully updated.')
contact.reload
expect(contact.email).to eq('example@example.com')
expect(contact.sponsor_email).to eq('sponsor@example.com')
@ -42,5 +42,4 @@ feature Contact do
describe 'organizer' do
it_behaves_like 'update a contact', :organizer
end
end

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
feature DifficultyLevel do
@ -7,10 +9,10 @@ feature DifficultyLevel do
shared_examples 'difficulty levels' do
scenario 'adds difficulty level', feature: true, js: true do
sign_in organizer
visit admin_conference_program_difficulty_levels_path(
conference_id: conference.short_title)
conference_id: conference.short_title
)
# Add difficulty level
click_link 'Add Difficulty Level'
@ -31,11 +33,11 @@ feature DifficultyLevel do
end
scenario 'updates difficulty level', feature: true, js: true do
conference.program.difficulty_levels << create(:difficulty_level)
sign_in organizer
visit admin_conference_program_difficulty_levels_path(
conference_id: conference.short_title)
conference_id: conference.short_title
)
# Remove difficulty level
within('table tr:nth-of-type(4)') do
@ -51,7 +53,6 @@ feature DifficultyLevel do
expect(page.has_content?('Hard Events')).to be true
end
end
end
describe 'organizer' do

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
feature EmailSettings do
@ -54,7 +56,7 @@ feature EmailSettings do
click_button 'Update Email settings'
expect(flash)
.to eq('Email settings have been successfully updated.')
.to eq('Email settings have been successfully updated.')
expect(find('#email_settings_registration_subject')
.value).to eq('Registration subject')
@ -88,7 +90,6 @@ feature EmailSettings do
.value).to eq('Updated conference venue template')
expect(EmailSettings.count).to eq(expected_count)
end
end

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
feature EventType do
@ -7,10 +9,10 @@ feature EventType do
shared_examples 'event types' do
scenario 'adds and updates event type', feature: true do
sign_in organizer
visit admin_conference_program_event_types_path(
conference_id: conference.short_title)
conference_id: conference.short_title
)
within('table#event_types') do
expect(page.assert_selector('tr', count: 2)).to be true

View file

@ -1,7 +1,8 @@
# frozen_string_literal: true
require 'spec_helper'
feature 'Has correct abilities' do
let(:organization) { create(:organization) }
let(:conference) { create(:full_conference, organization: organization) }
let(:role_info_desk) { Role.find_by(name: 'info_desk', resource: conference) }

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
feature Lodging do
@ -10,7 +12,8 @@ feature Lodging do
sign_in organizer
visit admin_conference_lodgings_path(
conference_id: conference.short_title)
conference_id: conference.short_title
)
# Add lodging
click_link 'Add Lodging'
@ -33,7 +36,8 @@ feature Lodging do
sign_in organizer
visit admin_conference_lodgings_path(
conference_id: conference.short_title)
conference_id: conference.short_title
)
expect(page.has_content?(CGI.escapeHTML(lodging.name))).to be true
@ -61,7 +65,8 @@ feature Lodging do
sign_in organizer
visit admin_conference_lodgings_path(
conference_id: conference.short_title)
conference_id: conference.short_title
)
expect(page.has_content?(lodging.name)).to be true

View file

@ -1,8 +1,9 @@
# frozen_string_literal: true
require 'spec_helper'
feature Openid do
shared_examples 'sign in with openid' do
scenario 'has option to log in with Google account' do
visit '/accounts/sign_in'
expect(page.has_content?('or sign in using')).to be true

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
feature 'Has correct abilities' do

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
feature Organization do

View file

@ -1,7 +1,8 @@
# frozen_string_literal: true
require 'spec_helper'
feature 'Has correct abilities' do
let(:organization) { create(:organization) }
let(:conference) { create(:full_conference, organization: organization) }
let(:other_conference) { create(:conference, organization: organization) } # user is organizer, venue is not set by default

View file

@ -1,7 +1,8 @@
# frozen_string_literal: true
require 'spec_helper'
feature Program do
let!(:conference) { create(:conference) }
let!(:program) { conference.program }
let!(:organizer_role) { Role.find_by(name: 'organizer', resource: conference) }
@ -23,7 +24,7 @@ feature Program do
# Validations
expect(flash)
.to eq('The program was successfully updated.')
.to eq('The program was successfully updated.')
expect(find('#rating').text).to eq('4')
end
end

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
feature Event do

View file

@ -1,7 +1,8 @@
# frozen_string_literal: true
require 'spec_helper'
feature RegistrationPeriod do
# It is necessary to use bang version of let to build roles before user
let!(:conference) { create(:conference) }
let!(:organizer_role) { Role.find_by(name: 'organizer', resource: conference) }
@ -12,20 +13,21 @@ feature RegistrationPeriod do
scenario 'create and update registration period', js: true do
sign_in organizer
visit admin_conference_registration_period_path(
conference_id: conference.short_title)
conference_id: conference.short_title
)
click_link 'New Registration Period'
click_button 'Save Registration Period'
expect(flash)
.to eq('An error prohibited the Registration Period from being saved: ' \
.to eq('An error prohibited the Registration Period from being saved: ' \
"Start date can't be blank. End date can't be blank.")
page
.execute_script("$('#registration-period-start-datepicker').val('" +
.execute_script("$('#registration-period-start-datepicker').val('" \
"#{Date.today.strftime('%d/%m/%Y')}')")
page
.execute_script("$('#registration-period-end-datepicker').val('" +
.execute_script("$('#registration-period-end-datepicker').val('" \
"#{(Date.today + 5).strftime('%d/%m/%Y')}')")
click_button 'Save Registration Period'

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
feature Resource do

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
feature Role do

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
feature Room do
@ -10,7 +12,8 @@ feature Room do
scenario 'adds a room', feature: true, js: true do
sign_in organizer
visit admin_conference_venue_rooms_path(
conference_id: conference.short_title)
conference_id: conference.short_title
)
expect(page.has_no_table?('#rooms')).to be true
@ -34,7 +37,8 @@ feature Room do
room = create(:room, venue: venue)
sign_in organizer
visit edit_admin_conference_venue_room_path(
conference_id: conference.short_title, id: room.id)
conference_id: conference.short_title, id: room.id
)
fill_in 'room_name', with: 'Auditorium'
fill_in 'room_size', with: '100'

View file

@ -1,7 +1,8 @@
# frozen_string_literal: true
require 'spec_helper'
feature Splashpage do
# It is necessary to use bang version of let to build roles before user
let!(:conference) { create(:conference) }
let!(:organizer_role) { Role.find_by(name: 'organizer', resource: conference) }
@ -20,7 +21,7 @@ feature Splashpage do
end
context 'splashpage already created' do
let!(:splashpage) { create(:splashpage, conference: conference, public: false)}
let!(:splashpage) { create(:splashpage, conference: conference, public: false) }
scenario 'update a valid splashpage', js: true do
sign_in organizer
@ -63,7 +64,7 @@ feature Splashpage do
end
context 'navigation' do
let!(:splashpage) { create(:splashpage, conference: conference, public: true)}
let!(:splashpage) { create(:splashpage, conference: conference, public: true) }
context 'multiple organizations' do
let!(:additional_organization) { create(:organization) }

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
feature Sponsor do
@ -13,7 +15,8 @@ feature Sponsor do
sign_in organizer
visit admin_conference_sponsors_path(
conference_id: conference.short_title)
conference_id: conference.short_title
)
# Add sponsors
click_link 'Add Sponsor'

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
feature SponsorshipLevel do
@ -9,7 +11,8 @@ feature SponsorshipLevel do
scenario 'adds a sponsorship level', feature: true, js: true do
sign_in organizer
visit admin_conference_sponsorship_levels_path(
conference_id: conference.short_title)
conference_id: conference.short_title
)
expect(page.has_no_table?('#sponsorship_levels')).to be true
@ -32,7 +35,8 @@ feature SponsorshipLevel do
level = create(:sponsorship_level, conference_id: conference.id)
sign_in organizer
visit edit_admin_conference_sponsorship_level_path(
conference_id: conference.short_title, id: level.id)
conference_id: conference.short_title, id: level.id
)
fill_in 'sponsorship_level_title', with: 'Gold'

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
feature Registration do
@ -18,7 +20,6 @@ feature Registration do
end
context 'who is not registered' do
scenario 'purchases and pays for a ticket succcessfully', feature: true, js: true do
visit root_path
click_link 'Register'
@ -143,7 +144,6 @@ feature Registration do
end
context 'who is registered' do
scenario 'unregisters from conference, but ticket purchases dont delete', feature: true, js: true do
visit root_path
click_link 'Register'

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
feature Ticket do

View file

@ -1,7 +1,8 @@
# frozen_string_literal: true
require 'spec_helper'
feature 'Has correct abilities' do
let(:organization) { create(:organization) }
let(:conference) { create(:full_conference, organization: organization) }
let(:self_organized_track) { create(:track, :self_organized, program: conference.program, state: 'confirmed') }

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
feature Track do
@ -8,7 +10,6 @@ feature Track do
shared_examples 'admin tracks' do
scenario 'adds a track', feature: true, js: true do
sign_in organizer
expected = expect do
@ -78,7 +79,6 @@ feature Track do
shared_examples 'non admin tracks' do
scenario 'adds a track', feature: true, js: true do
sign_in user
expected = expect do

View file

@ -1,7 +1,8 @@
# frozen_string_literal: true
require 'spec_helper'
feature 'Has correct abilities' do
let(:organization) { create(:organization) }
let(:conference) { create(:full_conference, organization: organization) } # user is cfp
let(:user) { create(:user) }

View file

@ -1,9 +1,9 @@
# frozen_string_literal: true
require 'spec_helper'
feature User do
shared_examples 'admin ability' do
end
describe 'admin' do

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
feature Conference do
@ -7,12 +9,12 @@ feature Conference do
shared_examples 'venue' do
scenario 'adds and updates venue' do
sign_in organizer
# create the venue
visit admin_conference_venue_path(
conference_id: conference.short_title)
conference_id: conference.short_title
)
click_link 'Create Venue'
fill_in 'venue_name', with: 'Example University'
fill_in 'venue_street', with: 'Example Street 42'
@ -25,7 +27,7 @@ feature Conference do
'sadipscing elitr, sed diam nonumy eirmod tempor'
click_button 'Create Venue'
expect(flash)
.to eq('Venue was successfully created.')
.to eq('Venue was successfully created.')
venue = Conference.find(conference.id).venue
expect(venue.name).to eq('Example University')
expect(venue.street).to eq('Example Street 42')
@ -42,7 +44,7 @@ feature Conference do
fill_in 'venue_description', with: 'new'
click_button 'Update Venue'
expect(flash)
.to eq('Venue was successfully updated.')
.to eq('Venue was successfully updated.')
venue.reload
expect(venue.name).to eq('Example University new')
expect(venue.website).to eq('www.example.com new')
@ -53,5 +55,4 @@ feature Conference do
describe 'organizer' do
it_behaves_like 'venue'
end
end

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
feature 'Version' do
@ -34,7 +36,7 @@ feature 'Version' do
scenario 'display changes in cfp', feature: true, versioning: true, js: true do
cfp = create(:cfp, program: conference.program)
cfp.update_attributes(start_date: (Time.zone.today + 1).strftime('%d/%m/%Y'), end_date: (Time.zone.today + 3).strftime('%d/%m/%Y'))
cfp.update(start_date: (Time.zone.today + 1).strftime('%d/%m/%Y'), end_date: (Time.zone.today + 3).strftime('%d/%m/%Y'))
cfp_id = cfp.id
cfp.destroy
@ -46,7 +48,7 @@ feature 'Version' do
scenario 'display changes in registration_period', feature: true, versioning: true, js: true do
registration_period = create(:registration_period, conference: conference)
registration_period.update_attributes(start_date: (Time.zone.today + 1).strftime('%d/%m/%Y'), end_date: (Time.zone.today + 3).strftime('%d/%m/%Y'))
registration_period.update(start_date: (Time.zone.today + 1).strftime('%d/%m/%Y'), end_date: (Time.zone.today + 3).strftime('%d/%m/%Y'))
registration_period_id = registration_period.id
registration_period.destroy
@ -59,7 +61,7 @@ feature 'Version' do
scenario 'display changes in conference', feature: true, versioning: true, js: true do
new_conference = create(:conference, title: 'Test Conference')
organizer.add_role :organizer, new_conference
new_conference.update_attributes(title: 'New Con', short_title: 'NewCon')
new_conference.update(title: 'New Con', short_title: 'NewCon')
visit admin_revision_history_path
select '100', from: 'versionstable_length'
@ -71,7 +73,7 @@ feature 'Version' do
scenario 'display changes in event_type', feature: true, versioning: true, js: true do
event_type = create(:event_type, program: conference.program, name: 'Discussion')
event_type.update_attributes(length: 90, maximum_abstract_length: 10000)
event_type.update(length: 90, maximum_abstract_length: 10_000)
event_type_id = event_type.id
event_type.destroy
@ -83,7 +85,7 @@ feature 'Version' do
scenario 'display changes in lodging', feature: true, versioning: true, js: true do
lodging = create(:lodging, conference: conference, name: 'Hotel XYZ')
lodging.update_attributes(description: 'Nice view,close to venue', website_link: 'http://www.example.com')
lodging.update(description: 'Nice view,close to venue', website_link: 'http://www.example.com')
lodging_id = lodging.id
lodging.destroy
@ -105,7 +107,7 @@ feature 'Version' do
scenario 'display changes in room', feature: true, versioning: true, js: true do
venue = create(:venue, conference: conference)
room = create(:room, venue: venue, name: 'Auditorium')
room.update_attributes(size: 120)
room.update(size: 120)
room_id = room.id
room.destroy
@ -118,7 +120,7 @@ feature 'Version' do
scenario 'display changes in sponsor', feature: true, versioning: true, js: true do
conference.sponsorship_levels << create_list(:sponsorship_level, 2, conference: conference)
sponsor = create(:sponsor, conference: conference, name: 'SUSE', sponsorship_level: conference.sponsorship_levels.first)
sponsor.update_attributes(website_url: 'https://www.suse.com/company/history', sponsorship_level: conference.sponsorship_levels.second)
sponsor.update(website_url: 'https://www.suse.com/company/history', sponsorship_level: conference.sponsorship_levels.second)
sponsor.destroy
sponsor_id = sponsor.id
@ -130,7 +132,7 @@ feature 'Version' do
scenario 'display changes in sponsorship_level', feature: true, versioning: true, js: true do
sponsorship_level = create(:sponsorship_level, conference: conference)
sponsorship_level.update_attributes(title: 'Gold')
sponsorship_level.update(title: 'Gold')
sponsorship_level_id = sponsorship_level.id
sponsorship_level.destroy
@ -142,7 +144,7 @@ feature 'Version' do
scenario 'display changes in ticket', feature: true, versioning: true, js: true do
ticket = create(:ticket, conference: conference, title: 'Gold')
ticket.update_attributes(price: 50, description: 'Premium Ticket')
ticket.update(price: 50, description: 'Premium Ticket')
ticket_id = ticket.id
ticket.destroy
@ -154,7 +156,7 @@ feature 'Version' do
scenario 'display changes in track', feature: true, versioning: true, js: true do
track = create(:track, program: conference.program, name: 'Distribution')
track.update_attributes(description: 'Events about Linux distributions')
track.update(description: 'Events about Linux distributions')
track_id = track.id
track.destroy
@ -166,7 +168,7 @@ feature 'Version' do
scenario 'display changes in venue', feature: true, versioning: true, js: true do
venue = create(:venue, conference: conference, name: 'Example University')
venue.update_attributes(website: 'www.example.com new', description: 'Just another beautiful venue')
venue.update(website: 'www.example.com new', description: 'Just another beautiful venue')
venue_id = venue.id
venue.destroy
@ -220,7 +222,7 @@ feature 'Version' do
scenario 'display changes in difficulty levels', feature: true, versioning: true, js: true do
difficulty_level = create(:difficulty_level, program: conference.program, title: 'Expert')
difficulty_level.update_attributes(description: 'Only for Experts')
difficulty_level.update(description: 'Only for Experts')
difficulty_level_id = difficulty_level.id
difficulty_level.destroy
@ -271,7 +273,7 @@ feature 'Version' do
scenario 'display changes in conference commercials', feature: true, versioning: true, js: true do
conference_commercial = create(:conference_commercial, commercialable: conference)
conference_commercial.update_attributes(url: 'https://www.youtube.com/watch?v=VNkDJk5_9eU')
conference_commercial.update(url: 'https://www.youtube.com/watch?v=VNkDJk5_9eU')
conference_commercial.destroy
visit admin_revision_history_path
@ -282,7 +284,7 @@ feature 'Version' do
scenario 'display changes in event commercials', feature: true, versioning: true, js: true do
event_commercial
event_commercial.update_attributes(url: 'https://www.youtube.com/watch?v=VNkDJk5_9eU')
event_commercial.update(url: 'https://www.youtube.com/watch?v=VNkDJk5_9eU')
event_commercial.destroy
visit admin_revision_history_path
@ -340,7 +342,7 @@ feature 'Version' do
end
scenario 'display changes in email settings', feature: true, versioning: true, js: true do
conference.email_settings.update_attributes(registration_subject: 'xxxxx', registration_body: 'yyyyy', accepted_subject: 'zzzzz')
conference.email_settings.update(registration_subject: 'xxxxx', registration_body: 'yyyyy', accepted_subject: 'zzzzz')
visit admin_revision_history_path
expect(page).to have_text("Someone (probably via the console) updated registration body, registration subject and accepted subject
@ -361,7 +363,7 @@ feature 'Version' do
registration = Registration.create(user: organizer, conference: conference)
event = create(:event, program: conference.program, title: 'My second event')
EventsRegistration.create(registration: registration, event: event)
EventsRegistration.first.update_attributes(attended: true)
EventsRegistration.first.update(attended: true)
EventsRegistration.last.destroy
# Here registration is deleted to ensure the event registration related change still displays the asociated user's name
registration.destroy
@ -374,7 +376,7 @@ feature 'Version' do
scenario 'display changes in target', feature: true, versioning: true, js: true do
target = create(:target, conference: conference)
target.update_attributes(due_date: Date.today, target_count: 1000)
target.update(due_date: Date.today, target_count: 1000)
target_id = target.id
target.destroy
@ -416,7 +418,7 @@ feature 'Version' do
scenario 'display changes in campaign', feature: true, versioning: true, js: true do
campaign = create(:campaign, conference: conference, name: 'Test Campaign', utm_campaign: 'campaign')
campaign.update_attributes(utm_source: 'source', utm_medium: 'medium', utm_term: 'term', utm_content: 'content')
campaign.update(utm_source: 'source', utm_medium: 'medium', utm_term: 'term', utm_content: 'content')
campaign_id = campaign.id
campaign.destroy
@ -443,7 +445,7 @@ feature 'Version' do
scenario 'display updates to user', feature: true, versioning: true, js: true do
user = create(:user)
user.update_attributes(nickname: 'testnick', affiliation: 'openSUSE')
user.update(nickname: 'testnick', affiliation: 'openSUSE')
visit admin_revision_history_path
expect(page).to have_text("Someone (probably via the console) updated nickname and affiliation of user #{user.name}")

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'spec_helper'
feature Conference do
@ -9,41 +11,42 @@ feature Conference do
scenario 'adds and updates vdays', feature: true, js: true do
sign_in(organizer)
visit admin_conference_volunteers_info_path(
conference_id: conference.short_title)
conference_id: conference.short_title
)
check('Enable Volunteering')
check('Use vdays')
# click_link 'Add vday'
# expect(page.all('div.nested-fields').count == 1).to be true
# page.
# find('div.nested-fields:nth-of-type(1) select:nth-of-type(1)').
# select("#{Date.today.strftime('%Y')}")
# page.
# find('div.nested-fields:nth-of-type(1) select:nth-of-type(2)').
# select("#{Date.today.strftime('%B')}")
# page.
# find('div.nested-fields:nth-of-type(1) select:nth-of-type(3)').
# select("#{Date.today.strftime('%-d')}")
# page.
# find('div.nested-fields:nth-of-type(1) div:nth-of-type(1) textarea').
# set('Example Person')
# click_link 'Add vday'
# expect(page.all('div.nested-fields').count == 1).to be true
# page.
# find('div.nested-fields:nth-of-type(1) select:nth-of-type(1)').
# select("#{Date.today.strftime('%Y')}")
# page.
# find('div.nested-fields:nth-of-type(1) select:nth-of-type(2)').
# select("#{Date.today.strftime('%B')}")
# page.
# find('div.nested-fields:nth-of-type(1) select:nth-of-type(3)').
# select("#{Date.today.strftime('%-d')}")
# page.
# find('div.nested-fields:nth-of-type(1) div:nth-of-type(1) textarea').
# set('Example Person')
click_button 'Update Conference'
expect(flash)
.to eq('Volunteering options were successfully updated.')
.to eq('Volunteering options were successfully updated.')
# # Validations
# expect(find('div.nested-fields:nth-of-type(1) select:nth-of-type(1)').
# value).to eq("#{Date.today.strftime('%Y')}")
# expect(find('div.nested-fields:nth-of-type(1) select:nth-of-type(2)').
# value).to eq("#{Date.today.month}")
# expect(find('div.nested-fields:nth-of-type(1) select:nth-of-type(3)').
# value).to eq("#{Date.today.strftime('%-d')}")
# expect(
# find('div.nested-fields:nth-of-type(1) div:nth-of-type(1) textarea').
# value).to eq('Example Person')
#
# # Remove vday
# click_link 'Remove vday'
# expect(page.all('div.nested-fields').count == 0).to be true
# # Validations
# expect(find('div.nested-fields:nth-of-type(1) select:nth-of-type(1)').
# value).to eq("#{Date.today.strftime('%Y')}")
# expect(find('div.nested-fields:nth-of-type(1) select:nth-of-type(2)').
# value).to eq("#{Date.today.month}")
# expect(find('div.nested-fields:nth-of-type(1) select:nth-of-type(3)').
# value).to eq("#{Date.today.strftime('%-d')}")
# expect(
# find('div.nested-fields:nth-of-type(1) div:nth-of-type(1) textarea').
# value).to eq('Example Person')
#
# # Remove vday
# click_link 'Remove vday'
# expect(page.all('div.nested-fields').count == 0).to be true
click_button 'Update Conference'
expect(flash).to eq('Volunteering options were successfully updated.')
expect(page.all('div.nested-fields').count == 0).to be true
@ -53,65 +56,66 @@ feature Conference do
scenario 'adds and updates vpositions', feature: true, js: true do
sign_in(organizer)
visit admin_conference_volunteers_info_path(
conference_id: conference.short_title)
conference_id: conference.short_title
)
# Adding vday
check('Enable Volunteering')
check('Use vdays')
# click_link 'Add vday'
# expect(page.all('div.nested-fields').count == 1).to be true
# page.
# find('div.nested-fields:nth-of-type(1) select:nth-of-type(1)').
# select("#{Date.today.strftime('%Y')}")
# page.
# find('div.nested-fields:nth-of-type(1) select:nth-of-type(2)').
# select("#{Date.today.strftime('%B')}")
# page.
# find('div.nested-fields:nth-of-type(1) select:nth-of-type(3)').
# select("#{Date.today.strftime('%-d')}")
# page.
# find('div.nested-fields:nth-of-type(1) div:nth-of-type(1) textarea').
# set('Example Person')
# click_link 'Add vday'
# expect(page.all('div.nested-fields').count == 1).to be true
# page.
# find('div.nested-fields:nth-of-type(1) select:nth-of-type(1)').
# select("#{Date.today.strftime('%Y')}")
# page.
# find('div.nested-fields:nth-of-type(1) select:nth-of-type(2)').
# select("#{Date.today.strftime('%B')}")
# page.
# find('div.nested-fields:nth-of-type(1) select:nth-of-type(3)').
# select("#{Date.today.strftime('%-d')}")
# page.
# find('div.nested-fields:nth-of-type(1) div:nth-of-type(1) textarea').
# set('Example Person')
click_button 'Update Conference'
expect(flash)
.to eq('Volunteering options were successfully updated.')
.to eq('Volunteering options were successfully updated.')
# Add vposition
check('Use vpositions')
# click_link 'Add vposition'
# expect(page.all('div.nested-fields').count == 2).to be true
# page.find('div.vpositions div.nested-fields:nth-of-type(1)'\
# ' div:nth-of-type(1) input').
# set('Example Position')
# page.find('div.vpositions div.nested-fields:nth-of-type(1)'\
# ' div:nth-of-type(2) textarea').
# set('Example Description')
# find(:css, "select[id^='conference_vpositions_attributes_']"\
# "[id$='_vday_ids']").
# find(:option, "#{Date.today.strftime}").select_option
# click_link 'Add vposition'
# expect(page.all('div.nested-fields').count == 2).to be true
# page.find('div.vpositions div.nested-fields:nth-of-type(1)'\
# ' div:nth-of-type(1) input').
# set('Example Position')
# page.find('div.vpositions div.nested-fields:nth-of-type(1)'\
# ' div:nth-of-type(2) textarea').
# set('Example Description')
# find(:css, "select[id^='conference_vpositions_attributes_']"\
# "[id$='_vday_ids']").
# find(:option, "#{Date.today.strftime}").select_option
click_button 'Update Conference'
expect(flash)
.to eq('Volunteering options were successfully updated.')
.to eq('Volunteering options were successfully updated.')
# Validations
# expect(find('div.vpositions div.nested-fields:nth-of-type(1)'\
# ' div:nth-of-type(1) input').
# value).to eq('Example Position')
# expect(find('div.vpositions div.nested-fields:nth-of-type(1)'\
# ' div:nth-of-type(2) textarea').
# value).to eq('Example Description')
#
# expect(find('div.vpositions div.nested-fields:nth-of-type(1)'\
# ' div:nth-of-type(3) select:nth-of-type(1)').find('option[selected]').
# text).to eq(Date.today.strftime)
# expect(find('div.vpositions div.nested-fields:nth-of-type(1)'\
# ' div:nth-of-type(1) input').
# value).to eq('Example Position')
# expect(find('div.vpositions div.nested-fields:nth-of-type(1)'\
# ' div:nth-of-type(2) textarea').
# value).to eq('Example Description')
#
# expect(find('div.vpositions div.nested-fields:nth-of-type(1)'\
# ' div:nth-of-type(3) select:nth-of-type(1)').find('option[selected]').
# text).to eq(Date.today.strftime)
# Remove vposition
# click_link 'Remove vposition'
# expect(page.all('div.nested-fields').count == 1).to be true
# click_button 'Update Conference'
# click_link 'Remove vposition'
# expect(page.all('div.nested-fields').count == 1).to be true
# click_button 'Update Conference'
expect(flash).to eq('Volunteering options were successfully updated.')
# click_link 'Remove vday'
# expect(page.all('div.nested-fields').count == 0).to be true
# click_link 'Remove vday'
# expect(page.all('div.nested-fields').count == 0).to be true
sign_out
end
end