Merge pull request #1446 from sunny-b/master
Enable Style/DotPosition Rubocop cop
This commit is contained in:
commit
fd6d0bf39b
25 changed files with 143 additions and 142 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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')
|
||||
|
|
|
|||
|
|
@ -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')
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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')
|
||||
|
|
|
|||
|
|
@ -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'
|
||||
|
|
|
|||
|
|
@ -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')
|
||||
|
|
|
|||
|
|
@ -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)'\
|
||||
|
|
|
|||
|
|
@ -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 "<h1>this is my header</h1>\n"
|
||||
end
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue