Skip to content

Commit

Permalink
Merge branch 'develop' into depfu/update/net-smtp-0.4.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
stevieing authored Feb 26, 2024
2 parents a11c6f9 + 43b6ca9 commit 2f37adc
Show file tree
Hide file tree
Showing 26 changed files with 202 additions and 191 deletions.
1 change: 1 addition & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ require:
- rubocop-rspec
AllCops:
NewCops: enable
SuggestExtensions: false
Layout/LineLength:
Max: 120
27 changes: 16 additions & 11 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ GEM
ast (2.4.2)
autoprefixer-rails (10.4.7.0)
execjs (~> 2)
base64 (0.2.0)
bindex (0.8.1)
bootstrap-sass (3.4.1)
autoprefixer-rails (>= 5.2.1)
Expand Down Expand Up @@ -99,7 +100,7 @@ GEM
actionmailer (>= 5.2, < 8)
activesupport (>= 5.2, < 8)
execjs (2.8.1)
factory_bot (6.2.1)
factory_bot (6.4.6)
activesupport (>= 5.0.0)
ffi (1.15.5)
globalid (1.2.1)
Expand Down Expand Up @@ -131,7 +132,7 @@ GEM
mini_mime (1.1.5)
mini_portile2 (2.8.5)
minitest (5.22.2)
mysql2 (0.5.5)
mysql2 (0.5.6)
net-imap (0.3.4)
date
net-protocol
Expand Down Expand Up @@ -159,7 +160,7 @@ GEM
nio4r (~> 2.0)
racc (1.7.3)
rack (2.2.8)
rack-mini-profiler (3.0.0)
rack-mini-profiler (3.3.1)
rack (>= 1.2.0)
rack-test (2.1.0)
rack (>= 1.3)
Expand Down Expand Up @@ -229,19 +230,22 @@ GEM
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.30.0)
parser (>= 3.2.1.0)
rubocop-capybara (2.17.1)
rubocop-capybara (2.20.0)
rubocop (~> 1.41)
rubocop-performance (1.18.0)
rubocop (>= 1.7.0, < 2.0)
rubocop-ast (>= 0.4.0)
rubocop-factory_bot (2.25.1)
rubocop (~> 1.41)
rubocop-performance (1.20.2)
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.30.0, < 2.0)
rubocop-rails (2.23.1)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.33.0, < 2.0)
rubocop-ast (>= 1.30.0, < 2.0)
rubocop-rspec (2.19.0)
rubocop (~> 1.33)
rubocop-rspec (2.26.1)
rubocop (~> 1.40)
rubocop-capybara (~> 2.17)
rubocop-factory_bot (~> 2.22)
ruby-progressbar (1.13.0)
rubyzip (2.3.2)
sass-rails (6.0.0)
Expand All @@ -256,7 +260,8 @@ GEM
tilt
sdoc (2.4.0)
rdoc (>= 5.0)
selenium-webdriver (4.8.1)
selenium-webdriver (4.18.1)
base64 (~> 0.2)
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
Expand Down Expand Up @@ -292,7 +297,7 @@ GEM
activemodel (>= 6.0.0)
bindex (>= 0.4.0)
railties (>= 6.0.0)
websocket (1.2.9)
websocket (1.2.10)
websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
Expand Down
2 changes: 1 addition & 1 deletion config/initializers/01_proc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ def callback(callable, *args)
self === Class.new do
method_name = callable.to_sym
define_method(method_name) { |&block| block ? block.call(*args) : true }
define_method("#{method_name}?") { true }
define_method(:"#{method_name}?") { true }
def method_missing(*_args)
false
end
Expand Down
2 changes: 1 addition & 1 deletion report.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Report for 'Workflow1' workflow from 01/03/2017 to 31/03/2017
Report for 'Workflow_first' workflow from 01/03/2017 to 31/03/2017
Study,Project,Cost code name,Assets count
Study1,Project1,Not defined,1
Study1,Project2,A1,1
6 changes: 3 additions & 3 deletions spec/factories/workflow_factories.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@
active { true }
qc_flow { false }
cherrypick_flow { false }
association :initial_state, factory: :state, name: 'in_progress'
initial_state factory: %i[state], name: 'in_progress'

factory :qc_workflow do
qc_flow { true }
association :initial_state, factory: :state, name: 'volume_check'
initial_state factory: %i[state], name: 'volume_check'
end

factory :cherrypick_workflow do
cherrypick_flow { true }
association :initial_state, factory: :state, name: 'cherrypick'
initial_state factory: %i[state], name: 'cherrypick'

factory :cherrypick_qc_workflow do
qc_flow { true }
Expand Down
14 changes: 7 additions & 7 deletions spec/features/create_and_edit_batch_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@

require 'rails_helper'

