Skip to content
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
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ gem 'delayed_job_active_record'

gem 'cancancan', '~> 3.0'
gem 'cocoon'
gem 'devise', '~> 4.7', '>= 4.7.1'
gem 'devise', '~> 5.0'
gem 'highline'
gem 'paper_trail', '~> 16.0'
gem 'paper_trail-association_tracking'
Expand Down
56 changes: 30 additions & 26 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ GEM
execjs (~> 2)
avro (1.11.3)
multi_json (~> 1.0)
base64 (0.2.0)
base64 (0.3.0)
bcrypt (3.1.22)
benchmark (0.4.1)
bigdecimal (3.1.8)
benchmark (0.5.0)
bigdecimal (3.3.1)
bindex (0.8.1)
bio-vcf (0.9.5)
bootstrap-sass (3.4.1)
Expand Down Expand Up @@ -145,7 +145,7 @@ GEM
execjs
coffee-script-source (1.12.2)
concurrent-ruby (1.3.4)
connection_pool (2.5.3)
connection_pool (3.0.2)
crass (1.0.6)
csv (3.3.0)
daemons (1.4.1)
Expand All @@ -155,10 +155,10 @@ GEM
delayed_job_active_record (4.1.11)
activerecord (>= 3.0, < 9.0)
delayed_job (>= 3.0, < 5)
devise (4.9.4)
devise (5.0.3)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 4.1.0)
railties (>= 7.0)
responders
warden (~> 1.2.3)
devise_saml_authenticatable (1.9.1)
Expand All @@ -172,8 +172,8 @@ GEM
em-websocket (0.5.3)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0)
erb (5.0.2)
erubi (1.13.0)
erb (6.0.2)
erubi (1.13.1)
eventmachine (1.2.7)
execjs (2.10.0)
ffi (1.17.0)
Expand Down Expand Up @@ -217,11 +217,12 @@ GEM
reline
htmlentities (4.3.4)
http_parser.rb (0.8.0)
i18n (1.14.6)
i18n (1.14.8)
concurrent-ruby (~> 1.0)
io-console (0.7.2)
irb (1.15.2)
io-console (0.8.2)
irb (1.17.0)
pp (>= 0.6.0)
prism (>= 1.3.0)
rdoc (>= 4.0.0)
reline (>= 0.4.2)
jquery-rails (4.6.0)
Expand All @@ -243,7 +244,7 @@ GEM
listen (3.9.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
logger (1.6.1)
logger (1.7.0)
loofah (2.23.1)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
Expand Down Expand Up @@ -389,9 +390,10 @@ GEM
pg (1.4.6)
possibly (1.0.1)
power_assert (2.0.4)
pp (0.6.2)
pp (0.6.3)
prettyprint
prettyprint (0.2.0)
prism (1.9.0)
prometheus-client (4.0.0)
pry (0.15.0)
coderay (~> 1.1)
Expand All @@ -415,9 +417,9 @@ GEM
rack-session (2.1.1)
base64 (>= 0.1.0)
rack (>= 3.0.0)
rack-test (2.1.0)
rack-test (2.2.0)
rack (>= 1.3)
rackup (2.2.1)
rackup (2.3.1)
rack (>= 3)
railroady (1.6.0)
rails (7.2.2.2)
Expand All @@ -434,11 +436,11 @@ GEM
activesupport (= 7.2.2.2)
bundler (>= 1.15.0)
railties (= 7.2.2.2)
rails-dom-testing (2.2.0)
rails-dom-testing (2.3.0)
activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6)
rails-html-sanitizer (1.6.1)
rails-html-sanitizer (1.6.2)
loofah (~> 2.21)
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
railties (7.2.2.2)
Expand All @@ -450,24 +452,25 @@ GEM
thor (~> 1.0, >= 1.2.2)
zeitwerk (~> 2.6)
rainbow (3.1.1)
rake (13.2.1)
rake (13.3.1)
rb-fsevent (0.11.2)
rb-inotify (0.11.1)
ffi (~> 1.0)
rdoc (6.14.2)
rdoc (7.2.0)
erb
psych (>= 4.0.0)
tsort
regexp-examples (1.6.0)
regexp_property_values (~> 1.5)
regexp_parser (2.9.3)
regexp_property_values (1.5.2)
reline (0.5.11)
reline (0.6.3)
io-console (~> 0.5)
request_store (1.7.0)
rack (>= 1.4)
responders (3.1.1)
actionpack (>= 5.2)
railties (>= 5.2)
responders (3.2.0)
actionpack (>= 7.0)
railties (>= 7.0)
rexml (3.4.4)
roo (2.10.1)
nokogiri (~> 1)
Expand Down Expand Up @@ -549,9 +552,10 @@ GEM
terminal-notifier-guard (1.7.0)
test-unit (3.6.2)
power_assert
thor (1.4.0)
thor (1.5.0)
tilt (2.4.0)
timeout (0.4.2)
tsort (0.2.0)
ttfunk (1.8.0)
bigdecimal (~> 3.1)
turbolinks (5.2.1)
Expand Down Expand Up @@ -583,7 +587,7 @@ GEM
xpath (3.2.0)
nokogiri (~> 1.8)
yubikey (1.4.1)
zeitwerk (2.6.18)
zeitwerk (2.7.5)

