Merge pull request #1446 from sunny-b/master

Enable Style/DotPosition Rubocop cop
This commit is contained in:
Ana María Martínez Gómez 2017-04-07 11:21:34 +02:00 committed by GitHub
commit fd6d0bf39b
25 changed files with 143 additions and 142 deletions

View file

@ -39,6 +39,10 @@ Style/CaseEquality:
Style/ClassAndModuleChildren: Style/ClassAndModuleChildren:
Enabled: true Enabled: true
# Checks the . position in multi-line method calls.
Style/DotPosition:
Enabled: true
# Checks for uses of double negation (!!) to convert something to a boolean value. # Checks for uses of double negation (!!) to convert something to a boolean value.
Style/DoubleNegation: Style/DoubleNegation:
Enabled: true Enabled: true

View file

@ -222,13 +222,6 @@ Style/ConditionalAssignment:
Style/Documentation: Style/Documentation:
Enabled: false Enabled: false
# Offense count: 74
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: leading, trailing
Style/DotPosition:
Enabled: false
# Offense count: 1 # Offense count: 1
# Cop supports --auto-correct. # Cop supports --auto-correct.
Style/ElseAlignment: Style/ElseAlignment:

View file

@ -21,8 +21,8 @@ module Admin
@new_submissions = Event.where('created_at > ?', current_user.last_sign_in_at).count @new_submissions = Event.where('created_at > ?', current_user.last_sign_in_at).count
@active_conferences = Conference.get_active_conferences_for_dashboard # pending or the last two @active_conferences = Conference.get_active_conferences_for_dashboard # pending or the last two
@deactive_conferences = Conference. @deactive_conferences = Conference
get_conferences_without_active_for_dashboard(@active_conferences) # conferences without active .get_conferences_without_active_for_dashboard(@active_conferences) # conferences without active
@conferences = @active_conferences + @deactive_conferences @conferences = @active_conferences + @deactive_conferences
@recent_users = User.limit(5).order(created_at: :desc) @recent_users = User.limit(5).order(created_at: :desc)
@ -106,8 +106,8 @@ module Admin
@new_reg = @conference.registrations.where('created_at > ?', current_user.last_sign_in_at).count @new_reg = @conference.registrations.where('created_at > ?', current_user.last_sign_in_at).count
@total_submissions = @program.events.count @total_submissions = @program.events.count
@new_submissions = @program.events. @new_submissions = @program.events
where('created_at > ?', current_user.last_sign_in_at).count .where('created_at > ?', current_user.last_sign_in_at).count
@program_length = @conference.current_program_hours @program_length = @conference.current_program_hours
@new_program_length = @conference.new_program_hours(current_user.last_sign_in_at) @new_program_length = @conference.new_program_hours(current_user.last_sign_in_at)
@ -139,8 +139,8 @@ module Admin
@event_type_distribution_confirmed = @conference.event_type_distribution(:confirmed) @event_type_distribution_confirmed = @conference.event_type_distribution(:confirmed)
@difficulty_levels_distribution = @conference.difficulty_levels_distribution @difficulty_levels_distribution = @conference.difficulty_levels_distribution
@difficulty_levels_distribution_confirmed = @conference. @difficulty_levels_distribution_confirmed = @conference
difficulty_levels_distribution(:confirmed) .difficulty_levels_distribution(:confirmed)
@tracks_distribution = @conference.tracks_distribution @tracks_distribution = @conference.tracks_distribution
@tracks_distribution_confirmed = @conference.tracks_distribution(:confirmed) @tracks_distribution_confirmed = @conference.tracks_distribution(:confirmed)

View file

@ -10,10 +10,10 @@ module Admin
@events_with_requirements = @events.where.not(description: ['', nil]) @events_with_requirements = @events.where.not(description: ['', nil])
attended_registrants_ids = @conference.registrations.where(attended: true).pluck(:user_id) attended_registrants_ids = @conference.registrations.where(attended: true).pluck(:user_id)
@missing_event_speakers = EventUser.joins(:event). @missing_event_speakers = EventUser.joins(:event)
where('event_role = ? and program_id = ?', 'submitter', @program.id). .where('event_role = ? and program_id = ?', 'submitter', @program.id)
where.not(user_id: attended_registrants_ids). .where.not(user_id: attended_registrants_ids)
includes(:user, :event) .includes(:user, :event)
end end
end end
end end

View file

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

View file

@ -23,12 +23,12 @@ class RegistrationsController < Devise::RegistrationsController
def configure_permitted_parameters def configure_permitted_parameters
devise_parameter_sanitizer.permit(:account_update) do |u| devise_parameter_sanitizer.permit(:account_update) do |u|
u. u
permit(:email, :password, :password_confirmation, :current_password, :username, :email_public) .permit(:email, :password, :password_confirmation, :current_password, :username, :email_public)
end end
devise_parameter_sanitizer.permit(:sign_up) do |u| devise_parameter_sanitizer.permit(:sign_up) do |u|
u. u
permit(:email, :password, :password_confirmation, :name, :username) .permit(:email, :password, :password_confirmation, :name, :username)
end end
end end
end end

View file

@ -417,10 +417,10 @@ module ApplicationHelper
# Eg: If version.changeset = '{"title"=>[nil, "Premium"], "description"=>[nil, "Premium = Super cool"], "conference_id"=>[nil, 3]}' # Eg: If version.changeset = '{"title"=>[nil, "Premium"], "description"=>[nil, "Premium = Super cool"], "conference_id"=>[nil, 3]}'
# Output will be 'title, description and conference' # Output will be 'title, description and conference'
def updated_attributes(version) def updated_attributes(version)
version.changeset. version.changeset
reject{ |_, values| values[0].blank? && values[1].blank? }. .reject{ |_, values| values[0].blank? && values[1].blank? }
keys.map{ |key| key.gsub('_id', '').tr('_', ' ')}.join(', '). .keys.map{ |key| key.gsub('_id', '').tr('_', ' ')}.join(', ')
reverse.sub(',', ' dna ').reverse .reverse.sub(',', ' dna ').reverse
end end
def link_to_user(user_id) def link_to_user(user_id)

View file

@ -58,16 +58,20 @@ class Cfp < ActiveRecord::Base
private private
def before_end_of_conference def before_end_of_conference
errors. if program.conference && program.conference.end_date && end_date && (end_date > program.conference.end_date)
add(:end_date, "can't be after the conference end date (#{program.conference.end_date})") if program.conference && program.conference.end_date && end_date && (end_date > program.conference.end_date) errors
.add(:end_date, "can't be after the conference end date (#{program.conference.end_date})")
end
errors. if program.conference && program.conference.end_date && start_date && (start_date > program.conference.end_date)
add(:start_date, "can't be after the conference end date (#{program.conference.end_date})") if program.conference && program.conference.end_date && start_date && (start_date > program.conference.end_date) errors
.add(:start_date, "can't be after the conference end date (#{program.conference.end_date})")
end
end end
def start_after_end_date def start_after_end_date
errors. errors
add(:start_date, "can't be after the end date") if start_date && end_date && start_date > end_date .add(:start_date, "can't be after the end date") if start_date && end_date && start_date > end_date
end end
def conference_id def conference_id

View file