describe 'create and edit batch', js: true do
describe 'create and edit batch', :js do
let!(:asset_type) { create(:asset_type, name: 'Sample', identifier_type: 'Name') }
let!(:workflow1) { create(:workflow, name: 'Workflow') }
let!(:workflow2) { create(:workflow, name: 'Reportable workflow', reportable: true) }
let!(:workflow3) { create(:qc_workflow, name: 'QC workflow') }
let!(:workflow4) { create(:workflow, name: 'Deactivated workflow', active: false) }
let!(:workflow_first) { create(:workflow, name: 'Workflow') }
let!(:workflow_second) { create(:workflow, name: 'Reportable workflow', reportable: true) }
let!(:workflow_third) { create(:qc_workflow, name: 'QC workflow') }
let!(:workflow_fourth) { create(:workflow, name: 'Deactivated workflow', active: false) }
let!(:in_progress) { create(:state, name: 'in_progress') }
let!(:volume_check) { create(:state, name: 'volume_check') }

it 'can create and edit a batch' do
visit '/'
click_link 'New Batch'
click_on 'New Batch'
click_on 'Sample'
within('div#sample-template') do
fill_in 'identifier', with: 'sample1 sample2'
Expand Down Expand Up @@ -51,7 +51,7 @@
it 'can create a batch with an Aker barcode' do
create(:asset_type, name: 'Plate with Name', identifier_type: 'Name')
visit '/'
click_link 'New Batch'
click_on 'New Batch'
click_on 'Plate with Name'
within('div#plate_with_name-template') do
fill_in 'identifier', with: 'AKER-123'
Expand Down
6 changes: 3 additions & 3 deletions spec/features/create_and_update_workflow_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

require 'rails_helper'

describe 'can create workflow', js: true do
describe 'can create workflow', :js do
it 'can create workflow' do
create(:state, name: 'in_progress')
create(:state, name: 'cherrypick')
Expand All @@ -16,14 +16,14 @@
find_by_id('hasComment', visible: :all).first(:xpath, './/..').click
find_by_id('qcFlow', visible: :all).first(:xpath, './/..').click
find_by_id('cherrypickFlow', visible: :all).first(:xpath, './/..').click
click_button(text: 'Create')
click_on(text: 'Create')
end
expect(page).to have_content('The workflow was created.')
expect(Workflow.count).to eq 1
find('a', text: 'Create a new workflow').click
within('#add-workflow-modal') do
fill_in 'Name', with: 'New workflow'
click_button(text: 'Create')
click_on(text: 'Create')
end
expect(page).to have_content('Name has already been taken')
expect(Workflow.count).to eq 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

require 'rails_helper'

describe 'create complete and report assets within standard flow', js: true do
describe 'create complete and report assets within standard flow', :js do
let!(:asset_type) { create(:asset_type, name: 'Tube', identifier_type: 'ID') }
let!(:workflow1) { create(:workflow, name: 'Workflow') }
let!(:workflow2) { create(:workflow, name: 'Reportable workflow', reportable: true) }
let!(:workflow_first) { create(:workflow, name: 'Workflow') }
let!(:workflow_second) { create(:workflow, name: 'Reportable workflow', reportable: true) }
let!(:in_progress) { create(:state, name: 'in_progress') }
let!(:volume_check) { create(:state, name: 'volume_check') }
let!(:quant) { create(:state, name: 'quant') }
Expand All @@ -15,7 +15,7 @@

it 'can create and complete a non-reportable asset' do
visit '/'
click_link 'New Batch'
click_on 'New Batch'
click_on 'Tube'
click_on 'Append to batch'
expect(page).to have_content "The entry can't be created as the form contains some errors."
Expand All @@ -31,22 +31,22 @@
click_on 'Save'
expect(page).to have_content 'The batch was created.'
click_on 'In Progress'
expect(page).to have_selector('table tr', count: 2)
expect(page).to have_css('table tr', count: 2)
check "assets[#{Asset.first.id}]"
click_on 'Completed selected'
expect(page).to have_content 'In progress is done for 123'
expect(page).not_to have_selector('table tr')
expect(page).to have_no_css('table tr')
click_on 'Volume check'
expect(page).not_to have_selector('table tr')
expect(page).to have_no_css('table tr')
click_on 'Quant'
expect(page).not_to have_selector('table tr')
expect(page).to have_no_css('table tr')
click_on 'Report Required'
expect(page).not_to have_selector('table tr')
expect(page).to have_no_css('table tr')
end

it 'can create, complete and report a reportable asset' do
visit '/'
click_link 'New Batch'
click_on 'New Batch'
click_on 'Tube'
within('div#tube-template') do
fill_in 'identifier', with: 123
Expand All @@ -67,17 +67,17 @@
click_on 'Save'
expect(page).to have_content 'The batch was created.'
click_on 'In Progress'
expect(page).to have_selector('table tr', count: 4)
expect(page).to have_css('table tr', count: 4)
check "assets[#{Asset.second.id}]"
click_on 'Completed selected'
expect(page).to have_content 'In progress is done for 456'
expect(page).to have_selector('table tr', count: 3)
expect(page).to have_css('table tr', count: 3)
click_on 'Volume check'
expect(page).not_to have_selector('table tr')
expect(page).to have_no_css('table tr')
click_on 'Quant'
expect(page).not_to have_selector('table tr')
expect(page).to have_no_css('table tr')
click_on 'Report Required'
expect(page).to have_selector('table tr', count: 2)
expect(page).to have_css('table tr', count: 2)
check "assets[#{Asset.second.id}]"
click_on 'Reported selected'
expect(page).to have_content 'Report required is done for 456'
Expand Down
Loading

0 comments on commit 2f37adc

Please sign in to comment.