PLATFORMS
arm64-darwin
Expand All @@ -608,7 +612,7 @@ DEPENDENCIES
date (= 3.3.4)
delayed_job (~> 4.1)
delayed_job_active_record
devise (~> 4.7, >= 4.7.1)
devise (~> 5.0)
guard
guard-livereload (~> 2.5)
guard-rubocop
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/concerns/polymorphic_authorizable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def authorize_polymorphic_resource
def _make_collection_accessible(resource_name)
variable_name = "@#{resource_name.to_s.pluralize}"

before_action only: [:index, :index_new] do
before_action only: [:index] do
relation = instance_variable_get(variable_name)
conditions = relation.where_values_hash
relation = relation.unscope(:where).where(conditions)
Expand Down
2 changes: 1 addition & 1 deletion test/integration/account_locking_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class AccountLockingTest < ActionDispatch::IntegrationTest
wrong_password = 'wordpass'

attempt_login_with(username, wrong_password) # 1
assert page.has_content?('Invalid Username or password.')
assert_text('Invalid username or password')

attempt_login_with(username, wrong_password) # 2
assert page.has_content?('You have one more attempt before your account is locked.')
Expand Down
3 changes: 2 additions & 1 deletion test/integration/application_project_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ class ApplicationProjectTest < ActionDispatch::IntegrationTest
fill_in 'project_comments_attributes_0_body', with: 'not today!'
click_button 'Save'
end
assert has_text? 'DPIA Rejected'
assert_no_selector '#modal-dpia_rejected'
assert_text 'DPIA Rejected'
end

assert has_no_button?('Begin DPIA')
Expand Down
10 changes: 10 additions & 0 deletions test/integration/cas_application_form_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,9 @@ class CasApplicationFormTest < ActionDispatch::IntegrationTest
select('Yes', from: 'cas_application_declaration_3')
select('Yes', from: 'cas_application_declaration_4')

assert_no_text 'CAS was successfully created.'
click_button('Create Application')
assert_text 'CAS was successfully created.'

project_datasets = Project.last.project_datasets

Expand All @@ -237,7 +239,9 @@ class CasApplicationFormTest < ActionDispatch::IntegrationTest
find(:css, "#dataset_#{dataset(83).id}_level_1_check_box").set(false)
end

assert_no_text 'CAS was successfully updated.'
click_button('Update Application')
assert_text 'CAS was successfully updated.'

assert_equal project_datasets.size, 2
assert_equal project_datasets.pluck(:dataset_id).sort, [84, 86]
Expand All @@ -250,7 +254,9 @@ class CasApplicationFormTest < ActionDispatch::IntegrationTest
set((Time.zone.now + 1.year).strftime('%d/%m/%Y'))
end

assert_no_text 'CAS was successfully updated.'
click_button('Update Application')
assert_text 'CAS was successfully updated.'

assert_equal project_datasets.size, 3
assert_equal project_datasets.find_by(dataset_id: 83).project_dataset_levels.size, 1
Expand All @@ -262,7 +268,9 @@ class CasApplicationFormTest < ActionDispatch::IntegrationTest
find(:css, "#dataset_#{dataset(86).id}_level_2_check_box").set(false)
end

assert_no_text 'CAS was successfully updated.'
click_button('Update Application')
assert_text 'CAS was successfully updated.'

assert_equal project_datasets.size, 2
assert_equal project_datasets.pluck(:dataset_id).sort, [83, 84]
Expand All @@ -273,7 +281,9 @@ class CasApplicationFormTest < ActionDispatch::IntegrationTest
find(:css, "#dataset_#{dataset(86).id}_level_2_check_box").set(true)
end