@ -180,8 +180,8 @@ class Conference < ActiveRecord::Base
if registration_period && if registration_period &&
registration_period.start_date && registration_period.start_date &&
registration_period.end_date registration_period.end_date
weeks = Date.new(registration_period.start_date.year, 12, 31). weeks = Date.new(registration_period.start_date.year, 12, 31)
strftime('%W').to_i .strftime('%W').to_i
result = get_registration_end_week - get_registration_start_week + 1 result = get_registration_end_week - get_registration_start_week + 1
end end
@ -277,9 +277,9 @@ class Conference < ActiveRecord::Base
# ====Returns # ====Returns
# * +hash+ -> user: submissions # * +hash+ -> user: submissions
def get_top_submitter(limit = 5) def get_top_submitter(limit = 5)
submitter = EventUser.joins(:event). submitter = EventUser.joins(:event)
where('event_role = ? and program_id = ?', 'submitter', Conference.find(id).program.id). .where('event_role = ? and program_id = ?', 'submitter', Conference.find(id).program.id)
limit(limit).group(:user_id) .limit(limit).group(:user_id)
counter = submitter.order('count_all desc').count counter = submitter.order('count_all desc').count
Conference.calculate_user_submission_hash(submitter, counter) Conference.calculate_user_submission_hash(submitter, counter)
end end
@ -461,13 +461,13 @@ class Conference < ActiveRecord::Base
# ====Returns # ====Returns
# * +ActiveRecord+ # * +ActiveRecord+
def self.get_active_conferences_for_dashboard def self.get_active_conferences_for_dashboard
result = Conference.where('start_date > ?', Time.now). result = Conference.where('start_date > ?', Time.now)
select('id, short_title, color, start_date') .select('id, short_title, color, start_date')
if result.empty? if result.empty?
result = Conference. result = Conference
select('id, short_title, color, start_date').limit(2). .select('id, short_title, color, start_date').limit(2)
order(start_date: :desc) .order(start_date: :desc)
end end
result result
end end

View file

@ -286,8 +286,8 @@ class Event < ActiveRecord::Base
end end
def before_end_of_conference def before_end_of_conference
errors. errors
add(:created_at, "can't be after the conference end date!") if program.conference && program.conference.end_date && .add(:created_at, "can't be after the conference end date!") if program.conference && program.conference.end_date &&
(Date.today > program.conference.end_date) (Date.today > program.conference.end_date)
end end

View file

@ -10,15 +10,15 @@ class RegistrationPeriod < ActiveRecord::Base
private private
def before_end_of_conference def before_end_of_conference
errors. errors
add(:start_date, "can't be after the conference end date (#{conference.end_date})") if conference && conference.end_date && start_date && (start_date > conference.end_date) .add(:start_date, "can't be after the conference end date (#{conference.end_date})") if conference && conference.end_date && start_date && (start_date > conference.end_date)
errors. errors
add(:end_date, "can't be after the conference end date (#{conference.end_date})") if conference && conference.end_date && end_date && (end_date > conference.end_date) .add(:end_date, "can't be after the conference end date (#{conference.end_date})") if conference && conference.end_date && end_date && (end_date > conference.end_date)
end end
def start_date_before_end_date def start_date_before_end_date
errors. errors
add(:start_date, "can't be after the end date") if start_date && end_date && start_date > end_date .add(:start_date, "can't be after the end date") if start_date && end_date && start_date > end_date
end end
end end

View file

@ -56,8 +56,8 @@ describe Admin::ConferencesController do
short_title: nil) short_title: nil)
conference.reload conference.reload
expect(flash[:error]). expect(flash[:error])
to eq("Updating conference failed. Short title can't be blank.") .to eq("Updating conference failed. Short title can't be blank.")
expect(conference.title).to eq("#{conference.title}") expect(conference.title).to eq("#{conference.title}")
expect(conference.short_title).to eq("#{conference.short_title}") expect(conference.short_title).to eq("#{conference.short_title}")
end end
@ -67,8 +67,8 @@ describe Admin::ConferencesController do
attributes_for(:conference, title: 'Example Con', attributes_for(:conference, title: 'Example Con',
short_title: nil) short_title: nil)
expect(flash[:error]). expect(flash[:error])
to eq("Updating conference failed. Short title can't be blank.") .to eq("Updating conference failed. Short title can't be blank.")
expect(response).to redirect_to edit_admin_conference_path( expect(response).to redirect_to edit_admin_conference_path(
conference.short_title) conference.short_title)
end end

View file

@ -42,8 +42,8 @@ describe Admin::UsersController do
end end
it 'changes @users attributes' do it 'changes @users attributes' do
expect(build( expect(build(
:user, email: 'email_new@osem.io', id: user.id).email). :user, email: 'email_new@osem.io', id: user.id).email)
to eq('email_new@osem.io') .to eq('email_new@osem.io')
end end
it 'redirects to the updated user' do it 'redirects to the updated user' do
expect(response).to redirect_to admin_users_path expect(response).to redirect_to admin_users_path

View file

@ -16,8 +16,8 @@ feature Conference do
click_button 'Create Cfp' click_button 'Create Cfp'
expect(flash). 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.") "Start date can't be blank. End date can't be blank.")
today = Date.today - 1 today = Date.today - 1
@ -29,8 +29,8 @@ feature Conference do
click_button 'Create Cfp' click_button 'Create Cfp'
# Validations # Validations
expect(flash). expect(flash)
to eq('Call for papers successfully created.') .to eq('Call for papers successfully created.')
expect(find('#start_date').text).to eq(today.strftime('%A, %B %-d. %Y')) expect(find('#start_date').text).to eq(today.strftime('%A, %B %-d. %Y'))
expect(find('#end_date').text).to eq((today + 6).strftime('%A, %B %-d. %Y')) expect(find('#end_date').text).to eq((today + 6).strftime('%A, %B %-d. %Y'))
@ -49,8 +49,8 @@ feature Conference do
page.execute_script( page.execute_script(
"$('#registration-period-start-datepicker').val('')") "$('#registration-period-start-datepicker').val('')")
click_button 'Update Cfp' click_button 'Update Cfp'
expect(flash). expect(flash)
to eq('Updating call for papers failed. ' + .to eq('Updating call for papers failed. ' +
"Start date can't be blank.") "Start date can't be blank.")
# Fill in date # Fill in date
@ -63,8 +63,8 @@ feature Conference do
click_button 'Update Cfp' click_button 'Update Cfp'
# Validations # Validations
expect(flash). expect(flash)
to eq('Call for papers successfully updated.') .to eq('Call for papers successfully updated.')
expect(find('#start_date').text).to eq(today.strftime('%A, %B %-d. %Y')) expect(find('#start_date').text).to eq(today.strftime('%A, %B %-d. %Y'))
expect(find('#end_date').text).to eq((today + 14).strftime('%A, %B %-d. %Y')) expect(find('#end_date').text).to eq((today + 14).strftime('%A, %B %-d. %Y'))
expect(Cfp.count).to eq(expected_count) expect(Cfp.count).to eq(expected_count)

View file

@ -15,17 +15,17 @@ feature Conference do
select('(GMT+01:00) Berlin', from: 'conference[timezone]') select('(GMT+01:00) Berlin', from: 'conference[timezone]')
today = Date.today - 1 today = Date.today - 1
page. page
execute_script("$('#conference-start-datepicker').val('" + .execute_script("$('#conference-start-datepicker').val('" +
"#{today.strftime('%d/%m/%Y')}')") "#{today.strftime('%d/%m/%Y')}')")
page. page
execute_script("$('#conference-end-datepicker').val('" + .execute_script("$('#conference-end-datepicker').val('" +
"#{(today + 7).strftime('%d/%m/%Y')}')") "#{(today + 7).strftime('%d/%m/%Y')}')")
click_button 'Create Conference' click_button 'Create Conference'
expect(flash). expect(flash)
to eq('Conference was successfully created.') .to eq('Conference was successfully created.')
expect(Conference.count).to eq(expected_count) expect(Conference.count).to eq(expected_count)
expect(user.has_role? :organizer, Conference.last).to eq(true) expect(user.has_role? :organizer, Conference.last).to eq(true)
@ -45,23 +45,23 @@ feature Conference do
fill_in 'conference_short_title', with: '' fill_in 'conference_short_title', with: ''
click_button 'Update Conference' click_button 'Update Conference'
expect(flash). 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_title', with: 'New Con'
fill_in 'conference_short_title', with: 'NewCon' fill_in 'conference_short_title', with: 'NewCon'
day = Date.today + 10 day = Date.today + 10
page. page
execute_script("$('#conference-start-datepicker').val('" + .execute_script("$('#conference-start-datepicker').val('" +
"#{day.strftime('%d/%m/%Y')}')") "#{day.strftime('%d/%m/%Y')}')")
page. page
execute_script("$('#conference-end-datepicker').val('" + .execute_script("$('#conference-end-datepicker').val('" +
"#{(day + 7).strftime('%d/%m/%Y')}')") "#{(day + 7).strftime('%d/%m/%Y')}')")
click_button 'Update Conference' click_button 'Update Conference'
expect(flash). expect(flash)
to eq('Conference was successfully updated.') .to eq('Conference was successfully updated.')
conference.reload conference.reload
expect(conference.title).to eq('New Con') expect(conference.title).to eq('New Con')

