Skip to content
This repository has been archived by the owner on Nov 18, 2020. It is now read-only.

Updating to Ruby 2.6.3 #1576

Merged
merged 2 commits into from
May 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2019-02-25 13:39:08 -0500 using RuboCop version 0.62.0.
# on 2019-05-07 14:00:27 -0400 using RuboCop version 0.62.0.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
Expand All @@ -17,17 +17,17 @@ Lint/UriEscapeUnescape:
- 'app/actors/sufia/create_with_remote_files_actor.rb'
- 'spec/features/authentication_spec.rb'

# Offense count: 224
# Offense count: 227
# Configuration parameters: CountComments, ExcludedMethods.
# ExcludedMethods: refine
Metrics/BlockLength:
Max: 222
Max: 231

# Offense count: 1
Metrics/CyclomaticComplexity:
Max: 7

# Offense count: 308
# Offense count: 307
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
# URISchemes: http, https
Metrics/LineLength:
Expand All @@ -37,11 +37,11 @@ Metrics/LineLength:
Metrics/PerceivedComplexity:
Max: 9

# Offense count: 47
# Offense count: 48
RSpec/AnyInstance:
Enabled: false

# Offense count: 137
# Offense count: 138
# Configuration parameters: Prefixes.
# Prefixes: when, with, without
RSpec/ContextWording:
Expand All @@ -66,13 +66,13 @@ RSpec/ExpectInHook:
- 'spec/features/file_set/analytics_spec.rb'
- 'spec/models/user_spec.rb'

# Offense count: 160
# Offense count: 166
# Configuration parameters: EnforcedStyle.
# SupportedStyles: have_received, receive
RSpec/MessageSpies:
Enabled: false

# Offense count: 291
# Offense count: 298
# Configuration parameters: AggregateFailuresByDefault.
RSpec/MultipleExpectations:
Max: 58
Expand Down Expand Up @@ -131,7 +131,7 @@ Rails/DynamicFindBy:
- 'app/services/permissions_change_service.rb'
- 'spec/views/curations_concerns/base/_form_relationships.html.erb_spec.rb'

# Offense count: 35
# Offense count: 36
# Configuration parameters: EnforcedStyle.
# SupportedStyles: slashes, arguments
Rails/FilePath:
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.3.3
2.6.3
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ cache:
bundler_args: --without development debug
sudo: false
rvm:
- 2.3.3
- 2.6.3
jdk:
- oraclejdk8
env:
Expand Down
11 changes: 11 additions & 0 deletions config/deploy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,17 @@
end
end

namespace :rbenv do
desc 'Overrides task in capistrano-rbenv-install to install the correct version of the bundler gem'
task install_bundler: ['rbenv:map_bins'] do
on roles fetch(:rbenv_roles) do
next if test :gem, :query, "--quiet --installed --name-matches ^bundler (#{Bundler::VERSION})$"

execute :gem, :install, :bundler, "--quiet --no-document --version #{Bundler::VERSION}"
end
end
end

namespace :deploy do
desc 'Verify yaml configuration files are present and contain the correct keys'
task :check_configs do
Expand Down
63 changes: 46 additions & 17 deletions spec/features/generic_work/upload_and_delete_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,32 @@

context 'cloud providers' do
before do
allow(BrowseEverything).to receive(:config) { { 'dropbox' => { app_key: 'fakekey189274942347', app_secret: 'fakesecret489289472347298', max_upload_file_size: 20 * 1024 } } }
allow(Sufia.config).to receive(:browse_everything).and_return('dropbox' => { app_key: 'fakekey189274942347', app_secret: 'fakesecret489289472347298' })
allow_any_instance_of(BrowseEverything::Driver::Dropbox).to receive(:authorized?).and_return(true)
allow_any_instance_of(BrowseEverything::Driver::Dropbox).to receive(:token).and_return('FakeDropboxAccessToken01234567890ABCDEF_AAAAAAA987654321')
allow(BrowseEverything).to receive(:config) do
{
'box' => {
client_id: 'fake-box-client-id',
client_secret: 'fake-box-client-secret',
max_upload_file_size: 25 * 1024
}
}
end

allow(Sufia.config).to receive(:browse_everything) .and_return(
'dropbox' => {
client_id: 'fake-box-client-id',
client_secret: 'fake-box-client-secret'
}
)

allow_any_instance_of(BrowseEverything::Driver::Box)
.to receive(:box_token)
.and_return('FAKEBOXTOKEN')

allow_any_instance_of(BrowseEverything::Driver::Box)
.to receive(:box_refresh_token)
.and_return('FAKEBOXREFRESHTOKEN')

allow_any_instance_of(BrowseEverything::Driver::Box).to receive(:authorized?).and_return(true)
allow_any_instance_of(GenericWork).to receive(:share_notified?).and_return(false)
WebMock.enable!
end
Expand All @@ -53,32 +75,39 @@

specify 'I can click on cloud providers' do
expect(ShareNotifyJob).to receive(:perform_later)
VCR.use_cassette('dropbox', record: :none) do
VCR.use_cassette('box', record: :none) do
click_link 'Files'
expect(page).to have_content 'Add cloud files'
click_on 'Add cloud files'
expect(page).to have_css '#provider-select'
select 'Dropbox', from: 'provider-select'

# Choose Box and view the files
select 'Box', from: 'provider-select'
sleep(1.second)
expect(page).to have_content 'Getting Started.pdf'
click_on('Writer')
expect(page).to have_content 'My Box Notes'
expect(page).to have_content 'Box-upload-test.boxnote'
expect(page).to have_content 'creators.m4v'

# Files above the size limit are not clickable
expect(page).not_to have_css 'a', text: 'creators.m4v'

# Upload file into the queue
click_on('Box-upload-test.boxnote')
sleep(1.second)
expect(page).to have_content 'Writer FAQ.txt'
expect(page).not_to have_css 'a', text: 'Writer FAQ.txt'
expect(page).to have_content 'Markdown Test.txt'
check('writer-markdown-test-txt')
expect(page).to have_content '1 file selected'
click_on('Submit')
within 'tr.template-download' do
expect(page).to have_content 'Markdown Test.txt'
expect(page).to have_content 'Box-upload-test.boxnote'
end
within('#savewidget') do
choose 'generic_work_visibility_authenticated'
end
sleep(1.second)

# Fill in the rest of the metadata and create the work
check 'agreement'
click_on 'Metadata'
fill_in 'generic_work_title', with: 'Markdown Test'
fill_in 'generic_work_title', with: 'Box Upload Test'
fill_in 'generic_work_keyword', with: 'keyword'
fill_in 'generic_work[creators][0][given_name]', with: 'creator'
select 'Attribution-NonCommercial-NoDerivatives 4.0 International', from: 'generic_work_rights'
Expand All @@ -88,11 +117,11 @@
click_on 'Save'
expect(page).to have_content 'Your files are being processed'
within('#activity_log') do
expect(page).to have_content("User #{current_user.display_name} has deposited Markdown Test")
expect(page).to have_content("User #{current_user.display_name} has deposited Box Upload Test")
end
expect(page).to have_css('h1', text: 'Markdown Test')
expect(page).to have_css('h1', text: 'Box Upload Test')
click_on 'Notifications'
expect(page).to have_content 'The file (Markdown Test.txt) was successfully imported'
expect(page).to have_content 'The file (Box-upload-test.boxnote) was successfully imported'
end
end
end
Expand Down
Loading