assert_no_text 'CAS was successfully updated.'
click_button('Update Application')
assert_text 'CAS was successfully updated.'

assert_equal project_datasets.size, 3
assert_equal project_datasets.find_by(dataset_id: 86).project_dataset_levels.size, 1
Expand Down
7 changes: 5 additions & 2 deletions test/integration/create_and_edit_project_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -397,8 +397,11 @@ def setup
fill_in 'project_first_contact_date', with: '06/06/2022'
fill_in 'project_name', with: 'EOI project test'
fill_in 'project_project_purpose', with: 'more details here'
select 'Standard2 User2', from: 'project_owner_grant_attributes_user_id'
select 'Anonymous', from: 'project_level_of_identifiability'
click_link 'Add Dataset'
click_button 'Create EOI'
assert_text 'EOI was successfully created.'

eoi_project = Project.find_by(name: 'EOI project test')
visit project_path(eoi_project)
Expand All @@ -407,10 +410,10 @@ def setup
fill_in 'project_application_log', with: 'ODR2223_100', fill_options: { clear: :backspace }
click_on 'Update EOI'

assert has_content? 'ODR Reference: ODR2223_100'
assert_text 'ODR Reference: ODR2223_100'

eoi_project.reload
assert eoi_project.application_log, 'ODR2223_100'
assert 'ODR2223_100', eoi_project.application_log
end

private
Expand Down
11 changes: 6 additions & 5 deletions test/integration/create_and_edit_user_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,12 @@ def setup

fill_in 'user_last_name', with: 'MOUSE'

assert_difference('User.count', 1) { click_button 'Save' }

assert page.has_content?('User was successfully created')
assert page.has_text?('MICKEY')
assert page.has_text?('MOUSE')
assert_difference('User.count', 1) do
click_button 'Save'
assert page.has_content?('User was successfully created')
assert page.has_text?('MICKEY')
assert page.has_text?('MOUSE')
end

visit user_path(User.last)
assert page.has_content?('AA')
Expand Down
2 changes: 2 additions & 0 deletions test/integration/notification_users_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ class NotificationUserTest < ActionDispatch::IntegrationTest

assert_difference('Notification.count', 1) do
fill_in 'Password', with: 'WRONGPASSWORD'
assert_no_text 'Failed to enter the correct password 3 times'
find_button('Log in').click
assert_text 'Failed to enter the correct password 3 times'
end
assert Notification.last.title.include? 'User has entered wrong password 3 times'

Expand Down
4 changes: 2 additions & 2 deletions test/integration/organisations_flow_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,19 @@ def setup
assert_no_changes -> { @organisation.reload.name } do
assert_no_changes -> { @organisation.reload.add1 } do
click_button 'Update Organisation'
assert_text(/\d+ errors? prevented this record from being saved/)
end
end

assert page.has_text?(/\d+ errors? prevented this record from being saved/)

fill_in :organisation_name, with: 'Test Org #1'

assert_changes -> { @organisation.reload.name } do
click_button 'Update Organisation'
assert_text 'Organisation was successfully updated.'
end

assert_current_path organisation_path(@organisation)
assert page.has_text? 'Organisation was successfully updated.'
end

# TODO - Clarify what happens when destroying an organisation, particulary if any organisation
Expand Down
10 changes: 7 additions & 3 deletions test/integration/project_import_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def setup
assert_current_path team_path(team)

click_button 'Import'
assert_text 'Drag and drop PDF here'

assert_difference -> { team.projects.count } do
assert_difference -> { ProjectAttachment.count } do
Expand All @@ -33,6 +34,7 @@ def setup
find('.glyphicon-inbox').click
end

assert_selector '#project_header', visible: true
within '#project_header' do
assert has_text? 'My Test Import Project'
end
Expand All @@ -47,6 +49,7 @@ def setup
assert_current_path team_path(team)

click_button 'Import'
assert_text 'Drag and drop PDF here'

# Invalid record(s)...
assert_no_difference -> { team.projects.count } do
Expand All @@ -56,6 +59,7 @@ def setup
find('.glyphicon-inbox').click
end

assert_selector '#modal', visible: true
within_modal do
assert has_text? 'Could not import file!'
assert has_text? "Email can't be blank"
Expand Down Expand Up @@ -111,16 +115,16 @@ def setup

visit edit_project_path(project)

assert has_text?('Drag and drop PDF here')
assert_text('Drag and drop PDF here')