View file

@ -25,8 +25,8 @@ feature Contact do
click_button 'Update Contact' click_button 'Update Contact'
expect(flash). expect(flash)
to eq('Contact details were successfully updated.') .to eq('Contact details were successfully updated.')
contact.reload contact.reload
expect(contact.email).to eq('example@example.com') expect(contact.email).to eq('example@example.com')
expect(contact.sponsor_email).to eq('sponsor@example.com') expect(contact.sponsor_email).to eq('sponsor@example.com')

View file

@ -53,39 +53,39 @@ feature EmailSettings do
click_button 'Update Email settings' click_button 'Update Email settings'
expect(flash). expect(flash)
to eq('Email settings have been successfully updated.') .to eq('Email settings have been successfully updated.')
expect(find('#email_settings_registration_subject'). expect(find('#email_settings_registration_subject')
value).to eq('Registration subject') .value).to eq('Registration subject')
expect(find('#email_settings_registration_body'). expect(find('#email_settings_registration_body')
value).to eq('Registration email body') .value).to eq('Registration email body')
click_link 'Proposal' click_link 'Proposal'
expect(find('#email_settings_accepted_subject'). expect(find('#email_settings_accepted_subject')
value).to eq('Accepted subject') .value).to eq('Accepted subject')
expect(find('#email_settings_accepted_body'). expect(find('#email_settings_accepted_body')
value).to eq('Accepted email body') .value).to eq('Accepted email body')
expect(find('#email_settings_rejected_subject'). expect(find('#email_settings_rejected_subject')
value).to eq('Rejected subject') .value).to eq('Rejected subject')
expect(find('#email_settings_rejected_body'). expect(find('#email_settings_rejected_body')
value).to eq('Rejected email body') .value).to eq('Rejected email body')
expect(find('#email_settings_confirmed_without_registration_subject'). expect(find('#email_settings_confirmed_without_registration_subject')
value).to eq('Confirmed without registration subject') .value).to eq('Confirmed without registration subject')
expect(find('#email_settings_confirmed_without_registration_body'). expect(find('#email_settings_confirmed_without_registration_body')
value).to eq('Confirmed without registration email body') .value).to eq('Confirmed without registration email body')
click_link 'Update Notifications' click_link 'Update Notifications'
expect(find('#email_settings_conference_dates_updated_subject'). expect(find('#email_settings_conference_dates_updated_subject')
value).to eq('Updated conference dates subject') .value).to eq('Updated conference dates subject')
expect(find('#email_settings_conference_dates_updated_body'). expect(find('#email_settings_conference_dates_updated_body')
value).to eq('Updated conference dates email template') .value).to eq('Updated conference dates email template')
expect(find('#email_settings_conference_registration_dates_updated_subject'). expect(find('#email_settings_conference_registration_dates_updated_subject')
value).to eq('Updated conference registration dates subject') .value).to eq('Updated conference registration dates subject')
expect(find('#email_settings_conference_registration_dates_updated_body'). expect(find('#email_settings_conference_registration_dates_updated_body')
value).to eq('Updated conference registration dates template') .value).to eq('Updated conference registration dates template')
expect(find('#email_settings_venue_updated_subject'). expect(find('#email_settings_venue_updated_subject')
value).to eq('Updated conference venue subject') .value).to eq('Updated conference venue subject')
expect(find('#email_settings_venue_updated_body'). expect(find('#email_settings_venue_updated_body')
value).to eq('Updated conference venue template') .value).to eq('Updated conference venue template')
expect(EmailSettings.count).to eq(expected_count) expect(EmailSettings.count).to eq(expected_count)

