From 03fa299058b9c292308c0356badf06f14a813909 Mon Sep 17 00:00:00 2001 From: Sunny Date: Thu, 6 Apr 2017 23:19:58 -0400 Subject: [PATCH] enable style/dotposition rubocop cop --- .rubocop.yml | 4 ++ .rubocop_todo.yml | 7 --- .../admin/conferences_controller.rb | 12 ++-- app/controllers/admin/reports_controller.rb | 8 +-- .../conference_registrations_controller.rb | 4 +- app/controllers/registrations_controller.rb | 8 +-- app/helpers/application_helper.rb | 8 +-- app/models/cfp.rb | 16 +++-- app/models/conference.rb | 20 +++---- app/models/event.rb | 4 +- app/models/registration_period.rb | 12 ++-- .../admin/conferences_controller_spec.rb | 8 +-- .../admin/users_controller_spec.rb | 4 +- spec/features/cfp_spec.rb | 16 ++--- spec/features/conference_spec.rb | 28 ++++----- spec/features/contact_spec.rb | 4 +- spec/features/email_spec.rb | 60 +++++++++---------- spec/features/program_spec.rb | 4 +- spec/features/proposals_spec.rb | 4 +- spec/features/registration_periods_spec.rb | 12 ++-- spec/features/venues_spec.rb | 12 ++-- spec/features/volunteers_spec.rb | 12 ++-- spec/helpers/application_helper_spec.rb | 10 ++-- spec/models/conference_spec.rb | 4 +- spec/support/external_request.rb | 4 +- 25 files changed, 143 insertions(+), 142 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index e9475b21..f86cca4c 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -39,6 +39,10 @@ Style/CaseEquality: Style/ClassAndModuleChildren: 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. Style/DoubleNegation: Enabled: true diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index d6a99f84..022f6c1b 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -239,13 +239,6 @@ Style/ConditionalAssignment: Style/Documentation: Enabled: false -# Offense count: 74 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. -# SupportedStyles: leading, trailing -Style/DotPosition: - Enabled: false - # Offense count: 1 # Cop supports --auto-correct. Style/ElseAlignment: diff --git a/app/controllers/admin/conferences_controller.rb b/app/controllers/admin/conferences_controller.rb index 84f92838..66709617 100644 --- a/app/controllers/admin/conferences_controller.rb +++ b/app/controllers/admin/conferences_controller.rb @@ -21,8 +21,8 @@ module Admin @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 - @deactive_conferences = Conference. - get_conferences_without_active_for_dashboard(@active_conferences) # conferences without active + @deactive_conferences = Conference + .get_conferences_without_active_for_dashboard(@active_conferences) # conferences without active @conferences = @active_conferences + @deactive_conferences @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 @total_submissions = @program.events.count - @new_submissions = @program.events. - where('created_at > ?', current_user.last_sign_in_at).count + @new_submissions = @program.events + .where('created_at > ?', current_user.last_sign_in_at).count @program_length = @conference.current_program_hours @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) @difficulty_levels_distribution = @conference.difficulty_levels_distribution - @difficulty_levels_distribution_confirmed = @conference. - difficulty_levels_distribution(:confirmed) + @difficulty_levels_distribution_confirmed = @conference + .difficulty_levels_distribution(:confirmed) @tracks_distribution = @conference.tracks_distribution @tracks_distribution_confirmed = @conference.tracks_distribution(:confirmed) diff --git a/app/controllers/admin/reports_controller.rb b/app/controllers/admin/reports_controller.rb index 2075243e..c6d4003c 100644 --- a/app/controllers/admin/reports_controller.rb +++ b/app/controllers/admin/reports_controller.rb @@ -10,10 +10,10 @@ module Admin @events_with_requirements = @events.where.not(description: ['', nil]) attended_registrants_ids = @conference.registrations.where(attended: true).pluck(:user_id) - @missing_event_speakers = EventUser.joins(:event). - where('event_role = ? and program_id = ?', 'submitter', @program.id). - where.not(user_id: attended_registrants_ids). - includes(:user, :event) + @missing_event_speakers = EventUser.joins(:event) + .where('event_role = ? and program_id = ?', 'submitter', @program.id) + .where.not(user_id: attended_registrants_ids) + .includes(:user, :event) end end end diff --git a/app/controllers/conference_registrations_controller.rb b/app/controllers/conference_registrations_controller.rb index ea02202e..c6073b32 100644 --- a/app/controllers/conference_registrations_controller.rb +++ b/app/controllers/conference_registrations_controller.rb @@ -108,8 +108,8 @@ class ConferenceRegistrationsController < ApplicationController end def registration_params - params.require(:registration). - permit( + params.require(:registration) + .permit( :conference_id, :arrival, :departure, :volunteer, vchoice_ids: [], qanswer_ids: [], diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb index 7bc3fca3..e141084c 100644 --- a/app/controllers/registrations_controller.rb +++ b/app/controllers/registrations_controller.rb @@ -23,12 +23,12 @@ class RegistrationsController < Devise::RegistrationsController def configure_permitted_parameters devise_parameter_sanitizer.permit(:account_update) do |u| - u. - permit(:email, :password, :password_confirmation, :current_password, :username, :email_public) + u + .permit(:email, :password, :password_confirmation, :current_password, :username, :email_public) end devise_parameter_sanitizer.permit(:sign_up) do |u| - u. - permit(:email, :password, :password_confirmation, :name, :username) + u + .permit(:email, :password, :password_confirmation, :name, :username) end end end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 2c5e4ebe..d6025dd4 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -412,10 +412,10 @@ module ApplicationHelper # Eg: If version.changeset = '{"title"=>[nil, "Premium"], "description"=>[nil, "Premium = Super cool"], "conference_id"=>[nil, 3]}' # Output will be 'title, description and conference' def updated_attributes(version) - version.changeset. - reject{ |_, values| values[0].blank? && values[1].blank? }. - keys.map{ |key| key.gsub('_id', '').tr('_', ' ')}.join(', '). - reverse.sub(',', ' dna ').reverse + version.changeset + .reject{ |_, values| values[0].blank? && values[1].blank? } + .keys.map{ |key| key.gsub('_id', '').tr('_', ' ')}.join(', ') + .reverse.sub(',', ' dna ').reverse end def link_to_user(user_id) diff --git a/app/models/cfp.rb b/app/models/cfp.rb index 827d0f1c..affcc408 100644 --- a/app/models/cfp.rb +++ b/app/models/cfp.rb @@ -58,16 +58,20 @@ class Cfp < ActiveRecord::Base private def before_end_of_conference - errors. - 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) + 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. - 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) + 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 def start_after_end_date - errors. - add(:start_date, "can't be after the end date") if start_date && end_date && start_date > end_date + errors + .add(:start_date, "can't be after the end date") if start_date && end_date && start_date > end_date end def conference_id diff --git a/app/models/conference.rb b/app/models/conference.rb index 1d549ec7..0786b9ae 100644 --- a/app/models/conference.rb +++ b/app/models/conference.rb @@ -180,8 +180,8 @@ class Conference < ActiveRecord::Base if registration_period && registration_period.start_date && registration_period.end_date - weeks = Date.new(registration_period.start_date.year, 12, 31). - strftime('%W').to_i + weeks = Date.new(registration_period.start_date.year, 12, 31) + .strftime('%W').to_i result = get_registration_end_week - get_registration_start_week + 1 end @@ -277,9 +277,9 @@ class Conference < ActiveRecord::Base # ====Returns # * +hash+ -> user: submissions def get_top_submitter(limit = 5) - submitter = EventUser.joins(:event). - where('event_role = ? and program_id = ?', 'submitter', Conference.find(id).program.id). - limit(limit).group(:user_id) + submitter = EventUser.joins(:event) + .where('event_role = ? and program_id = ?', 'submitter', Conference.find(id).program.id) + .limit(limit).group(:user_id) counter = submitter.order('count_all desc').count Conference.calculate_user_submission_hash(submitter, counter) end @@ -461,13 +461,13 @@ class Conference < ActiveRecord::Base # ====Returns # * +ActiveRecord+ def self.get_active_conferences_for_dashboard - result = Conference.where('start_date > ?', Time.now). - select('id, short_title, color, start_date') + result = Conference.where('start_date > ?', Time.now) + .select('id, short_title, color, start_date') if result.empty? - result = Conference. - select('id, short_title, color, start_date').limit(2). - order(start_date: :desc) + result = Conference + .select('id, short_title, color, start_date').limit(2) + .order(start_date: :desc) end result end diff --git a/app/models/event.rb b/app/models/event.rb index e138d9d9..27fc1ad9 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -286,8 +286,8 @@ class Event < ActiveRecord::Base end def before_end_of_conference - errors. - add(:created_at, "can't be after the conference end date!") if program.conference && program.conference.end_date && + errors + .add(:created_at, "can't be after the conference end date!") if program.conference && program.conference.end_date && (Date.today > program.conference.end_date) end diff --git a/app/models/registration_period.rb b/app/models/registration_period.rb index a7c251ac..fb9e6225 100644 --- a/app/models/registration_period.rb +++ b/app/models/registration_period.rb @@ -10,15 +10,15 @@ class RegistrationPeriod < ActiveRecord::Base private def before_end_of_conference - 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) + 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) - 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) + 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) end def start_date_before_end_date - errors. - add(:start_date, "can't be after the end date") if start_date && end_date && start_date > end_date + errors + .add(:start_date, "can't be after the end date") if start_date && end_date && start_date > end_date end end diff --git a/spec/controllers/admin/conferences_controller_spec.rb b/spec/controllers/admin/conferences_controller_spec.rb index eac4c68c..3964996f 100644 --- a/spec/controllers/admin/conferences_controller_spec.rb +++ b/spec/controllers/admin/conferences_controller_spec.rb @@ -56,8 +56,8 @@ describe Admin::ConferencesController do short_title: nil) conference.reload - expect(flash[:error]). - to eq("Updating conference failed. Short title can't be blank.") + expect(flash[:error]) + .to eq("Updating conference failed. Short title can't be blank.") expect(conference.title).to eq("#{conference.title}") expect(conference.short_title).to eq("#{conference.short_title}") end @@ -67,8 +67,8 @@ describe Admin::ConferencesController do attributes_for(:conference, title: 'Example Con', short_title: nil) - expect(flash[:error]). - to eq("Updating conference failed. Short title can't be blank.") + expect(flash[:error]) + .to eq("Updating conference failed. Short title can't be blank.") expect(response).to redirect_to edit_admin_conference_path( conference.short_title) end diff --git a/spec/controllers/admin/users_controller_spec.rb b/spec/controllers/admin/users_controller_spec.rb index be9e4cef..6114f6ed 100644 --- a/spec/controllers/admin/users_controller_spec.rb +++ b/spec/controllers/admin/users_controller_spec.rb @@ -42,8 +42,8 @@ describe Admin::UsersController do end it 'changes @users attributes' do expect(build( - :user, email: 'email_new@osem.io', id: user.id).email). - to eq('email_new@osem.io') + :user, email: 'email_new@osem.io', id: user.id).email) + .to eq('email_new@osem.io') end it 'redirects to the updated user' do expect(response).to redirect_to admin_users_path diff --git a/spec/features/cfp_spec.rb b/spec/features/cfp_spec.rb index b7ee2a01..8869de1f 100644 --- a/spec/features/cfp_spec.rb +++ b/spec/features/cfp_spec.rb @@ -16,8 +16,8 @@ feature Conference do click_button 'Create Cfp' - expect(flash). - to eq('Creating the call for papers failed. ' + + expect(flash) + .to eq('Creating the call for papers failed. ' + "Start date can't be blank. End date can't be blank.") today = Date.today - 1 @@ -29,8 +29,8 @@ feature Conference do click_button 'Create Cfp' # Validations - expect(flash). - to eq('Call for papers successfully created.') + expect(flash) + .to eq('Call for papers successfully created.') 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')) @@ -49,8 +49,8 @@ feature Conference do page.execute_script( "$('#registration-period-start-datepicker').val('')") click_button 'Update Cfp' - expect(flash). - to eq('Updating call for papers failed. ' + + expect(flash) + .to eq('Updating call for papers failed. ' + "Start date can't be blank.") # Fill in date @@ -63,8 +63,8 @@ feature Conference do click_button 'Update Cfp' # Validations - expect(flash). - to eq('Call for papers successfully updated.') + expect(flash) + .to eq('Call for papers successfully updated.') 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(Cfp.count).to eq(expected_count) diff --git a/spec/features/conference_spec.rb b/spec/features/conference_spec.rb index f6ced652..d17ce5fc 100644 --- a/spec/features/conference_spec.rb +++ b/spec/features/conference_spec.rb @@ -15,17 +15,17 @@ feature Conference do select('(GMT+01:00) Berlin', from: 'conference[timezone]') today = Date.today - 1 - page. - execute_script("$('#conference-start-datepicker').val('" + + page + .execute_script("$('#conference-start-datepicker').val('" + "#{today.strftime('%d/%m/%Y')}')") - page. - execute_script("$('#conference-end-datepicker').val('" + + page + .execute_script("$('#conference-end-datepicker').val('" + "#{(today + 7).strftime('%d/%m/%Y')}')") click_button 'Create Conference' - expect(flash). - to eq('Conference was successfully created.') + expect(flash) + .to eq('Conference was successfully created.') expect(Conference.count).to eq(expected_count) expect(user.has_role? :organizer, Conference.last).to eq(true) @@ -45,23 +45,23 @@ feature Conference do fill_in 'conference_short_title', with: '' click_button 'Update Conference' - expect(flash). - to eq("Updating conference failed. Short title can't be blank.") + expect(flash) + .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 = Date.today + 10 - page. - execute_script("$('#conference-start-datepicker').val('" + + page + .execute_script("$('#conference-start-datepicker').val('" + "#{day.strftime('%d/%m/%Y')}')") - page. - execute_script("$('#conference-end-datepicker').val('" + + page + .execute_script("$('#conference-end-datepicker').val('" + "#{(day + 7).strftime('%d/%m/%Y')}')") click_button 'Update Conference' - expect(flash). - to eq('Conference was successfully updated.') + expect(flash) + .to eq('Conference was successfully updated.') conference.reload expect(conference.title).to eq('New Con') diff --git a/spec/features/contact_spec.rb b/spec/features/contact_spec.rb index aa9fcf57..513f3cab 100644 --- a/spec/features/contact_spec.rb +++ b/spec/features/contact_spec.rb @@ -25,8 +25,8 @@ feature Contact do click_button 'Update Contact' - expect(flash). - to eq('Contact details were successfully updated.') + expect(flash) + .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') diff --git a/spec/features/email_spec.rb b/spec/features/email_spec.rb index cdc6cdfe..c1bfef5d 100644 --- a/spec/features/email_spec.rb +++ b/spec/features/email_spec.rb @@ -53,39 +53,39 @@ feature EmailSettings do click_button 'Update Email settings' - expect(flash). - to eq('Email settings have been successfully updated.') + expect(flash) + .to eq('Email settings have been successfully updated.') - expect(find('#email_settings_registration_subject'). - value).to eq('Registration subject') - expect(find('#email_settings_registration_body'). - value).to eq('Registration email body') + expect(find('#email_settings_registration_subject') + .value).to eq('Registration subject') + expect(find('#email_settings_registration_body') + .value).to eq('Registration email body') click_link 'Proposal' - expect(find('#email_settings_accepted_subject'). - value).to eq('Accepted subject') - expect(find('#email_settings_accepted_body'). - value).to eq('Accepted email body') - expect(find('#email_settings_rejected_subject'). - value).to eq('Rejected subject') - expect(find('#email_settings_rejected_body'). - value).to eq('Rejected email body') - expect(find('#email_settings_confirmed_without_registration_subject'). - value).to eq('Confirmed without registration subject') - expect(find('#email_settings_confirmed_without_registration_body'). - value).to eq('Confirmed without registration email body') + expect(find('#email_settings_accepted_subject') + .value).to eq('Accepted subject') + expect(find('#email_settings_accepted_body') + .value).to eq('Accepted email body') + expect(find('#email_settings_rejected_subject') + .value).to eq('Rejected subject') + expect(find('#email_settings_rejected_body') + .value).to eq('Rejected email body') + expect(find('#email_settings_confirmed_without_registration_subject') + .value).to eq('Confirmed without registration subject') + expect(find('#email_settings_confirmed_without_registration_body') + .value).to eq('Confirmed without registration email body') click_link 'Update Notifications' - expect(find('#email_settings_conference_dates_updated_subject'). - value).to eq('Updated conference dates subject') - expect(find('#email_settings_conference_dates_updated_body'). - value).to eq('Updated conference dates email template') - expect(find('#email_settings_conference_registration_dates_updated_subject'). - value).to eq('Updated conference registration dates subject') - expect(find('#email_settings_conference_registration_dates_updated_body'). - value).to eq('Updated conference registration dates template') - expect(find('#email_settings_venue_updated_subject'). - value).to eq('Updated conference venue subject') - expect(find('#email_settings_venue_updated_body'). - value).to eq('Updated conference venue template') + expect(find('#email_settings_conference_dates_updated_subject') + .value).to eq('Updated conference dates subject') + expect(find('#email_settings_conference_dates_updated_body') + .value).to eq('Updated conference dates email template') + expect(find('#email_settings_conference_registration_dates_updated_subject') + .value).to eq('Updated conference registration dates subject') + expect(find('#email_settings_conference_registration_dates_updated_body') + .value).to eq('Updated conference registration dates template') + expect(find('#email_settings_venue_updated_subject') + .value).to eq('Updated conference venue subject') + expect(find('#email_settings_venue_updated_body') + .value).to eq('Updated conference venue template') expect(EmailSettings.count).to eq(expected_count) diff --git a/spec/features/program_spec.rb b/spec/features/program_spec.rb index ae4a3e64..369a0525 100644 --- a/spec/features/program_spec.rb +++ b/spec/features/program_spec.rb @@ -22,8 +22,8 @@ feature Program do click_button 'Update Program' # Validations - expect(flash). - to eq('The program was successfully updated.') + expect(flash) + .to eq('The program was successfully updated.') expect(find('#rating').text).to eq('4') end end diff --git a/spec/features/proposals_spec.rb b/spec/features/proposals_spec.rb index 4c6d6dfe..b5620475 100644 --- a/spec/features/proposals_spec.rb +++ b/spec/features/proposals_spec.rb @@ -131,8 +131,8 @@ feature Event do expect(page.has_content?('Example Proposal')).to be true expect(@event.state).to eq('unconfirmed') click_link "confirm_proposal_#{@event.id}" - expect(flash). - to eq('The proposal was confirmed. Please register to attend the conference.') + expect(flash) + .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)) @event.reload expect(@event.state).to eq('confirmed') diff --git a/spec/features/registration_periods_spec.rb b/spec/features/registration_periods_spec.rb index 4284c92e..c6cc992e 100644 --- a/spec/features/registration_periods_spec.rb +++ b/spec/features/registration_periods_spec.rb @@ -16,15 +16,15 @@ feature RegistrationPeriod do click_link 'New Registration Period' click_button 'Save Registration Period' - expect(flash). - to eq('An error prohibited the Registration Period from being saved: ' \ + expect(flash) + .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('" + + page + .execute_script("$('#registration-period-start-datepicker').val('" + "#{Date.today.strftime('%d/%m/%Y')}')") - page. - execute_script("$('#registration-period-end-datepicker').val('" + + page + .execute_script("$('#registration-period-end-datepicker').val('" + "#{(Date.today + 5).strftime('%d/%m/%Y')}')") click_button 'Save Registration Period' diff --git a/spec/features/venues_spec.rb b/spec/features/venues_spec.rb index 298f9391..2931b6e8 100644 --- a/spec/features/venues_spec.rb +++ b/spec/features/venues_spec.rb @@ -24,8 +24,8 @@ feature Conference do with: 'Lorem ipsum dolor sit amet, consetetur' \ 'sadipscing elitr, sed diam nonumy eirmod tempor' click_button 'Create Venue' - expect(flash). - to eq('Venue was successfully created.') + expect(flash) + .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') @@ -35,14 +35,14 @@ feature Conference do # edit the venue click_link 'Edit Venue' - expect(page.find("//*[@id='venue_submit_action']"). - text).to eq('Update Venue') + expect(page.find("//*[@id='venue_submit_action']") + .text).to eq('Update Venue') fill_in 'venue_name', with: 'Example University new' fill_in 'venue_website', with: 'www.example.com new' fill_in 'venue_description', with: 'new' click_button 'Update Venue' - expect(flash). - to eq('Venue was successfully updated.') + expect(flash) + .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') diff --git a/spec/features/volunteers_spec.rb b/spec/features/volunteers_spec.rb index d3aa88cd..a27ba0b1 100644 --- a/spec/features/volunteers_spec.rb +++ b/spec/features/volunteers_spec.rb @@ -27,8 +27,8 @@ feature Conference do # 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.') + expect(flash) + .to eq('Volunteering options were successfully updated.') # # Validations # 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'). # set('Example Person') click_button 'Update Conference' - expect(flash). - to eq('Volunteering options were successfully updated.') + expect(flash) + .to eq('Volunteering options were successfully updated.') # Add vposition check('Use vpositions') @@ -90,8 +90,8 @@ feature Conference do # "[id$='_vday_ids']"). # find(:option, "#{Date.today.strftime}").select_option click_button 'Update Conference' - expect(flash). - to eq('Volunteering options were successfully updated.') + expect(flash) + .to eq('Volunteering options were successfully updated.') # Validations # expect(find('div.vpositions div.nested-fields:nth-of-type(1)'\ diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index e58f57fc..242f03e5 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -50,11 +50,11 @@ describe ApplicationHelper, type: :helper do end it 'should return HTML for header markdown' do - expect(Redcarpet::Markdown).to receive(:new). - with(Redcarpet::Render::HTML, autolink: true, - space_after_headers: true, - no_intra_emphasis: true). - and_call_original + expect(Redcarpet::Markdown).to receive(:new) + .with(Redcarpet::Render::HTML, autolink: true, + space_after_headers: true, + no_intra_emphasis: true) + .and_call_original expect(markdown('# this is my header')).to eq "

this is my header

\n" end diff --git a/spec/models/conference_spec.rb b/spec/models/conference_spec.rb index aa824319..edb719e5 100755 --- a/spec/models/conference_spec.rb +++ b/spec/models/conference_spec.rb @@ -743,8 +743,8 @@ describe Conference do c = create(:conference, start_date: Time.now - 1.year, end_date: Time.now - 360.days) result = [a, b, c] - expect(Conference.get_conferences_without_active_for_dashboard([subject])). - to match_array(result) + expect(Conference.get_conferences_without_active_for_dashboard([subject])) + .to match_array(result) end it 'returns all conferences if there are no active conferences' do diff --git a/spec/support/external_request.rb b/spec/support/external_request.rb index 645067aa..d09ebc0a 100644 --- a/spec/support/external_request.rb +++ b/spec/support/external_request.rb @@ -24,6 +24,6 @@ def mock_commercial_request author_url: 'https://www.youtube.com/user/Confreaks', height: 344 } - WebMock.stub_request(:get, /.*youtube.*/). - to_return(status: 200, body: response.to_json, headers: {}) + WebMock.stub_request(:get, /.*youtube.*/) + .to_return(status: 200, body: response.to_json, headers: {}) end