assert_changes -> { project.reload.updated_at } do
assert_difference -> { project.project_attachments.count } do
attach_file(file) do
find('.glyphicon-inbox').click
end

assert has_no_text?('Provisional Title')
assert has_text?('My Test Import Project')
assert_no_text('Provisional Title')
assert_text('My Test Import Project')
assert_current_path project_path(project)
end
end
Expand Down
Binary file removed vendor/cache/base64-0.2.0.gem
Binary file not shown.
Binary file added vendor/cache/base64-0.3.0.gem
Binary file not shown.
Binary file removed vendor/cache/benchmark-0.4.1.gem
Binary file not shown.
Binary file added vendor/cache/benchmark-0.5.0.gem
Binary file not shown.
Binary file removed vendor/cache/bigdecimal-3.1.8.gem
Binary file not shown.
Binary file added vendor/cache/bigdecimal-3.3.1.gem
Binary file not shown.
Binary file removed vendor/cache/connection_pool-2.5.3.gem
Binary file not shown.
Binary file added vendor/cache/connection_pool-3.0.2.gem
Binary file not shown.
Binary file removed vendor/cache/devise-4.9.4.gem
Binary file not shown.
Binary file added vendor/cache/devise-5.0.3.gem
Binary file not shown.
Binary file removed vendor/cache/erb-5.0.2.gem
Binary file not shown.
Binary file added vendor/cache/erb-6.0.2.gem
Binary file not shown.
Binary file removed vendor/cache/erubi-1.13.0.gem
Binary file not shown.
Binary file added vendor/cache/erubi-1.13.1.gem
Binary file not shown.
Binary file removed vendor/cache/i18n-1.14.6.gem
Binary file not shown.
Binary file added vendor/cache/i18n-1.14.8.gem
Binary file not shown.
Binary file removed vendor/cache/io-console-0.7.2.gem
Binary file not shown.
Binary file added vendor/cache/io-console-0.8.2.gem
Binary file not shown.
Binary file removed vendor/cache/irb-1.15.2.gem
Binary file not shown.
Binary file added vendor/cache/irb-1.17.0.gem
Binary file not shown.
Binary file removed vendor/cache/logger-1.6.1.gem
Binary file not shown.
Binary file added vendor/cache/logger-1.7.0.gem
Binary file not shown.
Binary file removed vendor/cache/pp-0.6.2.gem
Binary file not shown.
Binary file added vendor/cache/pp-0.6.3.gem
Binary file not shown.
Binary file added vendor/cache/prism-1.9.0.gem
Binary file not shown.
Binary file removed vendor/cache/rack-test-2.1.0.gem
Binary file not shown.
Binary file added vendor/cache/rack-test-2.2.0.gem
Binary file not shown.
Binary file removed vendor/cache/rackup-2.2.1.gem
Binary file not shown.
Binary file added vendor/cache/rackup-2.3.1.gem
Binary file not shown.
Binary file removed vendor/cache/rails-dom-testing-2.2.0.gem
Binary file not shown.
Binary file added vendor/cache/rails-dom-testing-2.3.0.gem
Binary file not shown.
Binary file removed vendor/cache/rails-html-sanitizer-1.6.1.gem
Binary file not shown.
Binary file added vendor/cache/rails-html-sanitizer-1.6.2.gem
Binary file not shown.
Binary file removed vendor/cache/rake-13.2.1.gem
Binary file not shown.
Binary file added vendor/cache/rake-13.3.1.gem
Binary file not shown.
Binary file removed vendor/cache/rdoc-6.14.2.gem
Binary file not shown.
Binary file added vendor/cache/rdoc-7.2.0.gem
Binary file not shown.
Binary file removed vendor/cache/reline-0.5.11.gem
Binary file not shown.
Binary file added vendor/cache/reline-0.6.3.gem
Binary file not shown.
Binary file removed vendor/cache/responders-3.1.1.gem
Binary file not shown.
Binary file added vendor/cache/responders-3.2.0.gem
Binary file not shown.
Binary file removed vendor/cache/thor-1.4.0.gem
Binary file not shown.
Binary file added vendor/cache/thor-1.5.0.gem
Binary file not shown.
Binary file added vendor/cache/tsort-0.2.0.gem
Binary file not shown.
Binary file removed vendor/cache/zeitwerk-2.6.18.gem
Binary file not shown.
Binary file added vendor/cache/zeitwerk-2.7.5.gem
Binary file not shown.
Loading