View file

@ -22,8 +22,8 @@ feature Program do
click_button 'Update Program' click_button 'Update Program'
# Validations # Validations
expect(flash). expect(flash)
to eq('The program was successfully updated.') .to eq('The program was successfully updated.')
expect(find('#rating').text).to eq('4') expect(find('#rating').text).to eq('4')
end end
end end

View file

@ -131,8 +131,8 @@ feature Event do
expect(page.has_content?('Example Proposal')).to be true expect(page.has_content?('Example Proposal')).to be true
expect(@event.state).to eq('unconfirmed') expect(@event.state).to eq('unconfirmed')
click_link "confirm_proposal_#{@event.id}" click_link "confirm_proposal_#{@event.id}"
expect(flash). expect(flash)
to eq('The proposal was confirmed. Please register to attend the conference.') .to eq('The proposal was confirmed. Please register to attend the conference.')
expect(current_path).to eq(new_conference_conference_registration_path(conference.short_title)) expect(current_path).to eq(new_conference_conference_registration_path(conference.short_title))
@event.reload @event.reload
expect(@event.state).to eq('confirmed') expect(@event.state).to eq('confirmed')

View file

@ -16,15 +16,15 @@ feature RegistrationPeriod do
click_link 'New Registration Period' click_link 'New Registration Period'
click_button 'Save Registration Period' click_button 'Save Registration Period'
expect(flash). 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.") "Start date can't be blank. End date can't be blank.")
page. page
execute_script("$('#registration-period-start-datepicker').val('" + .execute_script("$('#registration-period-start-datepicker').val('" +
"#{Date.today.strftime('%d/%m/%Y')}')") "#{Date.today.strftime('%d/%m/%Y')}')")
page. page
execute_script("$('#registration-period-end-datepicker').val('" + .execute_script("$('#registration-period-end-datepicker').val('" +
"#{(Date.today + 5).strftime('%d/%m/%Y')}')") "#{(Date.today + 5).strftime('%d/%m/%Y')}')")
click_button 'Save Registration Period' click_button 'Save Registration Period'

View file

@ -24,8 +24,8 @@ feature Conference do
with: 'Lorem ipsum dolor sit amet, consetetur' \ with: 'Lorem ipsum dolor sit amet, consetetur' \
'sadipscing elitr, sed diam nonumy eirmod tempor' 'sadipscing elitr, sed diam nonumy eirmod tempor'
click_button 'Create Venue' click_button 'Create Venue'
expect(flash). expect(flash)
to eq('Venue was successfully created.') .to eq('Venue was successfully created.')
venue = Conference.find(conference.id).venue venue = Conference.find(conference.id).venue
expect(venue.name).to eq('Example University') expect(venue.name).to eq('Example University')
expect(venue.street).to eq('Example Street 42') expect(venue.street).to eq('Example Street 42')
@ -35,14 +35,14 @@ feature Conference do
# edit the venue # edit the venue
click_link 'Edit Venue' click_link 'Edit Venue'
expect(page.find("//*[@id='venue_submit_action']"). expect(page.find("//*[@id='venue_submit_action']")
text).to eq('Update Venue') .text).to eq('Update Venue')
fill_in 'venue_name', with: 'Example University new' fill_in 'venue_name', with: 'Example University new'
fill_in 'venue_website', with: 'www.example.com new' fill_in 'venue_website', with: 'www.example.com new'
fill_in 'venue_description', with: 'new' fill_in 'venue_description', with: 'new'
click_button 'Update Venue' click_button 'Update Venue'
expect(flash). expect(flash)
to eq('Venue was successfully updated.') .to eq('Venue was successfully updated.')
venue.reload venue.reload
expect(venue.name).to eq('Example University new') expect(venue.name).to eq('Example University new')
expect(venue.website).to eq('www.example.com new') expect(venue.website).to eq('www.example.com new')

View file

@ -27,8 +27,8 @@ feature Conference do
# find('div.nested-fields:nth-of-type(1) div:nth-of-type(1) textarea'). # find('div.nested-fields:nth-of-type(1) div:nth-of-type(1) textarea').
# set('Example Person') # set('Example Person')
click_button 'Update Conference' click_button 'Update Conference'
expect(flash). expect(flash)
to eq('Volunteering options were successfully updated.') .to eq('Volunteering options were successfully updated.')
# # Validations # # Validations
# expect(find('div.nested-fields:nth-of-type(1) select:nth-of-type(1)'). # expect(find('div.nested-fields:nth-of-type(1) select:nth-of-type(1)').
@ -73,8 +73,8 @@ feature Conference do
# find('div.nested-fields:nth-of-type(1) div:nth-of-type(1) textarea'). # find('div.nested-fields:nth-of-type(1) div:nth-of-type(1) textarea').
# set('Example Person') # set('Example Person')
click_button 'Update Conference' click_button 'Update Conference'
expect(flash). expect(flash)
to eq('Volunteering options were successfully updated.') .to eq('Volunteering options were successfully updated.')
# Add vposition # Add vposition
check('Use vpositions') check('Use vpositions')
@ -90,8 +90,8 @@ feature Conference do
# "[id$='_vday_ids']"). # "[id$='_vday_ids']").
# find(:option, "#{Date.today.strftime}").select_option # find(:option, "#{Date.today.strftime}").select_option
click_button 'Update Conference' click_button 'Update Conference'
expect(flash). expect(flash)
to eq('Volunteering options were successfully updated.') .to eq('Volunteering options were successfully updated.')
# Validations # Validations
# expect(find('div.vpositions div.nested-fields:nth-of-type(1)'\ # expect(find('div.vpositions div.nested-fields:nth-of-type(1)'\

View file

@ -50,11 +50,11 @@ describe ApplicationHelper, type: :helper do
end end
it 'should return HTML for header markdown' do it 'should return HTML for header markdown' do
expect(Redcarpet::Markdown).to receive(:new). expect(Redcarpet::Markdown).to receive(:new)
with(Redcarpet::Render::HTML, autolink: true, .with(Redcarpet::Render::HTML, autolink: true,
space_after_headers: true, space_after_headers: true,
no_intra_emphasis: true). no_intra_emphasis: true)
and_call_original .and_call_original
expect(markdown('# this is my header')).to eq "<h1>this is my header</h1>\n" expect(markdown('# this is my header')).to eq "<h1>this is my header</h1>\n"
end end

View file

@ -743,8 +743,8 @@ describe Conference do
c = create(:conference, start_date: Time.now - 1.year, end_date: Time.now - 360.days) c = create(:conference, start_date: Time.now - 1.year, end_date: Time.now - 360.days)
result = [a, b, c] result = [a, b, c]
expect(Conference.get_conferences_without_active_for_dashboard([subject])). expect(Conference.get_conferences_without_active_for_dashboard([subject]))
to match_array(result) .to match_array(result)
end end
it 'returns all conferences if there are no active conferences' do it 'returns all conferences if there are no active conferences' do

View file

@ -24,6 +24,6 @@ def mock_commercial_request
author_url: 'https://www.youtube.com/user/Confreaks', author_url: 'https://www.youtube.com/user/Confreaks',
height: 344 height: 344
} }
WebMock.stub_request(:get, /.*youtube.*/). WebMock.stub_request(:get, /.*youtube.*/)
to_return(status: 200, body: response.to_json, headers: {}) .to_return(status: 200, body: response.to_json, headers: {})
end end