<%= f.text_field :name, class: 'form-control' %>
diff --git a/app/views/tag_layout_templates/new.html.erb b/app/views/tag_layout_templates/new.html.erb
index bf001dd083..a7c700f085 100644
--- a/app/views/tag_layout_templates/new.html.erb
+++ b/app/views/tag_layout_templates/new.html.erb
@@ -2,7 +2,7 @@
<%= page_title 'Tag Layout Template', 'New' %>
<%= form_for(@tag_layout_template) do |f| %>
- <%= f.error_messages %>
+ <%= render_error_messages(@tag_layout_template) %>
<%= f.label :name, 'Tag Layout Template name' %>
<%= f.text_field :name, { class: 'form-control' } %>
diff --git a/bin/knapsack_pro_cucumber b/bin/knapsack_pro_cucumber
index 22e4aa0cfd..d07625fad7 100755
--- a/bin/knapsack_pro_cucumber
+++ b/bin/knapsack_pro_cucumber
@@ -1,16 +1,20 @@
#!/bin/bash
+
# See https://knapsackpro.com/faq/question/how-to-make-knapsack_pro-works-for-forked-repositories-of-my-project
if [ "$KNAPSACK_PRO_TEST_SUITE_TOKEN_CUCUMBER" = "" ]; then
echo "WARN: No KNAPSACK_PRO_TEST_SUITE_TOKEN_CUCUMBER github secret. Using fallback."
echo "To improve performance consider:"
echo "1) Add knapsackpro.com API keys to your github secrets"
echo "2) Make pull requests from the sanger repo"
+ echo "Seeding database for cucumber tests"
+ RAILS_ENV=cucumber bundle exec rake db:seed
+
KNAPSACK_PRO_ENDPOINT=https://localhost \
KNAPSACK_PRO_TEST_SUITE_TOKEN_CUCUMBER=disabled-for-fork \
KNAPSACK_PRO_MAX_REQUEST_RETRIES=0 \
- bundle exec rake "knapsack_pro:cucumber[--format CucumberGithubFormatter --out /dev/null --format progress]"
+ RAILS_ENV=cucumber bundle exec rake "knapsack_pro:cucumber[--format CucumberGithubFormatter --out /dev/null --format progress]"
# use Regular Mode here always
else
- bundle exec rake "knapsack_pro:queue:cucumber[--format CucumberGithubFormatter --out /dev/null --format progress]"
+ RAILS_ENV=cucumber bundle exec rake "knapsack_pro:queue:cucumber[--format CucumberGithubFormatter --out /dev/null --format progress]"
fi
diff --git a/config.ru b/config.ru
index e929ae7e14..3059e42a20 100644
--- a/config.ru
+++ b/config.ru
@@ -1,6 +1,6 @@
# frozen_string_literal: true
# Rails.root/config.ru
-require ::File.expand_path('config/environment', __dir__)
+require File.expand_path('config/environment', __dir__)
run Rails.application
diff --git a/config/application.rb b/config/application.rb
index 6910229d17..3666d6705c 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -22,7 +22,7 @@
Bundler.require(*Rails.groups)
module Sequencescape
- class Application < Rails::Application # rubocop:todo Style/Documentation
+ class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 5.0
diff --git a/config/cucumber.yml b/config/cucumber.yml
index af3c4fd63f..5aa9c13b42 100644
--- a/config/cucumber.yml
+++ b/config/cucumber.yml
@@ -1,8 +1,9 @@
<%
rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
-rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
-std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} --strict"
+rerun = rerun.strip.gsub /\s/, ' '
+rerun_opts = rerun.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
+std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} --strict --tags 'not @wip'"
%>
-default: <%= std_opts %> features --publish-quiet
+default: <%= std_opts %> features
wip: --tags @wip:3 --wip features
-rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict
+rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags 'not @wip'
diff --git a/config/database.yml b/config/database.yml
index 19b9aac9f8..c2c90997f9 100755
--- a/config/database.yml
+++ b/config/database.yml
@@ -49,8 +49,10 @@ test: &test
timeout: 5000
cucumber:
- <<: *test
+ <<: *MYSQL
database: sequencescape_test<%= ENV['TEST_ENV_NUMBER'] %><%= suffix %>_cuke
+ pool: 10
+ timeout: 5000
# We need to have some dummy configuration here when the app is being packaged up (vite:build),
# because the initializers are run.
@@ -64,3 +66,4 @@ production:
### Next release
### Training
### Production
+
diff --git a/config/environments/development.rb b/config/environments/development.rb
index f58edc1293..03eb9d6529 100644
--- a/config/environments/development.rb
+++ b/config/environments/development.rb
@@ -1,5 +1,9 @@
# frozen_string_literal: true
Rails.application.configure do
+ # Configure 'rails notes' to inspect Cucumber files
+ config.annotations.register_directories('features')
+ config.annotations.register_extensions('feature') { |tag| /#\s*(#{tag}):?\s*(.*)$/ }
+
# Settings specified here will take precedence over those in config/application.rb.
# Support requests coming from other Docker containers on localhost.
diff --git a/config/environments/production.rb b/config/environments/production.rb
index 69d472318f..71c1ba8a4f 100644
--- a/config/environments/production.rb
+++ b/config/environments/production.rb
@@ -72,7 +72,7 @@
config.active_support.deprecation = :notify
# Use default logging formatter so that PID and timestamp are not suppressed.
- config.log_formatter = ::Logger::Formatter.new
+ config.log_formatter = Logger::Formatter.new
# Use a different logger for distributed setups.
# require 'syslog/logger'
diff --git a/config/environments/test.rb b/config/environments/test.rb
index b57bfe945a..1cd73956ed 100644
--- a/config/environments/test.rb
+++ b/config/environments/test.rb
@@ -5,6 +5,10 @@
# and recreated between test runs. Don't rely on the data there!
Rails.application.configure do
+ # Configure 'rails notes' to inspect Cucumber files
+ config.annotations.register_directories('features')
+ config.annotations.register_extensions('feature') { |tag| /#\s*(#{tag}):?\s*(.*)$/ }
+
# Settings specified here will take precedence over those in config/application.rb.
config.cache_classes = true
diff --git a/config/initializers/active_record_validations.rb b/config/initializers/active_record_validations.rb
index 4f8b496e3c..f3ed0453ea 100644
--- a/config/initializers/active_record_validations.rb
+++ b/config/initializers/active_record_validations.rb
@@ -1,5 +1,5 @@
# frozen_string_literal: true
-module ActiveRecord::ExtraValidations # rubocop:todo Style/Documentation
+module ActiveRecord::ExtraValidations
def validates_unassigned(*attrs)
validates_each(*attrs) { |record, attr, value| record.errors.add(attr, 'cannot be assigned') if value.present? }
end
diff --git a/config/initializers/api_routing.rb b/config/initializers/api_routing.rb
index 73b7af6e1e..26c900b4d5 100644
--- a/config/initializers/api_routing.rb
+++ b/config/initializers/api_routing.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
# TODO: Fix these
-module ApiRouting # rubocop:todo Style/Documentation
+module ApiRouting
# Assets have a couple of extra actions that are always present: namely 'parents' and 'children'
def asset(*entities, &block)
options = entities.extract_options!
diff --git a/config/initializers/formtastic.rb b/config/initializers/formtastic.rb
index 903cc78e85..da3ea81cd2 100644
--- a/config/initializers/formtastic.rb
+++ b/config/initializers/formtastic.rb
@@ -6,7 +6,7 @@
module Formtastic
module Inputs
module Base
- module Labelling # rubocop:todo Style/Documentation
+ module Labelling
def label_html_options
{ for: input_html_options[:id], class: ['ft-label'] }
end
diff --git a/config/initializers/function_overrides.rb b/config/initializers/function_overrides.rb
new file mode 100644
index 0000000000..a718034ed5
--- /dev/null
+++ b/config/initializers/function_overrides.rb
@@ -0,0 +1,10 @@
+# frozen_string_literal: true
+require 'uri'
+
+module URI
+ class << self
+ def unescape(str)
+ URI.decode_www_form_component(str)
+ end
+ end
+end
diff --git a/config/initializers/process_locale_files_with_erb.rb b/config/initializers/process_locale_files_with_erb.rb
index 324b30370c..c4eb19e95d 100644
--- a/config/initializers/process_locale_files_with_erb.rb
+++ b/config/initializers/process_locale_files_with_erb.rb
@@ -2,7 +2,7 @@
# Causes the locale files to be pre-processed with ERB as we need to perform some substitutions
module I18n
module Backend
- module Base # rubocop:todo Style/Documentation
+ module Base
def load_yml(filename)
YAML.load(ERB.new(File.read(filename)).result)
end
diff --git a/config/initializers/ruby_net_http_proxy_hack.rb b/config/initializers/ruby_net_http_proxy_hack.rb
index 1becc958b8..4f373bbb7d 100644
--- a/config/initializers/ruby_net_http_proxy_hack.rb
+++ b/config/initializers/ruby_net_http_proxy_hack.rb
@@ -14,100 +14,100 @@
# Ideally this hack would be less intrusive, but net/http isn't best designed
# for extensibility, and we can't subclass it as we usually use it as a dependency.
-require 'net/http'
+# require 'net/http'
-module Net
- class HTTP # rubocop:todo Style/Documentation
- def self.set_proxy_header(name, value)
- additional_proxy_headers[name] = value
- end
+# module Net
+# class HTTP
+# def self.set_proxy_header(name, value)
+# additional_proxy_headers[name] = value
+# end
- def self.additional_proxy_headers
- @headers ||= {}
- end
+# def self.additional_proxy_headers
+# @headers ||= {}
+# end
- def additional_proxy_headers
- Net::HTTP.additional_proxy_headers
- end
+# def additional_proxy_headers
+# Net::HTTP.additional_proxy_headers
+# end
- # Adapted from https://raw.githubusercontent.com/jruby/jruby/9.0.5.0/lib/ruby/stdlib/net/http.rb
- # rubocop:todo Metrics/PerceivedComplexity, Metrics/MethodLength, Metrics/AbcSize
- def connect # rubocop:todo Metrics/CyclomaticComplexity
- if proxy?
- conn_address = proxy_address
- conn_port = proxy_port
- else
- conn_address = address
- conn_port = port
- end
+# # Adapted from https://raw.githubusercontent.com/jruby/jruby/9.0.5.0/lib/ruby/stdlib/net/http.rb
+#
+# def connect
+# if proxy?
+# conn_address = proxy_address
+# conn_port = proxy_port
+# else
+# conn_address = address
+# conn_port = port
+# end
- D "opening connection to #{conn_address}:#{conn_port}..."
- s =
- Timeout.timeout(@open_timeout, Net::OpenTimeout) do
- TCPSocket.open(conn_address, conn_port, @local_host, @local_port)
- end
- s.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1)
- D 'opened'
- if use_ssl?
- ssl_parameters = Hash.new
- iv_list = instance_variables
- SSL_IVNAMES.each_with_index do |ivname, i|
- if iv_list.include?(ivname) && (value = instance_variable_get(ivname))
- ssl_parameters[SSL_ATTRIBUTES[i]] = value if value
- end
- end
- @ssl_context = OpenSSL::SSL::SSLContext.new
- @ssl_context.set_params(ssl_parameters)
- D "starting SSL for #{conn_address}:#{conn_port}..."
- s = OpenSSL::SSL::SSLSocket.new(s, @ssl_context)
- s.sync_close = true
- D 'SSL established'
- end
- @socket = BufferedIO.new(s)
- @socket.read_timeout = @read_timeout
- @socket.continue_timeout = @continue_timeout
- @socket.debug_output = @debug_output
- if use_ssl?
- begin
- if proxy?
- buf = "CONNECT #{@address}:#{@port} HTTP/#{HTTPVersion}\r\n"
- buf << "Host: #{@address}:#{@port}\r\n"
+# D "opening connection to #{conn_address}:#{conn_port}..."
+# s =
+# Timeout.timeout(@open_timeout, Net::OpenTimeout) do
+# TCPSocket.open(conn_address, conn_port, @local_host, @local_port)
+# end
+# s.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1)
+# D 'opened'
+# if use_ssl?
+# ssl_parameters = Hash.new
+# iv_list = instance_variables
+# SSL_IVNAMES.each_with_index do |ivname, i|
+# if iv_list.include?(ivname) && (value = instance_variable_get(ivname))
+# ssl_parameters[SSL_ATTRIBUTES[i]] = value if value
+# end
+# end
+# @ssl_context = OpenSSL::SSL::SSLContext.new
+# @ssl_context.set_params(ssl_parameters)
+# D "starting SSL for #{conn_address}:#{conn_port}..."
+# s = OpenSSL::SSL::SSLSocket.new(s, @ssl_context)
+# s.sync_close = true
+# D 'SSL established'
+# end
+# @socket = BufferedIO.new(s)
+# @socket.read_timeout = @read_timeout
+# @socket.continue_timeout = @continue_timeout
+# @socket.debug_output = @debug_output
+# if use_ssl?
+# begin
+# if proxy?
+# buf = "CONNECT #{@address}:#{@port} HTTP/#{HTTPVersion}\r\n"
+# buf << "Host: #{@address}:#{@port}\r\n"
- # MODIFICATION BEGINS
- additional_proxy_headers.each { |k, v| buf << "#{k}: #{v}\r\n" }
+# # MODIFICATION BEGINS
+# additional_proxy_headers.each { |k, v| buf << "#{k}: #{v}\r\n" }
- # MODIFICATION ENDS
- if proxy_user
- credential = ["#{proxy_user}:#{proxy_pass}"].pack('m')
- credential.delete!("\r\n")
- buf << "Proxy-Authorization: Basic #{credential}\r\n"
- end
- buf << "\r\n"
- @socket.write(buf)
- HTTPResponse.read_new(@socket).value
- end
- if @ssl_session &&
- (Process.clock_gettime(Process::CLOCK_REALTIME) < @ssl_session.time.to_f + @ssl_session.timeout)
- s.session = @ssl_session if @ssl_session
- end
+# # MODIFICATION ENDS
+# if proxy_user
+# credential = ["#{proxy_user}:#{proxy_pass}"].pack('m')
+# credential.delete!("\r\n")
+# buf << "Proxy-Authorization: Basic #{credential}\r\n"
+# end
+# buf << "\r\n"
+# @socket.write(buf)
+# HTTPResponse.read_new(@socket).value
+# end
+# if @ssl_session &&
+# (Process.clock_gettime(Process::CLOCK_REALTIME) < @ssl_session.time.to_f + @ssl_session.timeout)
+# s.session = @ssl_session if @ssl_session
+# end
- # Server Name Indication (SNI) RFC 3546
- s.hostname = @address if s.respond_to? :hostname=
- Timeout.timeout(@open_timeout, Net::OpenTimeout) { s.connect }
- s.post_connection_check(@address) if @ssl_context.verify_mode != OpenSSL::SSL::VERIFY_NONE
- @ssl_session = s.session
- rescue => e
- D "Conn close because of connect error #{e}"
- @socket.close if @socket && (not @socket.closed?)
- raise e
- end
- end
- on_connect
- end
+# # Server Name Indication (SNI) RFC 3546
+# s.hostname = @address if s.respond_to? :hostname=
+# Timeout.timeout(@open_timeout, Net::OpenTimeout) { s.connect }
+# s.post_connection_check(@address) if @ssl_context.verify_mode != OpenSSL::SSL::VERIFY_NONE
+# @ssl_session = s.session
+# rescue => e
+# D "Conn close because of connect error #{e}"
+# @socket.close if @socket && (not @socket.closed?)
+# raise e
+# end
+# end
+# on_connect
+# end
- # rubocop:enable Metrics/AbcSize, Metrics/MethodLength, Metrics/PerceivedComplexity
- private :connect
- end
-end
+# # rubocop:enable Metrics/AbcSize, Metrics/MethodLength, Metrics/PerceivedComplexity
+# private :connect
+# end
+# end
-Net::HTTP.set_proxy_header('User-Agent', 'Sequencescape')
+# Net::HTTP.set_proxy_header('User-Agent', 'Sequencescape')
diff --git a/db/migrate/20180329080953_remove_redundant_plate_classes.rb b/db/migrate/20180329080953_remove_redundant_plate_classes.rb
index 91e7ece3bc..b8cdc493f8 100644
--- a/db/migrate/20180329080953_remove_redundant_plate_classes.rb
+++ b/db/migrate/20180329080953_remove_redundant_plate_classes.rb
@@ -36,7 +36,7 @@ def down
.where(target_type: new_type)
.joins('LEFT JOIN barcode_prefixes ON barcode_prefixes.id = plate_purposes.barcode_prefix_id')
.where(barcode_prefixes: { prefix: prefix })
- .each do |purpose|
+ .find_each do |purpose|
purpose.target_type = original
purpose.save
Asset.where(plate_purpose_id: purpose.id).update_all(sti_type: original)
diff --git a/db/migrate/20180420144414_migrate_sanger_barcodes_to_new_tables.rb b/db/migrate/20180420144414_migrate_sanger_barcodes_to_new_tables.rb
index 5798ba4f20..b8f4647492 100644
--- a/db/migrate/20180420144414_migrate_sanger_barcodes_to_new_tables.rb
+++ b/db/migrate/20180420144414_migrate_sanger_barcodes_to_new_tables.rb
@@ -4,7 +4,7 @@
class MigrateSangerBarcodesToNewTables < ActiveRecord::Migration[5.1]
def up # rubocop:disable Metrics/AbcSize
say 'Building prefix cache'
- @prefixes = BarcodePrefix.all.pluck(:id, :prefix).to_h
+ @prefixes = BarcodePrefix.pluck(:id, :prefix).to_h
say 'Migrating Sanger Barcodes'
Barcode.transaction do
Asset
diff --git a/db/seeds.rb b/db/seeds.rb
index da5b8b6a56..03fb36db8f 100644
--- a/db/seeds.rb
+++ b/db/seeds.rb
@@ -49,5 +49,5 @@
# example, property definitions depend on workflows to be present, so they should be ordered *after*
# those workflows have been created. Ideally you will be preceeding your seed data with a 4 digit
# 0-extended sequence number, i.e. 0001_foo.rb is executed *before* 0002_bar.rb.
- Dir.glob(File.expand_path(File.join(File.dirname(__FILE__), %w[seeds *.rb]))).sort.each(&handler)
+ Dir.glob(File.expand_path(File.join(File.dirname(__FILE__), %w[seeds *.rb]))).each(&handler)
end
diff --git a/db/seeds/0019_plate_creators.rb b/db/seeds/0019_plate_creators.rb
index bc73bea2c2..2a0541d2f6 100644
--- a/db/seeds/0019_plate_creators.rb
+++ b/db/seeds/0019_plate_creators.rb
@@ -67,7 +67,7 @@
c = Plate::Creator.find_by!(name: name)
c.update!(valid_options: { valid_dilution_factors: values })
end
- Plate::Creator.all.each do |c|
+ Plate::Creator.find_each do |c|
if c.valid_options.nil?
# Any other valid option will be set to 1
c.update!(valid_options: { valid_dilution_factors: [1.0] })
diff --git a/db/seeds/3000_library_types_setup.rb b/db/seeds/3000_library_types_setup.rb
index d395a95a70..ded537a208 100644
--- a/db/seeds/3000_library_types_setup.rb
+++ b/db/seeds/3000_library_types_setup.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-module SetupLibraryTypes # rubocop:todo Style/Documentation, Metrics/ModuleLength
+module SetupLibraryTypes # rubocop:todo Metrics/ModuleLength
def self.existing_associations_for(request_type)
{
'LibraryCreationRequest' => [
diff --git a/duplicates_1.csv b/duplicates_1.csv
deleted file mode 100644
index 6e8bb31cd4..0000000000
--- a/duplicates_1.csv
+++ /dev/null
@@ -1,11 +0,0 @@
-chosen_sample,rejected_sample
-412,413
-411,414
-410,415
-409,416
-408,417
-407,418
-406,419
-405,420
-404,421
-403,422
\ No newline at end of file
diff --git a/features/api/qc_files.feature b/features/api/qc_files.feature.IGNORE
similarity index 100%
rename from features/api/qc_files.feature
rename to features/api/qc_files.feature.IGNORE
diff --git a/features/step_definitions/.gitkeep b/features/step_definitions/.gitkeep
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/features/support/accession_service.rb b/features/support/accession_service.rb
index d106a59753..086b6f2f20 100644
--- a/features/support/accession_service.rb
+++ b/features/support/accession_service.rb
@@ -3,7 +3,7 @@
require 'singleton'
require 'rest-client'
-class FakeAccessionService # rubocop:todo Style/Documentation
+class FakeAccessionService
include Singleton
# Unfortunately Webmock doesn't handle multipart files, so we can't access
diff --git a/features/support/api.rb b/features/support/api.rb
index f244dd0e25..44451d7225 100644
--- a/features/support/api.rb
+++ b/features/support/api.rb
@@ -8,10 +8,10 @@
end
# Ensure that the number of results displayed per page by the API is always 1.
-Before('@new-api') { ::Core::Endpoint::BasicHandler::Paged.results_per_page = 1 }
+Before('@new-api') { Core::Endpoint::BasicHandler::Paged.results_per_page = 1 }
# Enables a replacement Sample endpoint for the object service tests, disabling it after
-class TestSampleEndpoint < ::Core::Endpoint::Base
+class TestSampleEndpoint < Core::Endpoint::Base
model { action(:create, to: :standard_create!) }
instance do
@@ -30,7 +30,7 @@ def self.root
end
end
-module Core::Endpoint::BasicHandler::EndpointLookup # rubocop:todo Style/Documentation
+module Core::Endpoint::BasicHandler::EndpointLookup
%i[object class].each do |name|
line = __LINE__ + 1
@@ -59,5 +59,5 @@ def self.testing_api=(setting)
end
end
-Before('@object_service') { ::Core::Endpoint::BasicHandler::EndpointLookup.testing_api = true }
-After('@object_service') { ::Core::Endpoint::BasicHandler::EndpointLookup.testing_api = false }
+Before('@object_service') { Core::Endpoint::BasicHandler::EndpointLookup.testing_api = true }
+After('@object_service') { Core::Endpoint::BasicHandler::EndpointLookup.testing_api = false }
diff --git a/features/support/barcode_service.rb b/features/support/barcode_service.rb
index fdd0ea28a6..aa830d262b 100644
--- a/features/support/barcode_service.rb
+++ b/features/support/barcode_service.rb
@@ -2,7 +2,7 @@
require 'singleton'
-class FakeBarcodeService # rubocop:todo Style/Documentation
+class FakeBarcodeService
include Singleton
# Ensure that the configuration is maintained, otherwise things start behaving badly
diff --git a/features/support/paths.rb b/features/support/paths.rb
index 4c64b972f0..e77c5f2bb2 100644
--- a/features/support/paths.rb
+++ b/features/support/paths.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
# rubocop:todo Metrics/ModuleLength
-module NavigationHelpers # rubocop:todo Style/Documentation
+module NavigationHelpers
# Finds the specified page for the given model with the specified name.
def page_for_model(model, page, name)
object = model.find_by!(name: name)
diff --git a/features/support/step_definitions/api_steps.rb b/features/support/step_definitions/api_steps.rb
index 9fdcae1a58..94254d3454 100644
--- a/features/support/step_definitions/api_steps.rb
+++ b/features/support/step_definitions/api_steps.rb
@@ -89,7 +89,7 @@ def api_request(action, path, body) # rubocop:todo Metrics/AbcSize
end
Given /^I am using the latest version of the API$/ do
- step("I am using version \"#{::Core::Service::API_VERSION}\" of the API")
+ step("I am using version \"#{Core::Service::API_VERSION}\" of the API")
end
When %r{^I (GET|PUT|POST|DELETE) the API path "(\/[^"]*)"$} do |action, path|
@@ -223,7 +223,7 @@ def decode_json(json, source)
raise StandardError, "Status #{status.inspect} should be an HTTP status code + message"
begin
assert_equal(match[1].to_i, page.driver.status_code)
- rescue MiniTest::Assertion => e
+ rescue Minitest::Assertion => e
step 'show me the HTTP response body'
raise e
end
@@ -327,7 +327,7 @@ def decode_json(json, source)
end
Given /^the number of results returned by the API per page is (\d+)$/ do |count|
- ::Core::Endpoint::BasicHandler::Paged.results_per_page = count.to_i
+ Core::Endpoint::BasicHandler::Paged.results_per_page = count.to_i
end
Given /^the "([^"]+)" action on samples requires authorisation$/ do |action|
diff --git a/features/support/step_definitions/samples_steps.rb b/features/support/step_definitions/samples_steps.rb
index 837a083447..519e1e715d 100644
--- a/features/support/step_definitions/samples_steps.rb
+++ b/features/support/step_definitions/samples_steps.rb
@@ -228,5 +228,5 @@
# To bypass all the callbacks
# That trigger when they die
Sample.delete_all
- Uuid.where(resource_type: 'Sample').each(&:destroy)
+ Uuid.where(resource_type: 'Sample').find_each(&:destroy)
end
diff --git a/features/support/step_definitions/study_steps.rb b/features/support/step_definitions/study_steps.rb
index 87409d5518..a6aea75424 100644
--- a/features/support/step_definitions/study_steps.rb
+++ b/features/support/step_definitions/study_steps.rb
@@ -220,7 +220,7 @@ def assign_asset_to_study(asset, study_name)
Asset
.where(id: asset_ids)
.includes(:aliquots)
- .each { |asset| asset.aliquots.each { |aliquot| aliquot.update!(study_id: study.id) } }
+ .find_each { |asset| asset.aliquots.each { |aliquot| aliquot.update!(study_id: study.id) } }
end
Then /^abbreviation for Study "([^"]*)" should be "([^"]*)"$/ do |study_name, abbreviation_regex|
diff --git a/features/support/step_definitions/transfer_steps.rb b/features/support/step_definitions/transfer_steps.rb
index 5934b203e0..e7e412741c 100644
--- a/features/support/step_definitions/transfer_steps.rb
+++ b/features/support/step_definitions/transfer_steps.rb
@@ -160,7 +160,7 @@ def change_request_state(state, targets, direction, request_class)
Then 'the study for the aliquots in the wells of {uuid} should match the last submission' do |plate|
study = Submission.last.orders.first.study
- plate.wells.includes(:aliquots).each { |w| w.aliquots.each { |a| assert_equal study.id, a.study_id } }
+ plate.wells.includes(:aliquots).find_each { |w| w.aliquots.each { |a| assert_equal study.id, a.study_id } }
end
Given '{asset_name} is a {string}' do |plate, name|
plate_purpose = Purpose.find_by!(name: name)
diff --git a/features/support/step_definitions/web_steps.rb b/features/support/step_definitions/web_steps.rb
index 90e52e20d2..d7e3dca7e9 100644
--- a/features/support/step_definitions/web_steps.rb
+++ b/features/support/step_definitions/web_steps.rb
@@ -10,7 +10,7 @@
require 'cgi'
require_relative '../paths'
-module WithinHelpers # rubocop:todo Style/Documentation
+module WithinHelpers
def with_scope(locator)
locator ? within(locator) { yield } : yield
end
diff --git a/features/support/timecop.rb b/features/support/timecop.rb
index 72c9b49d39..0b5849bb8a 100644
--- a/features/support/timecop.rb
+++ b/features/support/timecop.rb
@@ -2,7 +2,7 @@
require 'timecop'
-class Timecop # rubocop:todo Style/Documentation
+class Timecop
class << self
# Block the use of Timecop.freeze as it upsets the Capybara...
def freeze_with_warning(_time)
@@ -23,7 +23,7 @@ def freeze_with_warning(_time)
# Turning Timecop.freeze off for JavaScript Scenarios
Before('@javascript') do
- class Timecop # rubocop:todo Style/Documentation
+ class Timecop
class << self
alias freeze_without_warning freeze
alias freeze freeze_with_warning
@@ -32,7 +32,7 @@ class << self
end
# ...and back on again.
After('@javascript') do
- class Timecop # rubocop:todo Style/Documentation
+ class Timecop
class << self
alias freeze freeze_without_warning
undef freeze_without_warning
diff --git a/features/support/well_range.rb b/features/support/well_range.rb
index 7cee10d40f..f46a66302f 100644
--- a/features/support/well_range.rb
+++ b/features/support/well_range.rb
@@ -2,7 +2,7 @@
# Helper class that wraps well ranges in specs
class WellRange
- WELL_REGEXP = /^([A-H])(\d+)$/.freeze
+ WELL_REGEXP = /^([A-H])(\d+)$/
def initialize(start, finish)
start_match = WELL_REGEXP.match(start)
diff --git a/lib/accession/accession.rb b/lib/accession/accession.rb
index 7624314132..299bab6190 100644
--- a/lib/accession/accession.rb
+++ b/lib/accession/accession.rb
@@ -1,5 +1,5 @@
# frozen_string_literal: true
-module Accession # rubocop:todo Style/Documentation
+module Accession
# Handles assigning of accessioning number to a Sequenescape sample.
# Before accessioning:
# check configuration settings, in particular:
@@ -28,7 +28,7 @@ def load_file(folder, filename)
end
end
- module Equality # rubocop:todo Style/Documentation
+ module Equality
include Comparable
def to_a
diff --git a/lib/accession/accession/configuration.rb b/lib/accession/accession/configuration.rb
index b9310dd2bb..31f00202a2 100644
--- a/lib/accession/accession/configuration.rb
+++ b/lib/accession/accession/configuration.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
module Accession
- class Configuration # rubocop:todo Style/Documentation
+ class Configuration
include Accession::Helpers
include Accession::Equality
diff --git a/lib/accession/accession/core_extensions.rb b/lib/accession/accession/core_extensions.rb
index 8c4971ca11..6c17d4691f 100644
--- a/lib/accession/accession/core_extensions.rb
+++ b/lib/accession/accession/core_extensions.rb
@@ -4,7 +4,7 @@ module Accession
# Core Extensions provide extensions to standard classes
# which can be included whenever needed.
module CoreExtensions
- module String # rubocop:todo Style/Documentation
+ module String
# replace everything that is not a valid character with an underscore
def sanitize
downcase.gsub(/[^\w\d]/i, '_')
diff --git a/lib/accession/accession/sample.rb b/lib/accession/accession/sample.rb
index c77a1daa21..dd5e1924e0 100644
--- a/lib/accession/accession/sample.rb
+++ b/lib/accession/accession/sample.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
module Accession
- class Sample # rubocop:todo Style/Documentation
+ class Sample
# Validate the sample to ensure that it can be accessioned
# The sample must:
# - not be accessioned
diff --git a/lib/accession/accession/service.rb b/lib/accession/accession/service.rb
index 7e44a52f7f..71ef37ecc1 100644
--- a/lib/accession/accession/service.rb
+++ b/lib/accession/accession/service.rb
@@ -37,7 +37,7 @@ def url
def login
return configatron.accession.ega!.to_hash if ega?
- return configatron.accession.ena!.to_hash if ena?
+ configatron.accession.ena!.to_hash if ena?
end
end
end
diff --git a/lib/accession/accession/tag.rb b/lib/accession/accession/tag.rb
index afd6477637..fc7f49e02a 100644
--- a/lib/accession/accession/tag.rb
+++ b/lib/accession/accession/tag.rb
@@ -117,7 +117,6 @@ def value_for(record, key)
class TagCollectionDate < Tag
# rubocop:disable Layout/LineLength
REGEXP = %r{(^[12][0-9]{3}(-(0[1-9]|1[0-2])(-(0[1-9]|[12][0-9]|3[01])(T[0-9]{2}:[0-9]{2}(:[0-9]{2})?Z?([+-][0-9]{1,2})?)?)?)?(/[0-9]{4}(-[0-9]{2}(-[0-9]{2}(T[0-9]{2}:[0-9]{2}(:[0-9]{2})?Z?([+-][0-9]{1,2})?)?)?)?)?$)}
- .freeze
# rubocop:enable Layout/LineLength
diff --git a/lib/accession/accession/tag_list.rb b/lib/accession/accession/tag_list.rb
index 8e0824ceb0..eba8db0f00 100644
--- a/lib/accession/accession/tag_list.rb
+++ b/lib/accession/accession/tag_list.rb
@@ -8,7 +8,7 @@ module Accession
# Tags contain information about a sample, that should be provided to an external service to accession the sample
# Tags are used to validate a sample and to create a correct xml file for accessioning request.
- class TagList # rubocop:todo Style/Documentation
+ class TagList
include Enumerable
include Comparable
diff --git a/lib/api_tools.rb b/lib/api_tools.rb
index d1aad7b742..1695003e91 100644
--- a/lib/api_tools.rb
+++ b/lib/api_tools.rb
@@ -1,10 +1,10 @@
# frozen_string_literal: true
-module ApiTools # rubocop:todo Style/Documentation
+module ApiTools
def self.included(base)
base.extend(ClassMethods)
end
- module ClassMethods # rubocop:todo Style/Documentation
+ module ClassMethods
def render_class
@render_class ||= Api::Base.render_class_for_model(self)
end
diff --git a/lib/authenticated_system.rb b/lib/authenticated_system.rb
index 43063f27d3..2341aac656 100644
--- a/lib/authenticated_system.rb
+++ b/lib/authenticated_system.rb
@@ -1,5 +1,5 @@
# frozen_string_literal: true
-module AuthenticatedSystem # rubocop:todo Style/Documentation
+module AuthenticatedSystem
protected
# Returns true or false if the user is logged in.
diff --git a/lib/authenticated_test_helper.rb b/lib/authenticated_test_helper.rb
index 453cbe475c..d4d106f8f6 100644
--- a/lib/authenticated_test_helper.rb
+++ b/lib/authenticated_test_helper.rb
@@ -1,5 +1,5 @@
# frozen_string_literal: true
-module AuthenticatedTestHelper # rubocop:todo Style/Documentation
+module AuthenticatedTestHelper
# Sets the current user in the session from the user fixtures.
def login_as(user)
@request.session[:user] = user ? user.id : nil
@@ -63,7 +63,7 @@ def reset!(*instance_vars)
end
end
-class BaseLoginProxy # rubocop:todo Style/Documentation
+class BaseLoginProxy
attr_reader :controller, :options
def initialize(controller, login)
@@ -89,7 +89,7 @@ def method_missing(method, *args)
end
end
-class HttpLoginProxy < BaseLoginProxy # rubocop:todo Style/Documentation
+class HttpLoginProxy < BaseLoginProxy
protected
def authenticate
@@ -101,7 +101,7 @@ def check
end
end
-class XmlLoginProxy < BaseLoginProxy # rubocop:todo Style/Documentation
+class XmlLoginProxy < BaseLoginProxy
protected
def authenticate
diff --git a/lib/capybara_failure_logger.rb b/lib/capybara_failure_logger.rb
index 2b7aa52c2b..5495b4d441 100644
--- a/lib/capybara_failure_logger.rb
+++ b/lib/capybara_failure_logger.rb
@@ -43,9 +43,9 @@ def self.log_html(name, page)
end
def self.log_js(_name, page)
- return unless page.driver.browser.respond_to?(:manage)
+ return unless page.driver.browser.respond_to?(:logs)
- errors = page.driver.browser.manage.logs.get(:browser)
+ errors = page.driver.browser.logs.get(:browser)
yield '== JS errors ============'
errors.each { |jserror| yield jserror.message }
yield '========================='
diff --git a/lib/control_request_type_creation.rb b/lib/control_request_type_creation.rb
index 9146584667..57e95e12ac 100644
--- a/lib/control_request_type_creation.rb
+++ b/lib/control_request_type_creation.rb
@@ -1,5 +1,5 @@
# frozen_string_literal: true
-module ControlRequestTypeCreation # rubocop:todo Style/Documentation
+module ControlRequestTypeCreation
def control_type_name
key_name.titleize
end
diff --git a/lib/deployed_version.rb b/lib/deployed_version.rb
index 7256d97fdd..f992db948b 100644
--- a/lib/deployed_version.rb
+++ b/lib/deployed_version.rb
@@ -2,8 +2,8 @@
require 'open3'
-module Deployed # rubocop:todo Style/Documentation
- class RepoData # rubocop:todo Style/Documentation
+module Deployed
+ class RepoData
def tag
@tag ||= git_tag || read_file('TAG').strip.presence
end
@@ -107,8 +107,8 @@ def read_file(filename)
COMMIT = REPO_DATA.revision.presence || 'unknown_revision'
ABBREV_COMMIT = REPO_DATA.revision_short.presence || 'unknown_revision'
- VERSION_STRING = "#{APP_NAME} #{VERSION_ID} [#{ENVIRONMENT}]"
- VERSION_COMMIT = "#{BRANCH}@#{ABBREV_COMMIT}"
+ VERSION_STRING = "#{APP_NAME} #{VERSION_ID} [#{ENVIRONMENT}]".freeze
+ VERSION_COMMIT = "#{BRANCH}@#{ABBREV_COMMIT}".freeze
REPO_URL = REPO_DATA.release_url.presence || '#'
HOSTNAME = Socket.gethostname
diff --git a/lib/event_factory.rb b/lib/event_factory.rb
index ba96620fc8..5b2b23d276 100644
--- a/lib/event_factory.rb
+++ b/lib/event_factory.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
require 'eventful_mailer'
-class EventFactory # rubocop:todo Style/Documentation
+class EventFactory
#################################
# project related notifications #
#################################
diff --git a/lib/eventful_mailer.rb b/lib/eventful_mailer.rb
index d58232301d..d9b4d20526 100644
--- a/lib/eventful_mailer.rb
+++ b/lib/eventful_mailer.rb
@@ -1,5 +1,5 @@
# frozen_string_literal: true
-class EventfulMailer < ActionMailer::Base # rubocop:todo Style/Documentation
+class EventfulMailer < ActionMailer::Base
# rubocop:todo Metrics/ParameterLists
def confirm_event(receiver, eventful, message, content, _milestone, sent_at = Time.zone.now)
@eventful = eventful
diff --git a/lib/eventful_record.rb b/lib/eventful_record.rb
index 99eee83b0f..a78ac30c25 100644
--- a/lib/eventful_record.rb
+++ b/lib/eventful_record.rb
@@ -1,5 +1,5 @@
# frozen_string_literal: true
-module EventfulRecord # rubocop:todo Style/Documentation
+module EventfulRecord
def has_many_events(&block) # rubocop:todo Metrics/MethodLength
has_many(:events, -> { order(created_at: :asc, id: :asc) }, as: :eventful, dependent: :destroy) do
def self.event_constructor(name, event_class, event_class_method)
diff --git a/lib/generators/api_v2/api_v2_generator.rb b/lib/generators/api_v2/api_v2_generator.rb
index 4481fbe5c2..58cebf32c3 100644
--- a/lib/generators/api_v2/api_v2_generator.rb
+++ b/lib/generators/api_v2/api_v2_generator.rb
@@ -1,5 +1,5 @@
# frozen_string_literal: true
-class ApiV2Generator < Rails::Generators::NamedBase # rubocop:todo Style/Documentation
+class ApiV2Generator < Rails::Generators::NamedBase
source_root File.expand_path('../templates', __FILE__)
def create_directories
diff --git a/lib/has_behaviour.rb b/lib/has_behaviour.rb
index 46f6ee60e5..cec1b5ba0f 100644
--- a/lib/has_behaviour.rb
+++ b/lib/has_behaviour.rb
@@ -5,7 +5,7 @@
# ruby classes as HasBehaviour::File for instance loads the global file
# object.
module HasBehaviour
- module ClassMethods # rubocop:todo Style/Documentation
+ module ClassMethods
def has_behaviour(klass, behaviour_name: nil)
@registered_behaviours ||= {}
@registered_behaviours[behaviour_name || klass.name] = klass
diff --git a/lib/illumina_c/helper.rb b/lib/illumina_c/helper.rb
index 5c974239a4..a7b8612246 100644
--- a/lib/illumina_c/helper.rb
+++ b/lib/illumina_c/helper.rb
@@ -21,7 +21,7 @@ module IlluminaC::Helper
].freeze
PIPELINE = 'Illumina-C'
- class TemplateConstructor # rubocop:todo Style/Documentation
+ class TemplateConstructor
# Construct submission templates for the generic pipeline
# opts is a hash
# {
diff --git a/lib/informatics.rb b/lib/informatics.rb
index 5830a6ca8f..bbbf0110ee 100644
--- a/lib/informatics.rb
+++ b/lib/informatics.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
module Informatics
- module Globals # rubocop:todo Style/Documentation
+ module Globals
@@application = nil
@@defaults = nil
diff --git a/lib/informatics/lib/informatics.rb b/lib/informatics/lib/informatics.rb
index 86ea94b9fb..6cbbef311e 100644
--- a/lib/informatics/lib/informatics.rb
+++ b/lib/informatics/lib/informatics.rb
@@ -1,3 +1,3 @@
# frozen_string_literal: true
-module Informatics # rubocop:todo Style/Documentation
+module Informatics
end
diff --git a/lib/informatics/lib/informatics/application.rb b/lib/informatics/lib/informatics/application.rb
index 10504c70b1..9e368e14fb 100644
--- a/lib/informatics/lib/informatics/application.rb
+++ b/lib/informatics/lib/informatics/application.rb
@@ -3,7 +3,7 @@
require File.dirname(__FILE__) + '/support/options'
module Informatics
- class Application # rubocop:todo Style/Documentation
+ class Application
include Informatics::Globals
attr_accessor :name, :description, :home_page, :title, :authentication
diff --git a/lib/informatics/lib/informatics/controller_helper.rb b/lib/informatics/lib/informatics/controller_helper.rb
index cda3e0c420..dcef1cc003 100644
--- a/lib/informatics/lib/informatics/controller_helper.rb
+++ b/lib/informatics/lib/informatics/controller_helper.rb
@@ -5,7 +5,7 @@
require_relative 'view/tabs/list'
require_relative 'globals'
-module ApplicationHelper # rubocop:todo Style/Documentation
+module ApplicationHelper
include Informatics::Globals
# rubocop:todo Metrics/MethodLength, Metrics/AbcSize
diff --git a/lib/informatics/lib/informatics/globals.rb b/lib/informatics/lib/informatics/globals.rb
index 5830a6ca8f..bbbf0110ee 100644
--- a/lib/informatics/lib/informatics/globals.rb
+++ b/lib/informatics/lib/informatics/globals.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
module Informatics
- module Globals # rubocop:todo Style/Documentation
+ module Globals
@@application = nil
@@defaults = nil
diff --git a/lib/informatics/lib/informatics/support/options.rb b/lib/informatics/lib/informatics/support/options.rb
index bfba05ace0..bcba83eb9c 100644
--- a/lib/informatics/lib/informatics/support/options.rb
+++ b/lib/informatics/lib/informatics/support/options.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
module Informatics
module Support
- class Options # rubocop:todo Style/Documentation
+ class Options
attr_reader :options
def self.collect(*options)
diff --git a/lib/informatics/lib/informatics/view/menu/item.rb b/lib/informatics/lib/informatics/view/menu/item.rb
index 2b80e13e44..693f0beaa9 100644
--- a/lib/informatics/lib/informatics/view/menu/item.rb
+++ b/lib/informatics/lib/informatics/view/menu/item.rb
@@ -2,7 +2,7 @@
module Informatics
module View
module Menu
- class Item # rubocop:todo Style/Documentation
+ class Item
attr_accessor :text, :link, :confirm, :method
def initialize(options = {})
diff --git a/lib/informatics/lib/informatics/view/menu/list.rb b/lib/informatics/lib/informatics/view/menu/list.rb
index b3484d09c9..073c365fe3 100644
--- a/lib/informatics/lib/informatics/view/menu/list.rb
+++ b/lib/informatics/lib/informatics/view/menu/list.rb
@@ -2,7 +2,7 @@
module Informatics
module View
module Menu
- class List # rubocop:todo Style/Documentation
+ class List
attr_accessor :items
def add_item(options = {})
diff --git a/lib/informatics/lib/informatics/view/tabs/item.rb b/lib/informatics/lib/informatics/view/tabs/item.rb
index 18ada68952..0a4a01f082 100644
--- a/lib/informatics/lib/informatics/view/tabs/item.rb
+++ b/lib/informatics/lib/informatics/view/tabs/item.rb
@@ -2,7 +2,7 @@
module Informatics
module View
module Tabs
- class Item # rubocop:todo Style/Documentation
+ class Item
attr_accessor :text, :link
def initialize(options = {})
diff --git a/lib/informatics/lib/informatics/view/tabs/list.rb b/lib/informatics/lib/informatics/view/tabs/list.rb
index 01bb5fd294..51b287ef21 100644
--- a/lib/informatics/lib/informatics/view/tabs/list.rb
+++ b/lib/informatics/lib/informatics/view/tabs/list.rb
@@ -2,7 +2,7 @@
module Informatics
module View
module Tabs
- class List # rubocop:todo Style/Documentation
+ class List
attr_accessor :items
def initialize(_options = {})
diff --git a/lib/informatics/test/helpers/authentication_helper.rb b/lib/informatics/test/helpers/authentication_helper.rb
index e72fa7cae8..26dce88c76 100644
--- a/lib/informatics/test/helpers/authentication_helper.rb
+++ b/lib/informatics/test/helpers/authentication_helper.rb
@@ -1,5 +1,5 @@
# frozen_string_literal: true
-module AuthenticatedTestHelper # rubocop:todo Style/Documentation
+module AuthenticatedTestHelper
# Sets the current user in the session from the user fixtures.
def login_as(user)
@request.session[:user] = user ? users(user).id : nil
@@ -63,7 +63,7 @@ def reset!(*instance_vars)
end
end
-class BaseLoginProxy # rubocop:todo Style/Documentation
+class BaseLoginProxy
attr_reader :controller, :options
def initialize(controller, login)
@@ -89,7 +89,7 @@ def method_missing(method, *args)
end
end
-class HttpLoginProxy < BaseLoginProxy # rubocop:todo Style/Documentation
+class HttpLoginProxy < BaseLoginProxy
protected
def authenticate
@@ -101,7 +101,7 @@ def check
end
end
-class XmlLoginProxy < BaseLoginProxy # rubocop:todo Style/Documentation
+class XmlLoginProxy < BaseLoginProxy
protected
def authenticate
diff --git a/lib/informatics/test/test_informatics.rb b/lib/informatics/test/test_informatics.rb
index ce688b56e2..44fdbd3b78 100644
--- a/lib/informatics/test/test_informatics.rb
+++ b/lib/informatics/test/test_informatics.rb
@@ -2,7 +2,7 @@
require 'test/unit'
require 'informatics/support/options'
-class TestInformatics < Test::Unit::TestCase # rubocop:todo Style/Documentation
+class TestInformatics < Test::Unit::TestCase
def setup
@hash = { 'KEY' => 'VALUE' }
@o = Informatics::Support::Options.collect(@hash)
diff --git a/lib/insdc/import_countries.rb b/lib/insdc/import_countries.rb
index e7b677de77..db86dc4efe 100644
--- a/lib/insdc/import_countries.rb
+++ b/lib/insdc/import_countries.rb
@@ -6,7 +6,7 @@
class Insdc::ImportCountries
FILE_ROOT = Rails.root.join('data/ena_sample_checklists')
FIELD_NAME = 'geographic location (country and/or sea)'
- XPATH = "//FIELD//NAME[text() = '#{FIELD_NAME}']/following-sibling::FIELD_TYPE//TEXT_VALUE//VALUE"
+ XPATH = "//FIELD//NAME[text() = '#{FIELD_NAME}']/following-sibling::FIELD_TYPE//TEXT_VALUE//VALUE".freeze
def initialize(ena_root:, sample_checklist:, priorities: {})
@ena_root = ena_root
diff --git a/lib/lab_where_client.rb b/lib/lab_where_client.rb
index 22e80faf43..dc5d5b9924 100644
--- a/lib/lab_where_client.rb
+++ b/lib/lab_where_client.rb
@@ -4,7 +4,7 @@
module LabWhereClient
LabwhereException = Class.new(StandardError)
- class LabWhere # rubocop:todo Style/Documentation
+ class LabWhere
def base_url
configatron.fetch(:labwhere_api)
end
@@ -45,7 +45,7 @@ def put(instance, target, payload)
end
end
- class Endpoint # rubocop:todo Style/Documentation
+ class Endpoint
def self.endpoint_name(name)
@endpoint = name
end
@@ -57,8 +57,8 @@ class << self
def initialize(params); end # rubocop:todo Style/RedundantInitialize
end
- module EndpointCreateActions # rubocop:todo Style/Documentation
- module ClassMethods # rubocop:todo Style/Documentation
+ module EndpointCreateActions
+ module ClassMethods
def creation_params(params)
params
end
@@ -74,8 +74,8 @@ def self.included(base)
end
end
- module EndpointUpdateActions # rubocop:todo Style/Documentation
- module ClassMethods # rubocop:todo Style/Documentation
+ module EndpointUpdateActions
+ module ClassMethods
def update(target, params)
attrs = LabWhere.new.put(self, target, params)
new(attrs) unless attrs.nil?
@@ -87,7 +87,7 @@ def self.included(base)
end
end
- class Labware < Endpoint # rubocop:todo Style/Documentation
+ class Labware < Endpoint
endpoint_name 'labwares'
attr_reader :barcode, :location
@@ -105,7 +105,7 @@ def initialize(params)
end
end
- class LabwareSearch < Endpoint # rubocop:todo Style/Documentation
+ class LabwareSearch < Endpoint
endpoint_name 'labwares/searches'
attr_reader :labwares
@@ -124,7 +124,7 @@ def initialize(params_list)
end
end
- class Scan < Endpoint # rubocop:todo Style/Documentation
+ class Scan < Endpoint
include EndpointCreateActions
attr_reader :message, :errors
@@ -155,7 +155,7 @@ def error
end
end
- class Location < Endpoint # rubocop:todo Style/Documentation
+ class Location < Endpoint
endpoint_name 'locations'
attr_reader :name, :parentage, :barcode
diff --git a/lib/label_printer/label_printer.rb b/lib/label_printer/label_printer.rb
index 0f643b535d..db386875a3 100644
--- a/lib/label_printer/label_printer.rb
+++ b/lib/label_printer/label_printer.rb
@@ -3,7 +3,7 @@
require_relative 'label_printer/label/base_plate'
require_relative 'label_printer/label/base_tube'
-Dir["#{File.dirname(__FILE__)}/**/*.rb"].sort.each { |file| require file }
+Dir["#{File.dirname(__FILE__)}/**/*.rb"].each { |file| require file }
-module LabelPrinter # rubocop:todo Style/Documentation
+module LabelPrinter
end
diff --git a/lib/label_printer/label_printer/batch_plates.rb b/lib/label_printer/label_printer/batch_plates.rb
index 4bd2aa69c7..0a26554a80 100644
--- a/lib/label_printer/label_printer/batch_plates.rb
+++ b/lib/label_printer/label_printer/batch_plates.rb
@@ -2,7 +2,7 @@
module LabelPrinter
module Label
- module BatchPlates # rubocop:todo Style/Documentation
+ module BatchPlates
def plates
barcodes = printable.select { |_barcode, check| check == 'on' }.keys
batch.plate_group_barcodes.keys.select { |plate| barcodes.include?(plate.human_barcode) }
diff --git a/lib/label_printer/label_printer/label.rb b/lib/label_printer/label_printer/label.rb
index 85443c9211..e56ebc6fcc 100644
--- a/lib/label_printer/label_printer/label.rb
+++ b/lib/label_printer/label_printer/label.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
module LabelPrinter
module Label
- module MultipleLabels # rubocop:todo Style/Documentation
+ module MultipleLabels
attr_accessor :count
def labels
diff --git a/lib/label_printer/label_printer/label/asset_plate.rb b/lib/label_printer/label_printer/label/asset_plate.rb
index 668630beaa..17fe262f5d 100644
--- a/lib/label_printer/label_printer/label/asset_plate.rb
+++ b/lib/label_printer/label_printer/label/asset_plate.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
module LabelPrinter
module Label
- class AssetPlate < BasePlate # rubocop:todo Style/Documentation
+ class AssetPlate < BasePlate
attr_reader :plates
def initialize(plates)
diff --git a/lib/label_printer/label_printer/label/asset_plate_double.rb b/lib/label_printer/label_printer/label/asset_plate_double.rb
index 47b5b31c9e..25d838bf9f 100644
--- a/lib/label_printer/label_printer/label/asset_plate_double.rb
+++ b/lib/label_printer/label_printer/label/asset_plate_double.rb
@@ -4,7 +4,7 @@
module LabelPrinter
module Label
- class AssetPlateDouble < BasePlateDouble # rubocop:todo Style/Documentation
+ class AssetPlateDouble < BasePlateDouble
attr_reader :plates
def initialize(plates)
diff --git a/lib/label_printer/label_printer/label/asset_redirect.rb b/lib/label_printer/label_printer/label/asset_redirect.rb
index 4eb35120fb..731f05aaba 100644
--- a/lib/label_printer/label_printer/label/asset_redirect.rb
+++ b/lib/label_printer/label_printer/label/asset_redirect.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
module LabelPrinter
module Label
- class AssetRedirect # rubocop:todo Style/Documentation
+ class AssetRedirect
attr_reader :printables
def initialize(options)
diff --git a/lib/label_printer/label_printer/label/asset_tube.rb b/lib/label_printer/label_printer/label/asset_tube.rb
index afc86c617e..6427121c32 100644
--- a/lib/label_printer/label_printer/label/asset_tube.rb
+++ b/lib/label_printer/label_printer/label/asset_tube.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
module LabelPrinter
module Label
- class AssetTube < BaseTube # rubocop:todo Style/Documentation
+ class AssetTube < BaseTube
attr_reader :tubes
def initialize(tubes)
diff --git a/lib/label_printer/label_printer/label/base_plate.rb b/lib/label_printer/label_printer/label/base_plate.rb
index 605995fcfc..725b5030ec 100644
--- a/lib/label_printer/label_printer/label/base_plate.rb
+++ b/lib/label_printer/label_printer/label/base_plate.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
module LabelPrinter
module Label
- class BasePlate # rubocop:todo Style/Documentation
+ class BasePlate
include Label::MultipleLabels
def build_label(plate)
diff --git a/lib/label_printer/label_printer/label/base_plate_double.rb b/lib/label_printer/label_printer/label/base_plate_double.rb
index 74d5b263ee..0e230a434e 100644
--- a/lib/label_printer/label_printer/label/base_plate_double.rb
+++ b/lib/label_printer/label_printer/label/base_plate_double.rb
@@ -4,7 +4,7 @@
module LabelPrinter
module Label
- class BasePlateDouble # rubocop:todo Style/Documentation
+ class BasePlateDouble
include Label::MultipleDoubleLabels
def barcode(plate)
diff --git a/lib/label_printer/label_printer/label/base_tube.rb b/lib/label_printer/label_printer/label/base_tube.rb
index dcf60bf7ac..1799fdb95a 100644
--- a/lib/label_printer/label_printer/label/base_tube.rb
+++ b/lib/label_printer/label_printer/label/base_tube.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
module LabelPrinter
module Label
- class BaseTube # rubocop:todo Style/Documentation
+ class BaseTube
include Label::MultipleLabels
def build_label(tube)
diff --git a/lib/label_printer/label_printer/label/batch_plate.rb b/lib/label_printer/label_printer/label/batch_plate.rb
index 607b6f6c5b..48b0283b9e 100644
--- a/lib/label_printer/label_printer/label/batch_plate.rb
+++ b/lib/label_printer/label_printer/label/batch_plate.rb
@@ -4,7 +4,7 @@
module LabelPrinter
module Label
- class BatchPlate < BasePlate # rubocop:todo Style/Documentation
+ class BatchPlate < BasePlate
include Label::BatchPlates
attr_reader :count, :printable, :batch
diff --git a/lib/label_printer/label_printer/label/batch_plate_double.rb b/lib/label_printer/label_printer/label/batch_plate_double.rb
index 37939a2ffe..1d9eb1aea4 100644
--- a/lib/label_printer/label_printer/label/batch_plate_double.rb
+++ b/lib/label_printer/label_printer/label/batch_plate_double.rb
@@ -5,7 +5,7 @@
module LabelPrinter
module Label
- class BatchPlateDouble < BasePlateDouble # rubocop:todo Style/Documentation
+ class BatchPlateDouble < BasePlateDouble
include Label::BatchPlates
attr_reader :count, :printable, :batch
diff --git a/lib/label_printer/label_printer/label/batch_redirect.rb b/lib/label_printer/label_printer/label/batch_redirect.rb
index 0eedd9af47..cab6fd96ac 100644
--- a/lib/label_printer/label_printer/label/batch_redirect.rb
+++ b/lib/label_printer/label_printer/label/batch_redirect.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
module LabelPrinter
module Label
- class BatchRedirect # rubocop:todo Style/Documentation
+ class BatchRedirect
attr_reader :options
def initialize(options)
diff --git a/lib/label_printer/label_printer/label/batch_tube.rb b/lib/label_printer/label_printer/label/batch_tube.rb
index 9082760b90..e188a35bf7 100644
--- a/lib/label_printer/label_printer/label/batch_tube.rb
+++ b/lib/label_printer/label_printer/label/batch_tube.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
module LabelPrinter
module Label
- class BatchTube < BaseTube # rubocop:todo Style/Documentation
+ class BatchTube < BaseTube
attr_reader :count, :printable, :batch, :stock
def initialize(options)
diff --git a/lib/label_printer/label_printer/label/multiplexed_tube.rb b/lib/label_printer/label_printer/label/multiplexed_tube.rb
index 47720c5ca1..77405ef644 100644
--- a/lib/label_printer/label_printer/label/multiplexed_tube.rb
+++ b/lib/label_printer/label_printer/label/multiplexed_tube.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
module LabelPrinter
module Label
- class MultiplexedTube < BaseTube # rubocop:todo Style/Documentation
+ class MultiplexedTube < BaseTube
attr_reader :tubes
def initialize(options)
diff --git a/lib/label_printer/label_printer/label/plate_creator.rb b/lib/label_printer/label_printer/label/plate_creator.rb
index 4dbd3e045a..7e9b75d766 100644
--- a/lib/label_printer/label_printer/label/plate_creator.rb
+++ b/lib/label_printer/label_printer/label/plate_creator.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
module LabelPrinter
module Label
- class PlateCreator < BasePlate # rubocop:todo Style/Documentation
+ class PlateCreator < BasePlate
attr_reader :plates, :plate_purpose, :user_login
def initialize(options)
diff --git a/lib/label_printer/label_printer/label/plate_to_tubes.rb b/lib/label_printer/label_printer/label/plate_to_tubes.rb
index 38aa1a05a4..dbe89ce4a2 100644
--- a/lib/label_printer/label_printer/label/plate_to_tubes.rb
+++ b/lib/label_printer/label_printer/label/plate_to_tubes.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
module LabelPrinter
module Label
- class PlateToTubes < BaseTube # rubocop:todo Style/Documentation
+ class PlateToTubes < BaseTube
attr_reader :tubes
def initialize(options)
diff --git a/lib/label_printer/label_printer/label/robot_beds.rb b/lib/label_printer/label_printer/label/robot_beds.rb
index 6588708397..f2558c2cd5 100644
--- a/lib/label_printer/label_printer/label/robot_beds.rb
+++ b/lib/label_printer/label_printer/label/robot_beds.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
module LabelPrinter
module Label
- class RobotBeds < BasePlate # rubocop:todo Style/Documentation
+ class RobotBeds < BasePlate
attr_reader :plates
def initialize(beds)
diff --git a/lib/label_printer/label_printer/label/sample_manifest_multiplex.rb b/lib/label_printer/label_printer/label/sample_manifest_multiplex.rb
index 05e44a9a04..4c39701709 100644
--- a/lib/label_printer/label_printer/label/sample_manifest_multiplex.rb
+++ b/lib/label_printer/label_printer/label/sample_manifest_multiplex.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
module LabelPrinter
module Label
- class SampleManifestMultiplex < BaseTube # rubocop:todo Style/Documentation
+ class SampleManifestMultiplex < BaseTube
attr_reader :sample_manifest
def initialize(options)
diff --git a/lib/label_printer/label_printer/label/sample_manifest_plate.rb b/lib/label_printer/label_printer/label/sample_manifest_plate.rb
index 6bc9818066..7a99397d44 100644
--- a/lib/label_printer/label_printer/label/sample_manifest_plate.rb
+++ b/lib/label_printer/label_printer/label/sample_manifest_plate.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
module LabelPrinter
module Label
- class SampleManifestPlate < BasePlate # rubocop:todo Style/Documentation
+ class SampleManifestPlate < BasePlate
attr_reader :sample_manifest, :only_first_label
def initialize(options)
diff --git a/lib/label_printer/label_printer/label/sample_manifest_plate_double.rb b/lib/label_printer/label_printer/label/sample_manifest_plate_double.rb
index 6a6b46b114..f5a8a348dc 100644
--- a/lib/label_printer/label_printer/label/sample_manifest_plate_double.rb
+++ b/lib/label_printer/label_printer/label/sample_manifest_plate_double.rb
@@ -4,7 +4,7 @@
module LabelPrinter
module Label
- class SampleManifestPlateDouble < BasePlateDouble # rubocop:todo Style/Documentation
+ class SampleManifestPlateDouble < BasePlateDouble
attr_reader :sample_manifest, :only_first_label
def initialize(options)
diff --git a/lib/label_printer/label_printer/label/sample_manifest_redirect.rb b/lib/label_printer/label_printer/label/sample_manifest_redirect.rb
index 52d5ec7471..21f335e8fb 100644
--- a/lib/label_printer/label_printer/label/sample_manifest_redirect.rb
+++ b/lib/label_printer/label_printer/label/sample_manifest_redirect.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
module LabelPrinter
module Label
- class SampleManifestRedirect # rubocop:todo Style/Documentation
+ class SampleManifestRedirect
attr_reader :options, :sample_manifest
def initialize(options)
diff --git a/lib/label_printer/label_printer/label/sample_manifest_tube.rb b/lib/label_printer/label_printer/label/sample_manifest_tube.rb
index 092ccff027..9158f8fa9b 100644
--- a/lib/label_printer/label_printer/label/sample_manifest_tube.rb
+++ b/lib/label_printer/label_printer/label/sample_manifest_tube.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
module LabelPrinter
module Label
- class SampleManifestTube < BaseTube # rubocop:todo Style/Documentation
+ class SampleManifestTube < BaseTube
attr_reader :sample_manifest, :only_first_label
def initialize(options)
diff --git a/lib/label_printer/label_printer/label/swipecard.rb b/lib/label_printer/label_printer/label/swipecard.rb
index 258fb2790a..c754c8555a 100644
--- a/lib/label_printer/label_printer/label/swipecard.rb
+++ b/lib/label_printer/label_printer/label/swipecard.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
module LabelPrinter
module Label
- class Swipecard # rubocop:todo Style/Documentation
+ class Swipecard
def initialize(attributes)
@swipecard = attributes[:swipecard]
@user_login = attributes[:user_login]
diff --git a/lib/label_printer/label_printer/multiple_double_labels.rb b/lib/label_printer/label_printer/multiple_double_labels.rb
index f0fb08ae59..a8841c2d9e 100644
--- a/lib/label_printer/label_printer/multiple_double_labels.rb
+++ b/lib/label_printer/label_printer/multiple_double_labels.rb
@@ -2,7 +2,7 @@
module LabelPrinter
module Label
- module MultipleDoubleLabels # rubocop:todo Style/Documentation
+ module MultipleDoubleLabels
include MultipleLabels
def create_labels
diff --git a/lib/label_printer/label_printer/pmb_client.rb b/lib/label_printer/label_printer/pmb_client.rb
index d48dd13dcf..d97445c38b 100644
--- a/lib/label_printer/label_printer/pmb_client.rb
+++ b/lib/label_printer/label_printer/pmb_client.rb
@@ -4,7 +4,7 @@
module LabelPrinter
PmbException = Class.new(StandardError)
- class PmbClient # rubocop:todo Style/Documentation
+ class PmbClient
def self.base_url
configatron.pmb_api
end
@@ -63,14 +63,16 @@ def self.get_label_template_by_name(name)
def self.register_printer(name, printer_type)
unless printer_exists?(name)
- RestClient.post printers_url,
- { 'data' => { 'attributes' => { 'name' => name, 'printer_type' => printer_type } } }.to_json,
- headers
+ RestClient.post(
+ printers_url,
+ { 'data' => { 'attributes' => { 'name' => name, 'printer_type' => printer_type } } }.to_json,
+ **headers
+ )
end
end
def self.printer_exists?(name)
- response = JSON.parse(RestClient.get "#{printers_filter_url}#{name}", headers)
+ response = JSON.parse(RestClient.get("#{printers_filter_url}#{name}", **headers))
response['data'].present?
end
diff --git a/lib/label_printer/label_printer/print_job.rb b/lib/label_printer/label_printer/print_job.rb
index 2b575118de..15d6fed08f 100644
--- a/lib/label_printer/label_printer/print_job.rb
+++ b/lib/label_printer/label_printer/print_job.rb
@@ -2,7 +2,7 @@
# require 'pmb_client'
module LabelPrinter
- class PrintJob # rubocop:todo Style/Documentation
+ class PrintJob
include ActiveModel::Validations
attr_reader :printer_name, :label_class, :options, :labels
diff --git a/lib/limber/helper.rb b/lib/limber/helper.rb
index b93b4e7606..2ba0e325ef 100644
--- a/lib/limber/helper.rb
+++ b/lib/limber/helper.rb
@@ -3,7 +3,7 @@
# Helper templates and methods used in limber.rake
module Limber::Helper
PIPELINE = 'Limber-Htp'
- PIPELINE_REGEX = /Illumina-[A-z]+ /.freeze
+ PIPELINE_REGEX = /Illumina-[A-z]+ /
PRODUCTLINE = 'Illumina-Htp'
# Construct submission templates for the Limber pipeline
diff --git a/lib/manifest_util.rb b/lib/manifest_util.rb
index 9f10583f8d..e810d7a622 100644
--- a/lib/manifest_util.rb
+++ b/lib/manifest_util.rb
@@ -1,5 +1,5 @@
# frozen_string_literal: true
-module ManifestUtil # rubocop:todo Style/Documentation
+module ManifestUtil
def is_end_of_header?(row, pos)
((pos != (row.length - 1)) && row[pos].blank? && row[pos + 1].blank?)
end
diff --git a/lib/product_helpers.rb b/lib/product_helpers.rb
index d0f4bcb94b..5c6be42db6 100644
--- a/lib/product_helpers.rb
+++ b/lib/product_helpers.rb
@@ -1,5 +1,5 @@
# frozen_string_literal: true
-module ProductHelpers # rubocop:todo Style/Documentation
+module ProductHelpers
def self.single_template(name)
{ name: name, selection_behaviour: 'SingleProduct', products: { nil => name } }
end
diff --git a/lib/psd_formatter.rb b/lib/psd_formatter.rb
index 7b7cc64779..4d661bdf6d 100644
--- a/lib/psd_formatter.rb
+++ b/lib/psd_formatter.rb
@@ -3,7 +3,7 @@
require 'syslog/logger'
require 'ostruct'
-class PsdFormatter < Syslog::Logger::Formatter # rubocop:todo Style/Documentation
+class PsdFormatter < Syslog::Logger::Formatter
LINE_FORMAT = "(thread-%s) [%s] %5s -- : %s\n".freeze
def initialize(deployment_info)
diff --git a/lib/record_loader/plate_purpose_loader.rb b/lib/record_loader/plate_purpose_loader.rb
index 3e4c22960a..c9cc8e8c5a 100644
--- a/lib/record_loader/plate_purpose_loader.rb
+++ b/lib/record_loader/plate_purpose_loader.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
module RecordLoader
- class PlatePurposeLoader < ApplicationRecordLoader # rubocop:todo Style/Documentation
+ class PlatePurposeLoader < ApplicationRecordLoader
config_folder 'plate_purposes'
DEFAULT_PRINTER_TYPE = '96 Well Plate'
diff --git a/lib/request_class_deprecator.rb b/lib/request_class_deprecator.rb
index 4d1811da0b..afd0469c17 100644
--- a/lib/request_class_deprecator.rb
+++ b/lib/request_class_deprecator.rb
@@ -9,7 +9,7 @@
# state_change: Hash of from_state => to_state applied to affected requests
# }
module RequestClassDeprecator
- class Request < ApplicationRecord # rubocop:todo Style/Documentation
+ class Request < ApplicationRecord
self.table_name = 'requests'
end
@@ -26,7 +26,7 @@ def deprecate_class(request_class_name, options = {}) # rubocop:todo Metrics/Abc
ActiveRecord::Base.transaction do
RequestType
.where(request_class_name: request_class_name)
- .each do |rt|
+ .find_each do |rt|
say "Deprecating: #{rt.name}"
rt.update!(deprecated: true)
diff --git a/lib/request_type_purpose_creation.rb b/lib/request_type_purpose_creation.rb
index 1e52de5db6..5479da7dd1 100644
--- a/lib/request_type_purpose_creation.rb
+++ b/lib/request_type_purpose_creation.rb
@@ -1,5 +1,5 @@
# frozen_string_literal: true
-module RequestTypePurposeCreation # rubocop:todo Style/Documentation
+module RequestTypePurposeCreation
def add_request_purpose
self.request_purpose = :standard
self
diff --git a/lib/sequencing_qc_batch.rb b/lib/sequencing_qc_batch.rb
index 42475df464..12bda0b1e5 100644
--- a/lib/sequencing_qc_batch.rb
+++ b/lib/sequencing_qc_batch.rb
@@ -51,7 +51,7 @@ def self.adjacent_state_helper(direction, offset, delimiter) # rubocop:todo Metr
end
return nil if qc_state.to_s == qc_states.send(delimiter)
- return qc_states[qc_states.index(qc_state.to_s) + offset]
+ qc_states[qc_states.index(qc_state.to_s) + offset]
end
end
diff --git a/lib/submission_serializer.rb b/lib/submission_serializer.rb
index 4073f7ccb6..10f3c9cfad 100644
--- a/lib/submission_serializer.rb
+++ b/lib/submission_serializer.rb
@@ -14,7 +14,7 @@
# }
# }
-module SubmissionSerializer # rubocop:todo Style/Documentation
+module SubmissionSerializer
STRAIGHT_CLONE = %w[name submission_class_name].freeze
SP_STRAIGHT_CLONE = %i[info_differential asset_input_methods request_options].freeze
diff --git a/lib/tasks/add_templates_and_printers_to_pmb.rake b/lib/tasks/add_templates_and_printers_to_pmb.rake
index 35f895ebdd..19aa80741c 100644
--- a/lib/tasks/add_templates_and_printers_to_pmb.rake
+++ b/lib/tasks/add_templates_and_printers_to_pmb.rake
@@ -4,7 +4,7 @@ require_relative '../../config/config'
namespace :pmb do
task add_label_templates: :environment do
- class LabelTemplateCreator # rubocop:todo Style/Documentation
+ class LabelTemplateCreator
attr_accessor :label_types
class << self
diff --git a/lib/tasks/create_mbrave_tags.rake b/lib/tasks/create_mbrave_tags.rake
index 5aa190cb3b..7be603b031 100644
--- a/lib/tasks/create_mbrave_tags.rake
+++ b/lib/tasks/create_mbrave_tags.rake
@@ -58,7 +58,7 @@ namespace :mbrave do
version = args[:version]
tag_layout_templates =
- TagLayoutTemplate.all.select do |template|
+ TagLayoutTemplate.select do |template|
template.name.match(Regexp.new("^Bioscan_384_template_(\\d+)_#{version}$"))
end
diff --git a/lib/tasks/cucumber.rake b/lib/tasks/cucumber.rake
index 4981bf6f5a..d0225d86a0 100644
--- a/lib/tasks/cucumber.rake
+++ b/lib/tasks/cucumber.rake
@@ -41,19 +41,11 @@ unless ARGV.any? { |a| a =~ /^gems/ }
task statsetup: :environment do
require 'rails/code_statistics'
- ::STATS_DIRECTORIES << %w[Cucumber\ features features] if File.exist?('features')
- ::CodeStatistics::TEST_TYPES << 'Cucumber features' if File.exist?('features')
- end
-
- task annotations_setup: :environment do
- Rails.application.configure do
- if config.respond_to?(:annotations)
- config.annotations.directories << 'features'
- config.annotations.register_extensions('feature') { |tag| /#\s*(#{tag}):?\s*(.*)$/ }
- end
- end
+ STATS_DIRECTORIES << %w[Cucumber\ features features] if File.exist?('features')
+ CodeStatistics::TEST_TYPES << 'Cucumber features' if File.exist?('features')
end
end
+
desc 'Alias for cucumber:ok'
task cucumber: 'cucumber:ok'
@@ -68,8 +60,6 @@ unless ARGV.any? { |a| a =~ /^gems/ }
end
task stats: 'cucumber:statsetup'
-
- task notes: 'cucumber:annotations_setup'
rescue LoadError
desc 'cucumber rake task not available (cucumber not installed)'
task cucumber: :environment do
diff --git a/lib/tasks/jsorm.rake b/lib/tasks/jsorm.rake
index 0d31de2e50..1d44d77d4a 100644
--- a/lib/tasks/jsorm.rake
+++ b/lib/tasks/jsorm.rake
@@ -37,7 +37,7 @@ namespace :jsorm do
resource = Api::V2.const_get(resource_key)
next unless resource < Api::V2::BaseResource
- name = resource_key.to_s.gsub(/Resource/, '')
+ name = resource_key.to_s.gsub('Resource', '')
type = resource._type
puts " #{name}: ApplicationRecord.extend({"
puts " static: { jsonapiType: '#{type}' },"
diff --git a/lib/tasks/rebroadcast_pac_bio_multiple_requests_run.rake b/lib/tasks/rebroadcast_pac_bio_multiple_requests_run.rake
index d359a30f7b..1b598d6ddf 100644
--- a/lib/tasks/rebroadcast_pac_bio_multiple_requests_run.rake
+++ b/lib/tasks/rebroadcast_pac_bio_multiple_requests_run.rake
@@ -191,6 +191,6 @@ namespace :pac_bio_run do
9993
]
- Messenger.where(template: 'PacBioRunIO', target_id: list_of_runs).each(&:broadcast)
+ Messenger.where(template: 'PacBioRunIO', target_id: list_of_runs).find_each(&:broadcast)
end
end
diff --git a/lib/tasks/sequencing.rake b/lib/tasks/sequencing.rake
index 288047fce3..14a624b30a 100644
--- a/lib/tasks/sequencing.rake
+++ b/lib/tasks/sequencing.rake
@@ -6,10 +6,10 @@ namespace :sequencing do
desc 'Run to update descriptors. Can be removed once run'
task update_descriptors: :environment do
- Descriptor.where(name: 'Operator').each(&:destroy)
+ Descriptor.where(name: 'Operator').find_each(&:destroy)
Task
.where(workflow: Workflow.where(name: 'NovaSeq 6000 PE'), name: 'Read 1 & 2')
- .each { |task| task.descriptors.where(name: 'Pipette Carousel').each(&:destroy) }
+ .find_each { |task| task.descriptors.where(name: 'Pipette Carousel').find_each(&:destroy) }
end
task 'application:post_deploy' => 'sequencing:update_descriptors'
diff --git a/lib/tasks/support/update_library_types.rake b/lib/tasks/support/update_library_types.rake
index 2989a86c00..90cb4510e9 100644
--- a/lib/tasks/support/update_library_types.rake
+++ b/lib/tasks/support/update_library_types.rake
@@ -30,7 +30,7 @@ namespace :support do
lane.aliquots.each do |aliquot|
Aliquot
.where(library_id: aliquot.library_id)
- .each do |ali|
+ .find_each do |ali|
ali.library_type = new_library_type.name
ali.save!
record_count += 1
diff --git a/lib/validateable.rb b/lib/validateable.rb
index 77177c5712..08c6010541 100644
--- a/lib/validateable.rb
+++ b/lib/validateable.rb
@@ -1,5 +1,5 @@
# frozen_string_literal: true
-module Validateable # rubocop:todo Style/Documentation
+module Validateable
%i[save save! update_attribute].each { |attr| define_method(attr) {} }
def method_missing(symbol, *_params)
@@ -16,7 +16,7 @@ def validate!
raise(ActiveRecord::RecordInvalid, self) unless valid?
end
- module ClassMethods # rubocop:todo Style/Documentation
+ module ClassMethods
def self_and_descendants_from_active_record
[self]
end
@@ -31,7 +31,7 @@ def human_attribute_name(attribute_key_name, options = {}) # rubocop:todo Metric
defaults.flatten!
defaults << attribute_key_name.to_s.humanize
options[:count] ||= 1
- I18n.t(defaults.shift, options.merge(default: defaults, scope: %i[activerecord attributes]))
+ I18n.t(defaults.shift, **options.merge(default: defaults, scope: %i[activerecord attributes]))
end
def human_name(options = {})
diff --git a/lib/views_schema.rb b/lib/views_schema.rb
index 3055242dc5..88f2e868e9 100644
--- a/lib/views_schema.rb
+++ b/lib/views_schema.rb
@@ -32,8 +32,8 @@ module ViewsSchema
# rubocop:todo Layout/LineLength
REGEXP = /\ACREATE ALGORITHM=(?
\w*) DEFINER=`[^`]*`@`[^`]*` SQL SECURITY (?\w*) VIEW `[^`]+` AS (?.*)\z/i
- # rubocop:enable Layout/LineLength
- .freeze
+
+ # rubocop:enable Layout/LineLength
def self.each_view
all_views.each do |name|
diff --git a/lib/working_setup/standard_seeder.rb b/lib/working_setup/standard_seeder.rb
index 8458bbaace..b06fc2ea9f 100644
--- a/lib/working_setup/standard_seeder.rb
+++ b/lib/working_setup/standard_seeder.rb
@@ -37,7 +37,7 @@ def supplier
end
def seed
- Sample.all.each { |s| study_b.samples << s }
+ Sample.find_each { |s| study_b.samples << s }
create_purposes
Robot
diff --git a/script/spec b/script/spec
index c9deb5f054..b8f14c700e 100755
--- a/script/spec
+++ b/script/spec
@@ -8,4 +8,4 @@ else
require File.expand_path(File.dirname(__FILE__) + '/../config/environment') unless defined?(Rails.root)
end
require 'spec/autorun'
-exit ::Spec::Runner::CommandLine.run
+exit Spec::Runner::CommandLine.run
diff --git a/script/support/.rubocop.yml b/script/support/.rubocop.yml
index 876c3922fe..f37145aea9 100644
--- a/script/support/.rubocop.yml
+++ b/script/support/.rubocop.yml
@@ -1,2 +1,5 @@
inherit_from: .rubocop_todo.yml
require: rubocop-rails
+
+Style/Documentation:
+ Enabled: false
diff --git a/spec/api/state_change_spec.rb b/spec/api/state_change_spec.rb
index c348d96c7f..2e21b88ebe 100644
--- a/spec/api/state_change_spec.rb
+++ b/spec/api/state_change_spec.rb
@@ -49,13 +49,13 @@
before { api_request :post, subject, payload }
- it 'supports resource creation', aggregate_failures: true do
+ it 'supports resource creation', :aggregate_failures do
expect(JSON.parse(response.body)).to include_json(JSON.parse(response_body))
expect(status).to eq(response_code)
end
# This probably best belongs on a unit test. Just porting current feature tests for now.
- it 'transitions the selected well only', aggregate_failures: true do
+ it 'transitions the selected well only', :aggregate_failures do
all_wells = target_plate.maps.pluck(:description)
affected_wells = contents || all_wells
unaffected_wells = all_wells - affected_wells
@@ -81,7 +81,7 @@
before { api_request :post, subject, payload }
- it 'errors on resource creation', aggregate_failures: true do
+ it 'errors on resource creation', :aggregate_failures do
expect(JSON.parse(response.body)).to include_json(JSON.parse(response_body))
expect(status).to eq(response_code)
end
diff --git a/spec/api/transfer_request_collection_spec.rb b/spec/api/transfer_request_collection_spec.rb
index bb10f3dcc2..699f75d514 100644
--- a/spec/api/transfer_request_collection_spec.rb
+++ b/spec/api/transfer_request_collection_spec.rb
@@ -3,7 +3,7 @@
require 'rails_helper'
require 'shared_contexts/limber_shared_context'
-describe '/api/1/transfer_request_collection', transfer_request_collection: true do
+describe '/api/1/transfer_request_collection', :transfer_request_collection do
include_context 'a limber target plate with submissions'
subject { '/api/1/transfer_request_collection' }
diff --git a/spec/bulk_submission_excel/bulk_submission_excel_spec.rb b/spec/bulk_submission_excel/bulk_submission_excel_spec.rb
index 8f4ecf0256..328bb3a544 100644
--- a/spec/bulk_submission_excel/bulk_submission_excel_spec.rb
+++ b/spec/bulk_submission_excel/bulk_submission_excel_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-RSpec.describe BulkSubmissionExcel, bulk_submission_excel: true, type: :model do
+RSpec.describe BulkSubmissionExcel, :bulk_submission_excel, type: :model do
before do
described_class.configure do |config|
config.folder = File.join('spec', 'data', 'bulk_submission_excel')
diff --git a/spec/bulk_submission_excel/configuration_spec.rb b/spec/bulk_submission_excel/configuration_spec.rb
index 0bd8faf894..0378de7513 100644
--- a/spec/bulk_submission_excel/configuration_spec.rb
+++ b/spec/bulk_submission_excel/configuration_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-RSpec.describe BulkSubmissionExcel::Configuration, bulk_submission_excel: true, type: :model do
+RSpec.describe BulkSubmissionExcel::Configuration, :bulk_submission_excel, type: :model do
let(:configuration) { described_class.new }
it 'is comparable' do
diff --git a/spec/bulk_submission_excel/data_worksheet_spec.rb b/spec/bulk_submission_excel/data_worksheet_spec.rb
index 0d30e018d1..b5b03206e4 100644
--- a/spec/bulk_submission_excel/data_worksheet_spec.rb
+++ b/spec/bulk_submission_excel/data_worksheet_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-RSpec.describe BulkSubmissionExcel::Worksheet::DataWorksheet, bulk_submission_excel: true, type: :model do
+RSpec.describe BulkSubmissionExcel::Worksheet::DataWorksheet, :bulk_submission_excel, type: :model do
let(:xls) { Axlsx::Package.new }
let(:workbook) { xls.workbook }
let(:test_file) { 'test.xlsx' }
diff --git a/spec/bulk_submission_excel/download_spec.rb b/spec/bulk_submission_excel/download_spec.rb
index 521c5a4195..52375e7a63 100644
--- a/spec/bulk_submission_excel/download_spec.rb
+++ b/spec/bulk_submission_excel/download_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-RSpec.describe BulkSubmissionExcel::Download, bulk_submission_excel: true, type: :model do
+RSpec.describe BulkSubmissionExcel::Download, :bulk_submission_excel, type: :model do
attr_reader :download, :spreadsheet
let(:test_file) { 'test.xlsx' }
@@ -75,7 +75,7 @@
end
it 'have the correct number of columns' do
- expect(download.column_list.count).to eq(configuration.columns.all.count)
+ expect(download.column_list.count).to eq(configuration.columns.count)
end
describe 'with requested_flowcell_type column' do
diff --git a/spec/controllers/api/v2/heron/plates_controller_spec.rb b/spec/controllers/api/v2/heron/plates_controller_spec.rb
index f544629669..2298b4f593 100644
--- a/spec/controllers/api/v2/heron/plates_controller_spec.rb
+++ b/spec/controllers/api/v2/heron/plates_controller_spec.rb
@@ -3,7 +3,7 @@
require 'rails_helper'
require 'support/barcode_helper'
-RSpec.describe Api::V2::Heron::PlatesController, heron: true, type: :request do
+RSpec.describe Api::V2::Heron::PlatesController, :heron, type: :request do
include BarcodeHelper
let(:stock_plate_purpose) { PlatePurpose.stock_plate_purpose }
diff --git a/spec/controllers/api/v2/heron/tube_racks_controller_spec.rb b/spec/controllers/api/v2/heron/tube_racks_controller_spec.rb
index 3256916ebb..94e8df454b 100644
--- a/spec/controllers/api/v2/heron/tube_racks_controller_spec.rb
+++ b/spec/controllers/api/v2/heron/tube_racks_controller_spec.rb
@@ -3,7 +3,7 @@
require 'rails_helper'
require 'support/barcode_helper'
-RSpec.describe Api::V2::Heron::TubeRacksController, heron: true, type: :request do
+RSpec.describe Api::V2::Heron::TubeRacksController, :heron, type: :request do
include BarcodeHelper
let!(:purpose_96) { create(:tube_rack_purpose, target_type: 'TubeRack', size: 96) }
diff --git a/spec/controllers/labwhere_receptions_controller_spec.rb b/spec/controllers/labwhere_receptions_controller_spec.rb
index 633e576621..85636935c0 100644
--- a/spec/controllers/labwhere_receptions_controller_spec.rb
+++ b/spec/controllers/labwhere_receptions_controller_spec.rb
@@ -11,7 +11,7 @@
shared_examples 'a reception' do
before do
- expect(LabWhereClient::Scan).to receive(:create) # rubocop:todo RSpec/ExpectInHook
+ expect(LabWhereClient::Scan).to receive(:create)
.with(
location_barcode: location_barcode,
user_code: SBCF::SangerBarcode.from_human(user.barcode).machine_barcode.to_s,
diff --git a/spec/controllers/npg_actions/assets_controller_spec.rb b/spec/controllers/npg_actions/assets_controller_spec.rb
index 64e0e874dc..0dbae5b567 100644
--- a/spec/controllers/npg_actions/assets_controller_spec.rb
+++ b/spec/controllers/npg_actions/assets_controller_spec.rb
@@ -36,7 +36,7 @@
before { post '/login', params: { login: user.login, password: 'password' } }
shared_examples 'a passed state change' do
- it 'renders and creates events', aggregate_failures: true do
+ it 'renders and creates events', :aggregate_failures do
# Response
expect(response).to have_http_status(:ok)
expect(response).to render_template :'assets/show.xml.builder'
@@ -61,7 +61,7 @@
end
shared_examples 'a failed state change' do
- it 'renders and creates events', aggregate_failures: true do
+ it 'renders and creates events', :aggregate_failures do
# Response
expect(response).to render_template :'assets/show.xml.builder'
expect(response.body).to match(expected_response_content)
@@ -266,7 +266,7 @@
lane.reload
end
- it 'renders and but does not recreate the events', aggregate_failures: true do
+ it 'renders and but does not recreate the events', :aggregate_failures do
# Response
expect(response).to have_http_status(:ok)
expect(response).to render_template :'assets/show.xml.builder'
diff --git a/spec/controllers/phi_x/spiked_buffers_controller_spec.rb b/spec/controllers/phi_x/spiked_buffers_controller_spec.rb
index 4a07e5e3d3..ba17b3ee01 100644
--- a/spec/controllers/phi_x/spiked_buffers_controller_spec.rb
+++ b/spec/controllers/phi_x/spiked_buffers_controller_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-RSpec.describe PhiX::SpikedBuffersController, phi_x: true do
+RSpec.describe PhiX::SpikedBuffersController, :phi_x do
describe 'POST create' do
let(:current_user) { create :user }
let(:library_tube) { create :phi_x_stock_tube, name: 'PhiX Stock' }
diff --git a/spec/controllers/phi_x/stocks_controller_spec.rb b/spec/controllers/phi_x/stocks_controller_spec.rb
index fb61cedf6a..912fe76a3e 100644
--- a/spec/controllers/phi_x/stocks_controller_spec.rb
+++ b/spec/controllers/phi_x/stocks_controller_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-RSpec.describe PhiX::StocksController, phi_x: true do
+RSpec.describe PhiX::StocksController, :phi_x do
describe 'POST create' do
let(:current_user) { create :user }
let(:study) { create :study }
diff --git a/spec/controllers/phi_xes_controller_spec.rb b/spec/controllers/phi_xes_controller_spec.rb
index e96a80196d..0e38077378 100644
--- a/spec/controllers/phi_xes_controller_spec.rb
+++ b/spec/controllers/phi_xes_controller_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-RSpec.describe PhiXesController, phi_x: true do
+RSpec.describe PhiXesController, :phi_x do
describe 'GET show' do
let(:current_user) { create :user }
diff --git a/spec/controllers/sequenom_qc_plates_controller_spec.rb b/spec/controllers/sequenom_qc_plates_controller_spec.rb
index f1fc435a1f..baa03245c6 100644
--- a/spec/controllers/sequenom_qc_plates_controller_spec.rb
+++ b/spec/controllers/sequenom_qc_plates_controller_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-RSpec.describe SequenomQcPlatesController, phi_x: true do
+RSpec.describe SequenomQcPlatesController, :phi_x do
describe 'GET index' do
let(:current_user) { create :user }
diff --git a/spec/controllers/studies_controller_spec.rb b/spec/controllers/studies_controller_spec.rb
index 5c2d5ae2f2..430b9c45ad 100644
--- a/spec/controllers/studies_controller_spec.rb
+++ b/spec/controllers/studies_controller_spec.rb
@@ -55,7 +55,7 @@
end
it 'changes Study.count by 1' do
- assert_equal 1, Study.count - @study_count
+ expect(Study.count - @study_count).to eq(1)
end
end
@@ -73,7 +73,7 @@
end
it 'not change Study.count' do
- assert_equal @initial_study_count, Study.count
+ expect(Study.count).to eq(@initial_study_count)
end
end
end
diff --git a/spec/controllers/submissions_controller_spec.rb b/spec/controllers/submissions_controller_spec.rb
index 160572f553..63efe6562e 100644
--- a/spec/controllers/submissions_controller_spec.rb
+++ b/spec/controllers/submissions_controller_spec.rb
@@ -47,7 +47,7 @@
end
it 'allow update of priorities' do
- assert_equal 3, @submission.reload.priority
+ expect(@submission.reload.priority).to eq(3)
end
end
@@ -136,7 +136,7 @@
end
it 'create the appropriate orders' do
- assert_equal 4, Order.first.assets.count
+ expect(Order.first.assets.count).to eq(4)
end
context 'with a more recent plate' do
@@ -173,8 +173,8 @@
# Return an empty hash if we have no hits, makes the test failures clearer.
per_plate.default = []
- assert_equal 1, per_plate[@new_plate].count
- assert_equal 3, per_plate[@plate].count
+ expect(per_plate[@new_plate].count).to eq(1)
+ expect(per_plate[@plate].count).to eq(3)
end
end
end
@@ -215,7 +215,7 @@
end
it 'used the working dilution plate' do
- assert_equal 1, Order.count - @order_count
+ expect(Order.count - @order_count).to eq(1)
wells = Order.last.assets
@@ -232,7 +232,7 @@
it 'create the appropriate orders' do
assert Order.first.present?, 'No order was created!'
- assert_equal 9, Order.first.assets.count
+ expect(Order.first.assets.count).to eq(9)
end
end
@@ -243,7 +243,7 @@
end
it 'create the appropriate orders' do
- assert_equal 9, Order.first.assets.count
+ expect(Order.first.assets.count).to eq(9)
end
end
@@ -251,7 +251,7 @@
before { post :create, params: plate_submission('SQPD-123456:A1,B3,C2') }
it 'create the appropriate orders' do
- assert_equal 3, Order.first.assets.count
+ expect(Order.first.assets.count).to eq(3)
end
end
@@ -259,7 +259,7 @@
before { post :create, params: plate_submission('SQPD-123456:B,C') }
it 'create the appropriate orders' do
- assert_equal 6, Order.first.assets.count
+ expect(Order.first.assets.count).to eq(6)
end
end
@@ -267,7 +267,7 @@
before { post :create, params: plate_submission('SQPD-123456:1,2,3') }
it 'create the appropriate orders' do
- assert_equal 9, Order.first.assets.count
+ expect(Order.first.assets.count).to eq(9)
end
end
diff --git a/spec/factories/asset_audits.rb b/spec/factories/asset_audits.rb
index 9e9ec9b40b..67d6967d0b 100644
--- a/spec/factories/asset_audits.rb
+++ b/spec/factories/asset_audits.rb
@@ -6,6 +6,6 @@
key { 'some_key' }
created_by { 'abc123' }
witnessed_by { 'jane' }
- association(:asset, factory: :labware)
+ asset factory: %i[labware]
end
end
diff --git a/spec/factories/asset_groups.rb b/spec/factories/asset_groups.rb
index b82563b597..4411d565ea 100644
--- a/spec/factories/asset_groups.rb
+++ b/spec/factories/asset_groups.rb
@@ -15,7 +15,7 @@
end
factory :asset_group_asset do
- association(:asset, factory: :receptacle)
+ asset factory: %i[receptacle]
asset_group
end
end
diff --git a/spec/factories/barcode_factories.rb b/spec/factories/barcode_factories.rb
index 0792f6b974..9699f0802d 100644
--- a/spec/factories/barcode_factories.rb
+++ b/spec/factories/barcode_factories.rb
@@ -4,7 +4,7 @@
sequence(:barcode_number) { |i| i }
factory :barcode, aliases: [:external] do
- association(:asset, factory: :labware)
+ asset factory: %i[labware]
sequence(:barcode) { |i| "EXT_#{i}_A" }
format { 'external' }
diff --git a/spec/factories/barcode_printers.rb b/spec/factories/barcode_printers.rb
index 4e7d911834..3eea0e112c 100644
--- a/spec/factories/barcode_printers.rb
+++ b/spec/factories/barcode_printers.rb
@@ -3,6 +3,6 @@
FactoryBot.define do
factory(:barcode_printer) do
sequence(:name) { |i| "a#{i}bc" }
- association(:barcode_printer_type, factory: :plate_barcode_printer_type)
+ barcode_printer_type factory: %i[plate_barcode_printer_type]
end
end
diff --git a/spec/factories/batch_factories.rb b/spec/factories/batch_factories.rb
index 373bdd4e4f..b4077ba19f 100644
--- a/spec/factories/batch_factories.rb
+++ b/spec/factories/batch_factories.rb
@@ -29,11 +29,11 @@
end
factory :multiplexed_batch do
- association(:pipeline, factory: :multiplexed_pipeline)
+ pipeline factory: %i[multiplexed_pipeline]
end
factory :sequencing_batch do
- association(:pipeline, factory: :sequencing_pipeline)
+ pipeline factory: %i[sequencing_pipeline]
end
factory :cherrypick_batch do
@@ -42,7 +42,7 @@
batch_request_factory { :cherrypick_batch_request }
request_factory { :cherrypick_request }
end
- association(:pipeline, factory: :cherrypick_pipeline)
+ pipeline factory: %i[cherrypick_pipeline]
end
end
@@ -53,7 +53,7 @@
assets { create_list(:pac_bio_library_tube, request_count) }
end
- association(:pipeline, factory: :pac_bio_sequencing_pipeline)
+ pipeline factory: %i[pac_bio_sequencing_pipeline]
after(:build) do |batch, evaluator|
evaluator.assets.each_with_index.each do |asset, index|
diff --git a/spec/factories/broadcast_event_factories.rb b/spec/factories/broadcast_event_factories.rb
index 625579aef9..03c824c3de 100644
--- a/spec/factories/broadcast_event_factories.rb
+++ b/spec/factories/broadcast_event_factories.rb
@@ -2,7 +2,7 @@
FactoryBot.define do
factory :broadcast_event_asset_audit, class: 'BroadcastEvent::AssetAudit' do
- association(:seed, factory: :asset_audit)
+ seed factory: %i[asset_audit]
end
factory :event_subject, class: Hash do
diff --git a/spec/factories/comments.rb b/spec/factories/comments.rb
index d97d581c83..b6f599ecba 100644
--- a/spec/factories/comments.rb
+++ b/spec/factories/comments.rb
@@ -3,6 +3,6 @@
FactoryBot.define do
factory :comment do
description { 'It is okay I guess' }
- association(:commentable, factory: :labware)
+ commentable factory: %i[labware]
end
end
diff --git a/spec/factories/custom_metadatum_collection_factories.rb b/spec/factories/custom_metadatum_collection_factories.rb
index 03fb2abdee..ea75323023 100644
--- a/spec/factories/custom_metadatum_collection_factories.rb
+++ b/spec/factories/custom_metadatum_collection_factories.rb
@@ -2,7 +2,7 @@
FactoryBot.define do
factory :custom_metadatum_collection do
- association(:asset, factory: :labware)
+ asset factory: %i[labware]
user
factory :custom_metadatum_collection_with_metadata do
diff --git a/spec/factories/lib_pcr_xp_factories.rb b/spec/factories/lib_pcr_xp_factories.rb
index 556001f2ea..7258eb7307 100644
--- a/spec/factories/lib_pcr_xp_factories.rb
+++ b/spec/factories/lib_pcr_xp_factories.rb
@@ -43,14 +43,14 @@
factory :lib_pool_tube, class: 'StockMultiplexedLibraryTube' do
name { |_a| FactoryBot.generate :asset_name }
- association(:purpose, factory: :illumina_htp_initial_stock_tube_purpose)
+ purpose factory: %i[illumina_htp_initial_stock_tube_purpose]
after(:create) { |tube| create(:transfer_request, target_asset: tube) }
end
factory :lib_pool_norm_tube, class: 'MultiplexedLibraryTube' do
transient { parent_tube { create :lib_pool_tube } }
name { generate :asset_name }
- association(:purpose, factory: :illumina_htp_mx_tube_purpose)
+ purpose factory: %i[illumina_htp_mx_tube_purpose]
after(:create) { |tube, factory| create(:transfer_request, asset: factory.parent_tube, target_asset: tube) }
end
end
diff --git a/spec/factories/messengers.rb b/spec/factories/messengers.rb
index 8981b18667..7e1934c6b9 100644
--- a/spec/factories/messengers.rb
+++ b/spec/factories/messengers.rb
@@ -9,12 +9,12 @@
factory :messenger do
root { 'barcode' }
- association(:target, factory: :barcode)
+ target factory: %i[barcode]
template { 'BarcodeIO' }
factory :flowcell_messenger do
root { 'flowcell' }
- association(:target, factory: :sequencing_batch)
+ target factory: %i[sequencing_batch]
template { 'FlowcellIO' }
end
end
diff --git a/spec/factories/pipelines_factories.rb b/spec/factories/pipelines_factories.rb
index 859bb74947..546a33f259 100644
--- a/spec/factories/pipelines_factories.rb
+++ b/spec/factories/pipelines_factories.rb
@@ -101,7 +101,7 @@
control_request_type_id { 0 }
min_size { 1 }
- association(:workflow, factory: :fluidigm_pipeline_workflow)
+ workflow factory: %i[fluidigm_pipeline_workflow]
after(:build) { |pipeline| pipeline.request_types << build(:well_request_type) }
end
@@ -234,12 +234,12 @@
factory :cherrypick_batch_request do
batch
- association(:request, factory: :cherrypick_request)
+ request factory: %i[cherrypick_request]
end
factory :sequencing_batch_request do
batch
- association(:request, factory: :complete_sequencing_request)
+ request factory: %i[complete_sequencing_request]
end
end
@@ -280,8 +280,8 @@
factory :asset_link do
# Asset links get annoyed if created between nodes which have
# not been persisted.
- association(:ancestor, factory: :labware, strategy: :create)
- association(:descendant, factory: :labware, strategy: :create)
+ ancestor factory: %i[labware], strategy: :create
+ descendant factory: %i[labware], strategy: :create
direct { true }
end
diff --git a/spec/factories/plate_factories.rb b/spec/factories/plate_factories.rb
index 502c1f7cc4..740929ebab 100644
--- a/spec/factories/plate_factories.rb
+++ b/spec/factories/plate_factories.rb
@@ -68,7 +68,7 @@
transient { barcode { nil } }
factory :input_plate do
- association(:plate_purpose, factory: :input_plate_purpose)
+ plate_purpose factory: %i[input_plate_purpose]
end
factory :target_plate do
@@ -196,7 +196,7 @@
end
factory :input_plate_for_pooling do
- association(:plate_purpose, factory: :input_plate_purpose)
+ plate_purpose factory: %i[input_plate_purpose]
transient do
well_count { 6 }
well_factory { :tagged_well }
@@ -204,7 +204,7 @@
end
factory :stock_plate do
- association(:plate_purpose, factory: :stock_plate_purpose)
+ plate_purpose factory: %i[stock_plate_purpose]
end
factory(:full_stock_plate) do
diff --git a/spec/factories/pulldown_factories.rb b/spec/factories/pulldown_factories.rb
index a26d4260e7..6ceea99f2f 100644
--- a/spec/factories/pulldown_factories.rb
+++ b/spec/factories/pulldown_factories.rb
@@ -20,13 +20,13 @@
# Transfers and their templates
factory(:transfer_between_plates, class: 'Transfer::BetweenPlates') do
user
- association(:source, factory: :transfer_plate)
- association(:destination, factory: :plate_with_empty_wells)
+ source factory: %i[transfer_plate]
+ destination factory: %i[plate_with_empty_wells]
transfers { { 'A1' => 'A1', 'B1' => 'B1' } }
factory(:full_transfer_between_plates) do
- association(:source, factory: :full_plate)
- association(:destination, factory: :full_plate)
+ source factory: %i[full_plate]
+ destination factory: %i[full_plate]
transfers { ('A'..'H').map { |r| (1..12).map { |c| "#{r}#{c}" } }.flatten.to_h { |w| [w, w] } }
end
end
@@ -105,8 +105,8 @@
factory(:plate_creation) do
user
barcode { create(:sequencescape22).barcode }
- association(:parent, factory: :full_plate, well_count: 2)
- association(:child_purpose, factory: :plate_purpose)
+ parent factory: %i[full_plate], well_count: 2
+ child_purpose factory: %i[plate_purpose]
# PlateCreation inherits from AssetCreation that will try to call
# Baracoda to obtain a new barcode. As this is not needed for the
@@ -116,8 +116,8 @@
factory(:tube_creation) do
user
- association(:parent, factory: :full_plate, well_count: 2)
- association(:child_purpose, factory: :child_tube_purpose)
+ parent factory: %i[full_plate], well_count: 2
+ child_purpose factory: %i[child_tube_purpose]
after(:build) do |tube_creation|
mock_request_type = create(:library_creation_request_type)
@@ -165,7 +165,7 @@
factory(:isc_request, class: 'Pulldown::Requests::IscLibraryRequest', aliases: [:pulldown_isc_request]) do
transient { bait_library { BaitLibrary.first || create(:bait_library) } }
- association(:request_type, factory: :library_creation_request_type)
+ request_type factory: %i[library_creation_request_type]
asset { |target| target.association(:well_with_sample_and_plate) }
target_asset { |target| target.association(:empty_well) }
request_purpose { :standard }
@@ -180,9 +180,9 @@
end
factory(:re_isc_request, class: 'Pulldown::Requests::ReIscLibraryRequest') do
- association(:request_type, factory: :library_request_type)
- association(:asset, factory: :well_with_sample_and_plate)
- association(:target_asset, factory: :empty_well)
+ request_type factory: %i[library_request_type]
+ asset factory: %i[well_with_sample_and_plate]
+ target_asset factory: %i[empty_well]
request_purpose { :standard }
request_metadata_attributes do
{
diff --git a/spec/factories/purpose_factories.rb b/spec/factories/purpose_factories.rb
index ee295ff358..77de1bc374 100644
--- a/spec/factories/purpose_factories.rb
+++ b/spec/factories/purpose_factories.rb
@@ -35,7 +35,7 @@
prefix { 'DN' }
name { generate :purpose_name }
size { 96 }
- association(:barcode_printer_type, factory: :plate_barcode_printer_type)
+ barcode_printer_type factory: %i[plate_barcode_printer_type]
target_type { 'Plate' }
asset_shape { AssetShape.default }
@@ -58,12 +58,12 @@
factory :fluidigm_96_purpose do
cherrypick_direction { 'interlaced_column' }
size { 96 }
- association(:asset_shape, factory: :fluidigm_96_shape)
+ asset_shape factory: %i[fluidigm_96_shape]
end
factory :fluidigm_192_purpose do
cherrypick_direction { 'interlaced_column' }
size { 192 }
- association(:asset_shape, factory: :fluidigm_192_shape)
+ asset_shape factory: %i[fluidigm_192_shape]
end
end
diff --git a/spec/factories/qc_results.rb b/spec/factories/qc_results.rb
index 5a0a118aff..3b8ad3d174 100644
--- a/spec/factories/qc_results.rb
+++ b/spec/factories/qc_results.rb
@@ -2,7 +2,7 @@
FactoryBot.define do
factory :qc_result do
- association(:asset, factory: :receptacle)
+ asset factory: %i[receptacle]
key { 'molarity' }
value { '5.43' }
units { 'nM' }
diff --git a/spec/factories/request_factories.rb b/spec/factories/request_factories.rb
index 1972e244e4..28bef29184 100644
--- a/spec/factories/request_factories.rb
+++ b/spec/factories/request_factories.rb
@@ -17,7 +17,7 @@
sti_type { 'MultiplexedLibraryCreationRequest' }
asset { |asset| asset.association(:sample_tube) }
target_asset { |asset| asset.association(:library_tube) }
- association(:request_type, factory: :multiplexed_library_creation_request_type)
+ request_type factory: %i[multiplexed_library_creation_request_type]
request_metadata_attributes do
{ fragment_size_required_from: 150, fragment_size_required_to: 400, library_type: 'Standard' }
end
@@ -41,7 +41,7 @@
factory :customer_request, class: 'CustomerRequest' do
sti_type { 'CustomerRequest' } # Oddly, this seems to be necessary!
- association(:request_type, factory: :customer_request_type)
+ request_type factory: %i[customer_request_type]
end
factory :create_asset_request do
@@ -50,20 +50,20 @@
end
factory :sequencing_request, class: 'SequencingRequest' do
- association(:request_type, factory: :sequencing_request_type)
+ request_type factory: %i[sequencing_request_type]
request_purpose { :standard }
sti_type { 'SequencingRequest' }
request_metadata_attributes { attributes_for :request_metadata_for_standard_sequencing_with_read_length }
factory(:sequencing_request_with_assets) do
- association(:asset, factory: :library_tube)
- association(:target_asset, factory: :lane)
+ asset factory: %i[library_tube]
+ target_asset factory: %i[lane]
end
factory(:complete_sequencing_request) do
transient { event_descriptors { { 'Chip Barcode' => 'fcb' } } }
- association(:asset, factory: :library_tube)
- association(:target_asset, factory: :lane)
+ asset factory: %i[library_tube]
+ target_asset factory: %i[lane]
after(:build) do |request, evaluator|
request.lab_events << build(:flowcell_event, descriptors: evaluator.event_descriptors, batch: request.batch)
@@ -72,8 +72,8 @@
end
factory(:library_creation_request, parent: :request, class: 'LibraryCreationRequest') do
- association(:asset, factory: :sample_tube)
- association(:request_type, factory: :library_creation_request_type)
+ asset factory: %i[sample_tube]
+ request_type factory: %i[library_creation_request_type]
request_metadata_attributes do
{ fragment_size_required_from: 100, fragment_size_required_to: 200, library_type: 'Standard' }
@@ -82,8 +82,8 @@
# Well based library request as used in eg. Limber pipeline
factory :library_request, class: 'IlluminaHtp::Requests::StdLibraryRequest' do
- association(:asset, factory: :well)
- association(:request_type, factory: :library_request_type)
+ asset factory: %i[well]
+ request_type factory: %i[library_request_type]
request_purpose { :standard }
request_metadata_attributes { attributes_for :request_metadata_for_library_manufacture }
@@ -102,24 +102,24 @@
factory(:multiplex_request, class: 'Request::Multiplexing') do
asset { nil }
- association(:target_asset, factory: :multiplexed_library_tube)
- association(:request_type, factory: :multiplex_request_type)
+ target_asset factory: %i[multiplexed_library_tube]
+ request_type factory: %i[multiplex_request_type]
request_purpose { :standard }
end
factory :cherrypick_request do
- association :asset, factory: :well
- association :target_asset, factory: :well
- association(:request_type, factory: :cherrypick_request_type)
+ asset factory: %i[well]
+ target_asset factory: %i[well]
+ request_type factory: %i[cherrypick_request_type]
request_purpose { :standard }
# Adds the associations needed for processing down a pipeline
factory :cherrypick_request_for_pipeline do
- association :asset, factory: :well_with_sample_and_plate
+ asset factory: %i[well_with_sample_and_plate]
submission
factory :passed_cherrypick_request do
- association :target_asset, factory: :well_with_sample_and_plate
+ target_asset factory: %i[well_with_sample_and_plate]
state { 'passed' }
end
end
@@ -127,14 +127,14 @@
factory :cherrypick_for_fluidigm_request do
transient { target_purpose { create :plate_purpose } }
- association :asset, factory: :well
- association :target_asset, factory: :well
- association(:request_type, factory: :cherrypick_request_type)
+ asset factory: %i[well]
+ target_asset factory: %i[well]
+ request_type factory: %i[cherrypick_request_type]
request_purpose { :standard }
request_metadata_attributes { { target_purpose: target_purpose } }
factory :final_cherrypick_for_fluidigm_request do
- association(:request_type, factory: :request_type, key: 'pick_to_fluidigm')
+ request_type factory: %i[request_type], key: 'pick_to_fluidigm'
end
end
@@ -148,8 +148,8 @@
factory :request, parent: :request_without_assets do
# the sample should be setup correctly and the assets should be valid
- association(:asset, factory: :sample_tube)
- association(:target_asset, factory: :empty_library_tube)
+ asset factory: %i[sample_tube]
+ target_asset factory: %i[empty_library_tube]
factory :request_with_submission do
after(:build) do |request|
@@ -194,10 +194,10 @@
end
factory :request_traction_grid_ion, class: 'Request::Traction::GridIon' do
- association(:asset, factory: :well)
+ asset factory: %i[well]
target_asset { nil }
request_purpose { :standard }
- association(:request_type, factory: :well_request_type)
+ request_type factory: %i[well_request_type]
request_metadata_attributes { attributes_for(:request_traction_grid_ion_metadata) }
end
@@ -222,7 +222,7 @@
class: 'Request::LibraryCreation',
aliases: [:library_creation_request_for_testing_sequencing_requests]
) do
- association(:request_type, factory: :library_creation_request_type)
+ request_type factory: %i[library_creation_request_type]
request_purpose { :standard }
asset { |target| target.association(:well_with_sample_and_plate) }
target_asset { |target| target.association(:empty_well) }
@@ -240,7 +240,7 @@
target_asset { |ta| ta.association(:pac_bio_library_tube) }
asset { |a| a.association(:well) }
submission { |s| s.association(:submission) }
- association(:request_type, factory: :pac_bio_sample_prep_request_type)
+ request_type factory: %i[pac_bio_sample_prep_request_type]
request_purpose { :standard }
end
diff --git a/spec/factories/request_metadata.rb b/spec/factories/request_metadata.rb
index 36b49cef78..1e98bad652 100644
--- a/spec/factories/request_metadata.rb
+++ b/spec/factories/request_metadata.rb
@@ -9,7 +9,7 @@
factory :request_traction_grid_ion_metadata, class: 'Request::Traction::GridIon::Metadata' do
library_type { 'Rapid' }
data_type { 'basecalls and raw data' }
- association(:owner, factory: :request_traction_grid_ion)
+ owner factory: %i[request_traction_grid_ion]
end
# Automatically generated request types
@@ -31,7 +31,7 @@
fragment_size_required_from { 1 }
fragment_size_required_to { 21 }
read_length { 76 }
- association(:owner, factory: :sequencing_request)
+ owner factory: %i[sequencing_request]
end
# HiSeq sequencing
@@ -103,12 +103,12 @@
factory :request_metadata_for_gbs, class: 'IlluminaHtp::Requests::GbsRequest::Metadata' do
primer_panel_name { create(:primer_panel).name }
- association(:owner, factory: :gbs_request)
+ owner factory: %i[gbs_request]
end
factory :request_metadata_for_heron, class: 'IlluminaHtp::Requests::HeronRequest::Metadata' do
primer_panel_name { create(:primer_panel).name }
- association(:owner, factory: :heron_request)
+ owner factory: %i[heron_request]
end
end
@@ -118,7 +118,7 @@
end
# set default metadata factories to every request types which have been defined yet
- RequestType.all.each do |rt|
+ RequestType.find_each do |rt|
factory_name = :"request_metadata_for_#{rt.name.downcase.gsub(/[^a-z]+/, '_')}"
next if FactoryBot.factories.registered?(factory_name)
diff --git a/spec/factories/request_type_factories.rb b/spec/factories/request_type_factories.rb
index 75586fa9a8..2671e18564 100644
--- a/spec/factories/request_type_factories.rb
+++ b/spec/factories/request_type_factories.rb
@@ -60,7 +60,7 @@
request_class { Request::Multiplexing }
billable { false }
for_multiplexing { true }
- association(:target_purpose, factory: :tube_purpose)
+ target_purpose factory: %i[tube_purpose]
end
end
@@ -182,12 +182,12 @@
factory :sequencing_request_type_validator do
default { 54 }
- association(:request_type, factory: :sequencing_request_type)
+ request_type factory: %i[sequencing_request_type]
end
factory :library_request_type_validator, class: 'RequestType::Validator' do
request_option { 'library_type' }
- association(:request_type, factory: :library_creation_request_type)
+ request_type factory: %i[library_creation_request_type]
valid_options { |rtva| RequestType::Validator::LibraryTypeValidator.new(rtva.request_type.id) }
end
diff --git a/spec/factories/sample_manifest_excel/sample_manifest_assets.rb b/spec/factories/sample_manifest_excel/sample_manifest_assets.rb
index 7807705d4f..5a53b72f0a 100644
--- a/spec/factories/sample_manifest_excel/sample_manifest_assets.rb
+++ b/spec/factories/sample_manifest_excel/sample_manifest_assets.rb
@@ -4,7 +4,7 @@
factory :sample_manifest_asset do
sanger_sample_id
sample_manifest
- association(:asset, factory: :receptacle)
+ asset factory: %i[receptacle]
after(:build) do |sma|
sma.sample_manifest.labware = [sma.asset.labware] if sma.sample_manifest &&
diff --git a/spec/factories/samples.rb b/spec/factories/samples.rb
index cdf4bfe3f8..128023bbab 100644
--- a/spec/factories/samples.rb
+++ b/spec/factories/samples.rb
@@ -11,7 +11,7 @@
end
factory :sample_with_gender do
- association :sample_metadata, factory: :sample_metadata_with_gender
+ sample_metadata factory: %i[sample_metadata_with_gender]
end
factory :sample_with_sanger_sample_id do
@@ -20,7 +20,7 @@
end
factory :accessioned_sample do
- association :sample_metadata, factory: :sample_metadata_with_accession_number
+ sample_metadata factory: %i[sample_metadata_with_accession_number]
end
end
diff --git a/spec/factories/shared_traits.rb b/spec/factories/shared_traits.rb
index 0a313baa91..7ef04b736b 100644
--- a/spec/factories/shared_traits.rb
+++ b/spec/factories/shared_traits.rb
@@ -18,7 +18,7 @@
end
factory :uuid do
- association(:resource, factory: :labware)
+ resource factory: %i[labware]
external_id { SecureRandom.uuid }
end
diff --git a/spec/factories/tag2_layout_factories.rb b/spec/factories/tag2_layout_factories.rb
index 5277b607f2..4a11d2a6fd 100644
--- a/spec/factories/tag2_layout_factories.rb
+++ b/spec/factories/tag2_layout_factories.rb
@@ -2,7 +2,7 @@
FactoryBot.define do
factory :tag2_layout do
- association(:plate, factory: :plate_with_untagged_wells)
+ plate factory: %i[plate_with_untagged_wells]
tag
user
end
diff --git a/spec/factories/tasks.rb b/spec/factories/tasks.rb
index e5b17966b2..42cac9d057 100644
--- a/spec/factories/tasks.rb
+++ b/spec/factories/tasks.rb
@@ -3,7 +3,7 @@
FactoryBot.define do
factory :task do
name { 'New task' }
- association(:workflow, factory: :lab_workflow)
+ workflow factory: %i[lab_workflow]
sorted { nil }
batched { nil }
location { '' }
@@ -12,7 +12,7 @@
factory :plate_template_task do
name { 'Select Plate Template' }
- association(:workflow, factory: :cherrypick_pipeline_workflow)
+ workflow factory: %i[cherrypick_pipeline_workflow]
sorted { 1 }
batched { true }
lab_activity { true }
@@ -23,7 +23,7 @@
factory :fluidigm_template_task do
name { 'Select Plate Template' }
- association(:workflow, factory: :fluidigm_pipeline_workflow)
+ workflow factory: %i[fluidigm_pipeline_workflow]
sorted { 1 }
batched { true }
lab_activity { true }
diff --git a/spec/factories/transfer_requests.rb b/spec/factories/transfer_requests.rb
index 53d606a73c..405a90ced6 100644
--- a/spec/factories/transfer_requests.rb
+++ b/spec/factories/transfer_requests.rb
@@ -2,11 +2,11 @@
FactoryBot.define do
factory :transfer_request do
- association(:asset, factory: :well)
- association(:target_asset, factory: :well)
+ asset factory: %i[well]
+ target_asset factory: %i[well]
factory :transfer_request_with_submission do
- association(:submission, factory: :submission)
+ submission factory: %i[submission]
factory :transfer_request_with_volume do
volume { 10 }
diff --git a/spec/factories/tube_factories.rb b/spec/factories/tube_factories.rb
index cd24a38fe6..5f65aa982e 100644
--- a/spec/factories/tube_factories.rb
+++ b/spec/factories/tube_factories.rb
@@ -28,18 +28,18 @@
factory :tube, traits: [:tube_barcode] do
name { generate :asset_name }
- association(:purpose, factory: :tube_purpose)
+ purpose factory: %i[tube_purpose]
end
factory :unbarcoded_tube, class: 'Tube' do
name { generate :asset_name }
- association(:purpose, factory: :tube_purpose)
+ purpose factory: %i[tube_purpose]
end
factory :empty_sample_tube, class: 'SampleTube', traits: [:tube_barcode] do
name { generate :asset_name }
qc_state { '' }
- association(:purpose, factory: :sample_tube_purpose) # { Tube::Purpose.standard_sample_tube }
+ purpose factory: %i[sample_tube_purpose] # { Tube::Purpose.standard_sample_tube }
end
factory :sample_tube, parent: :empty_sample_tube do
@@ -79,7 +79,7 @@
end
name { generate :asset_name }
- association(:purpose, factory: :mx_tube_purpose)
+ purpose factory: %i[mx_tube_purpose]
after(:build) do |tube, evaluator|
unless evaluator.sample_count.zero?
tube.aliquots = build_list(:library_aliquot, evaluator.sample_count, study: evaluator.study)
@@ -97,13 +97,13 @@
purpose { Tube::Purpose.stock_mx_tube }
factory :new_stock_multiplexed_library_tube do |_t|
- association(:purpose, factory: :new_stock_tube_purpose)
+ purpose factory: %i[new_stock_tube_purpose]
end
end
factory(:empty_library_tube, traits: [:tube_barcode], class: 'LibraryTube') do
name { generate :asset_name }
- association(:purpose, factory: :library_tube_purpose) # { Tube::Purpose.standard_library_tube }
+ purpose factory: %i[library_tube_purpose] # { Tube::Purpose.standard_library_tube }
transient do
sample_count { 0 }
diff --git a/spec/factories/well_factories.rb b/spec/factories/well_factories.rb
index 0755f0f087..3f6f400556 100644
--- a/spec/factories/well_factories.rb
+++ b/spec/factories/well_factories.rb
@@ -66,8 +66,8 @@
end
factory :well_link, class: 'Well::Link' do
- association(:source_well, factory: :well)
- association(:target_well, factory: :well)
+ source_well factory: %i[well]
+ target_well factory: %i[well]
type { 'stock' }
factory :stock_well_link
diff --git a/spec/factories/z_tag_qc_factories.rb b/spec/factories/z_tag_qc_factories.rb
index f7203fe01d..7f93eb31a2 100644
--- a/spec/factories/z_tag_qc_factories.rb
+++ b/spec/factories/z_tag_qc_factories.rb
@@ -36,18 +36,18 @@
factory :lot do
sequence(:lot_number) { |n| "lot#{n}" }
lot_type
- association(:template, factory: :plate_template_with_well)
+ template factory: %i[plate_template_with_well]
user
received_at { '2014-02-01' }
factory :tag2_lot do
- association(:lot_type, factory: :tag2_lot_type)
- association(:template, factory: :tag2_layout_template)
+ lot_type factory: %i[tag2_lot_type]
+ template factory: %i[tag2_layout_template]
end
factory :tag_layout_lot do
- association(:lot_type, factory: :tag_layout_lot_type)
- association(:template, factory: :tag_layout_template)
+ lot_type factory: %i[tag_layout_lot_type]
+ template factory: %i[tag_layout_template]
end
end
diff --git a/spec/features/admin/changing_user_roles_spec.rb b/spec/features/admin/changing_user_roles_spec.rb
index eb9ee9f621..61396f5b63 100644
--- a/spec/features/admin/changing_user_roles_spec.rb
+++ b/spec/features/admin/changing_user_roles_spec.rb
@@ -37,7 +37,7 @@
expect(test_user.roles.pluck(:name)).to eq(['lab_manager'])
end
- it 'assign a study role', js: true do
+ it 'assign a study role', :js do
within('div#study_role') do
select('manager', from: 'Study role')
select('Study Name', from: 'for Study')
@@ -46,7 +46,7 @@
expect(page).to have_content 'Manager'
end
- it 'assign a project role', js: true do
+ it 'assign a project role', :js do
within('div#project_role') do
select('manager', from: 'Project role')
select('Project Name', from: 'for Project')
diff --git a/spec/features/asset_information_spec.rb b/spec/features/asset_information_spec.rb
index 4a1a86656d..68022bf69f 100644
--- a/spec/features/asset_information_spec.rb
+++ b/spec/features/asset_information_spec.rb
@@ -12,8 +12,8 @@
let(:user) { create :user }
before do
- expect(Labware).to receive(:find_by).with(id: '1').and_return(labware) # rubocop:todo RSpec/ExpectInHook
- expect(Receptacle).to receive(:find_by).with(id: '1').and_return(receptacle) # rubocop:todo RSpec/ExpectInHook
+ expect(Labware).to receive(:find_by).with(id: '1').and_return(labware)
+ expect(Receptacle).to receive(:find_by).with(id: '1').and_return(receptacle)
login_user user
visit asset_path(id: 1)
end
diff --git a/spec/features/assets/asset_submission_spec.rb b/spec/features/assets/asset_submission_spec.rb
index e8e145b695..ba5bfd1352 100644
--- a/spec/features/assets/asset_submission_spec.rb
+++ b/spec/features/assets/asset_submission_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-describe 'Asset submission', js: true do
+describe 'Asset submission', :js do
let(:project) { create :project }
let(:study) { create :study }
let(:request_factory) { :sequencing_request }
diff --git a/spec/features/assets/show_plate_spec.rb b/spec/features/assets/show_plate_spec.rb
index 0eb3dac89f..42d59aa867 100644
--- a/spec/features/assets/show_plate_spec.rb
+++ b/spec/features/assets/show_plate_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-describe 'Show plate', js: true do
+describe 'Show plate', :js do
let(:plate) { create :plate, well_count: 3 }
let(:user) { create :user }
diff --git a/spec/features/assets/upload_and_retrieve_qc_file_spec.rb b/spec/features/assets/upload_and_retrieve_qc_file_spec.rb
index a2427d6fc5..b92884b791 100644
--- a/spec/features/assets/upload_and_retrieve_qc_file_spec.rb
+++ b/spec/features/assets/upload_and_retrieve_qc_file_spec.rb
@@ -3,7 +3,7 @@
require 'rails_helper'
require 'pry'
-describe 'Asset submission', js: true do
+describe 'Asset submission', :js do
let(:plate) { create :plate }
let(:user) { create :user }
diff --git a/spec/features/batches/failing_requests_spec.rb b/spec/features/batches/failing_requests_spec.rb
index 0c02049991..135d1cabdf 100644
--- a/spec/features/batches/failing_requests_spec.rb
+++ b/spec/features/batches/failing_requests_spec.rb
@@ -3,7 +3,7 @@
require 'rails_helper'
require 'pry'
-describe 'Batches controller', js: true do
+describe 'Batches controller', :js do
let(:request_count) { 3 }
let(:batch) do
create :cherrypick_batch,
diff --git a/spec/features/batches/sort_requests_spec.rb b/spec/features/batches/sort_requests_spec.rb
index 01fc88eafe..94fd73b0b2 100644
--- a/spec/features/batches/sort_requests_spec.rb
+++ b/spec/features/batches/sort_requests_spec.rb
@@ -3,7 +3,7 @@
require 'rails_helper'
require 'pry'
-describe 'Batches controller', js: true, warren: true do
+describe 'Batches controller', :js, :warren do
let(:request_count) { 3 }
let(:batch) { create :sequencing_batch, request_count: request_count, created_at: 1.day.ago, updated_at: 1.day.ago }
let(:user) { create :admin }
diff --git a/spec/features/generate_a_bulk_submission_template_spec.rb b/spec/features/generate_a_bulk_submission_template_spec.rb
index fc26bf998a..2c0f55be1d 100644
--- a/spec/features/generate_a_bulk_submission_template_spec.rb
+++ b/spec/features/generate_a_bulk_submission_template_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-describe 'Generate a bulk submission spreadsheet', bulk_submission_excel: true, js: true do
+describe 'Generate a bulk submission spreadsheet', :bulk_submission_excel, :js do
let!(:user) { create :user }
let!(:plate) { create(:plate_with_untagged_wells, well_count: 30) }
diff --git a/spec/features/lab_view_spec.rb b/spec/features/lab_view_spec.rb
index 44dd99aa42..b2a2c5fb93 100644
--- a/spec/features/lab_view_spec.rb
+++ b/spec/features/lab_view_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-describe 'Lab view', js: true do
+describe 'Lab view', :js do
let(:user) { create :user, email: 'login@example.com' }
let(:library_tube) { create :library_tube }
diff --git a/spec/features/labware/looking_up_labware_history_spec.rb b/spec/features/labware/looking_up_labware_history_spec.rb
index 540ee44029..45b4388472 100644
--- a/spec/features/labware/looking_up_labware_history_spec.rb
+++ b/spec/features/labware/looking_up_labware_history_spec.rb
@@ -15,7 +15,7 @@
}
end
- it 'displays asset audits', js: true do
+ it 'displays asset audits', :js do
login_user(user)
visit labware_path(tube)
click_link 'Event history'
diff --git a/spec/features/labwhere_reception_spec.rb b/spec/features/labwhere_reception_spec.rb
index 72b100492f..97811a70c6 100644
--- a/spec/features/labwhere_reception_spec.rb
+++ b/spec/features/labwhere_reception_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-describe 'Labwhere reception', js: true do
+describe 'Labwhere reception', :js do
let(:user) { create :user, email: 'login@example.com', swipecard_code: 12_345 }
let(:plate) { create :plate }
diff --git a/spec/features/perform_a_tag_substitution_spec.rb b/spec/features/perform_a_tag_substitution_spec.rb
index 2d96b796b5..d07ed0654a 100644
--- a/spec/features/perform_a_tag_substitution_spec.rb
+++ b/spec/features/perform_a_tag_substitution_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-describe 'Perform a tag substitution', js: true do
+describe 'Perform a tag substitution', :js do
let(:sample_a) { create :sample }
let(:sample_b) { create :sample }
let(:library_tube_a) { create :library_tube }
diff --git a/spec/features/pipelines/cherrypick/cherrypick_for_fluidigm_pipeline_micro_litre_spec.rb b/spec/features/pipelines/cherrypick/cherrypick_for_fluidigm_pipeline_micro_litre_spec.rb
index 87d7e842e4..ae49231bd2 100644
--- a/spec/features/pipelines/cherrypick/cherrypick_for_fluidigm_pipeline_micro_litre_spec.rb
+++ b/spec/features/pipelines/cherrypick/cherrypick_for_fluidigm_pipeline_micro_litre_spec.rb
@@ -3,7 +3,7 @@
require 'rails_helper'
require 'pry'
-describe 'cherrypick for fluidigm pipeline - micro litre', js: true do
+describe 'cherrypick for fluidigm pipeline - micro litre', :js do
let(:user) { create :admin }
let(:project) { create :project, name: 'Test project' }
let(:study) { create :study }
diff --git a/spec/features/pipelines/cherrypick/cherrypick_pipeline_spec.rb b/spec/features/pipelines/cherrypick/cherrypick_pipeline_spec.rb
index 7eb9ee1526..90cc5aaffc 100644
--- a/spec/features/pipelines/cherrypick/cherrypick_pipeline_spec.rb
+++ b/spec/features/pipelines/cherrypick/cherrypick_pipeline_spec.rb
@@ -3,7 +3,7 @@
require 'rails_helper'
require './spec/features/shared_examples/cherrypicking'
-describe 'Cherrypicking pipeline', cherrypicking: true, js: true do
+describe 'Cherrypicking pipeline', :cherrypicking, :js do
include BarcodeHelper
let(:swipecard_code) { '123456' }
@@ -408,7 +408,7 @@ def initialize_plates(plates)
end
end
- describe 'where there is a control plate and multiple destinations', js: true do
+ describe 'where there is a control plate and multiple destinations', :js do
let(:plate1) { create :plate_with_untagged_wells, sample_count: 50 }
let(:plate2) { create :plate_with_untagged_wells, sample_count: 50 }
let(:control_plate) { create :control_plate, sample_count: 2 }
diff --git a/spec/features/pipelines/creating_an_empty_batch_spec.rb b/spec/features/pipelines/creating_an_empty_batch_spec.rb
index b205a95e05..d240403589 100644
--- a/spec/features/pipelines/creating_an_empty_batch_spec.rb
+++ b/spec/features/pipelines/creating_an_empty_batch_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-describe 'Empty batch creation', js: true do
+describe 'Empty batch creation', :js do
let(:user) { create :user }
let(:pipeline) { create :cherrypick_pipeline }
let(:pipeline_name) { pipeline.name }
diff --git a/spec/features/pipelines/sequencing/following_a_sequencing_pipeline_spec.rb b/spec/features/pipelines/sequencing/following_a_sequencing_pipeline_spec.rb
index b776e6628f..26383ba494 100644
--- a/spec/features/pipelines/sequencing/following_a_sequencing_pipeline_spec.rb
+++ b/spec/features/pipelines/sequencing/following_a_sequencing_pipeline_spec.rb
@@ -3,7 +3,7 @@
require 'rails_helper'
require './spec/features/shared_examples/sequencing'
-RSpec.describe 'Following a Sequencing Pipeline', js: true do
+RSpec.describe 'Following a Sequencing Pipeline', :js do
let(:user) { create :user }
let(:pipeline) { create(:sequencing_pipeline, :with_workflow) }
@@ -51,7 +51,7 @@
]
end
- it 'can be processed', warren: true do
+ it 'can be processed', :warren do
login_user(user)
visit pipeline_path(pipeline)
within('#available-requests') { all('input[type=checkbox]', count: 2).each(&:check) }
@@ -145,7 +145,7 @@
end
end
- it 'descriptors can be edited', warren: true do
+ it 'descriptors can be edited', :warren do
Warren.handler.clear_messages
login_user(user)
@@ -182,7 +182,7 @@
expect(Batch.last.updated_at).to be_today
end
- it 'multiple descriptors can be edited', warren: true do
+ it 'multiple descriptors can be edited', :warren do
Warren.handler.clear_messages
login_user(user)
@@ -221,7 +221,7 @@
expect(Batch.last.updated_at).to be_today
end
- it 'spiked PhiX can be edited', warren: true do
+ it 'spiked PhiX can be edited', :warren do
Warren.handler.clear_messages
login_user(user)
diff --git a/spec/features/pipelines/sequencing/following_a_sequencing_pipeline_with_compound_sample_creation_spec.rb b/spec/features/pipelines/sequencing/following_a_sequencing_pipeline_with_compound_sample_creation_spec.rb
index 50ff41a816..3a6facd24b 100644
--- a/spec/features/pipelines/sequencing/following_a_sequencing_pipeline_with_compound_sample_creation_spec.rb
+++ b/spec/features/pipelines/sequencing/following_a_sequencing_pipeline_with_compound_sample_creation_spec.rb
@@ -3,7 +3,7 @@
require 'rails_helper'
require './spec/features/shared_examples/sequencing'
-RSpec.describe 'Following a Sequencing Pipeline', js: true do
+RSpec.describe 'Following a Sequencing Pipeline', :js do
let(:user) { create :user }
let(:study1) { create :study }
let(:project1) { create :project }
diff --git a/spec/features/pipelines/viewing_request_comments_spec.rb b/spec/features/pipelines/viewing_request_comments_spec.rb
index 1c7b825912..5f6dc0fe6e 100644
--- a/spec/features/pipelines/viewing_request_comments_spec.rb
+++ b/spec/features/pipelines/viewing_request_comments_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-describe 'Viewing request comments', js: true do
+describe 'Viewing request comments', :js do
let(:user) { create :user }
let(:pipeline) { create :sequencing_pipeline }
let(:pipeline_name) { pipeline.name }
diff --git a/spec/features/plate_qc_display_spec.rb b/spec/features/plate_qc_display_spec.rb
index 90e74585e5..7b2c84e2b7 100644
--- a/spec/features/plate_qc_display_spec.rb
+++ b/spec/features/plate_qc_display_spec.rb
@@ -13,14 +13,14 @@
visit plate_path(plate)
%w[concentration volume quantity_in_nano_grams loci_passed rin].each do |qc_result|
within("##{qc_result}") do
- expect(page).to have_selector('td', count: 126)
- expect(page).to have_selector('tr', count: 10)
- expect(page).to have_selector('th[2]', text: '1')
- expect(page).to have_selector('th[13]', text: '12')
- expect(page).to have_selector('tr[1]/td[1]', text: 'A')
- expect(page).to have_selector('tr[8]/td[14]', text: 'H')
- expect(page).to have_selector('tr[9]/td[2]', text: '1')
- expect(page).to have_selector('tr[9]/td[13]', text: '12')
+ expect(page).to have_css('td', count: 126)
+ expect(page).to have_css('tr', count: 10)
+ expect(page).to have_css('th[2]', text: '1')
+ expect(page).to have_css('th[13]', text: '12')
+ expect(page).to have_css('tr[1]/td[1]', text: 'A')
+ expect(page).to have_css('tr[8]/td[14]', text: 'H')
+ expect(page).to have_css('tr[9]/td[2]', text: '1')
+ expect(page).to have_css('tr[9]/td[13]', text: '12')
end
end
end
diff --git a/spec/features/pooling_spec.rb b/spec/features/pooling_spec.rb
index d2177fff6b..3b59d8bad4 100644
--- a/spec/features/pooling_spec.rb
+++ b/spec/features/pooling_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-describe 'Pooling', js: true, poolings: true do
+describe 'Pooling', :js, :poolings do
let(:user) { create :user, email: 'login@example.com' }
describe 'from page directly' do
diff --git a/spec/features/sample_logistics/lab/stock_stamping_spec.rb b/spec/features/sample_logistics/lab/stock_stamping_spec.rb
index 52c5d226df..e0d6fdfa40 100644
--- a/spec/features/sample_logistics/lab/stock_stamping_spec.rb
+++ b/spec/features/sample_logistics/lab/stock_stamping_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-describe 'stamping of stock', js: true do
+describe 'stamping of stock', :js do
let(:user) { create :admin, barcode: 'ID41440E', swipecard_code: '1234567' }
let(:plate) { create :plate_with_3_wells }
let!(:barcode_printer) { create :barcode_printer }
diff --git a/spec/features/sample_manifests/create_manifest_spec.rb b/spec/features/sample_manifests/create_manifest_spec.rb
index 39142d4ddf..92e168706b 100644
--- a/spec/features/sample_manifests/create_manifest_spec.rb
+++ b/spec/features/sample_manifests/create_manifest_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-describe 'SampleManifest controller', sample_manifest: true do
+describe 'SampleManifest controller', :sample_manifest do
def load_manifest_spec
SampleManifestExcel.configure do |config|
config.folder = File.join('spec', 'data', 'sample_manifest_excel')
@@ -24,8 +24,8 @@ def load_manifest_spec
select(study.name, from: 'Study')
select(supplier.name, from: 'Supplier')
within('#sample_manifest_template') do
- expect(page).to have_selector('option', count: 7)
- expect(page).not_to have_selector('option', text: 'Default Tube')
+ expect(page).to have_css('option', count: 7)
+ expect(page).not_to have_css('option', text: 'Default Tube')
end
select('Default Plate', from: 'Template')
select(printer.name, from: 'Barcode printer')
@@ -66,7 +66,7 @@ def load_manifest_spec
it 'indicate the purpose field is used for plates only' do
visit(new_sample_manifest_path)
- within('#sample_manifest_template') { expect(page).to have_selector('option', count: 22) }
+ within('#sample_manifest_template') { expect(page).to have_css('option', count: 22) }
select(created_purpose.name, from: 'Purpose')
expect(page).to have_text('Used for plate manifests only')
end
@@ -81,8 +81,8 @@ def load_manifest_spec
select(study.name, from: 'Study')
select(supplier.name, from: 'Supplier')
within('#sample_manifest_template') do
- expect(page).to have_selector('option', count: 2)
- expect(page).to have_selector('option', text: 'Default Tube Rack')
+ expect(page).to have_css('option', count: 2)
+ expect(page).to have_css('option', text: 'Default Tube Rack')
end
select('Default Tube Rack', from: 'Template')
expect(page).not_to have_text('Barcodes')
@@ -90,8 +90,8 @@ def load_manifest_spec
select(selected_purpose.name, from: 'Tube purpose') if selected_purpose
expect(page).to have_text('Tube rack purpose')
within('#sample_manifest_tube_rack_purpose_input') do
- expect(page).to have_selector('option', count: 2)
- expect(page).to have_selector('option', text: selected_tube_rack_purpose.name)
+ expect(page).to have_css('option', count: 2)
+ expect(page).to have_css('option', text: selected_tube_rack_purpose.name)
end
select(selected_tube_rack_purpose.name, from: 'Tube rack purpose') if selected_tube_rack_purpose
click_button('Create manifest')
diff --git a/spec/features/sample_manifests/track_sample_manifest_updates_spec.rb b/spec/features/sample_manifests/track_sample_manifest_updates_spec.rb
index bd0791b990..cdd5fd21ce 100644
--- a/spec/features/sample_manifests/track_sample_manifest_updates_spec.rb
+++ b/spec/features/sample_manifests/track_sample_manifest_updates_spec.rb
@@ -3,7 +3,7 @@
require 'rails_helper'
require 'timecop'
-describe 'track SampleManifest updates', sample_manifest: true do
+describe 'track SampleManifest updates', :sample_manifest do
include FetchTable
def load_manifest_spec
@@ -20,9 +20,8 @@ def load_manifest_spec
let!(:supplier) { create :supplier }
let!(:study) { create :study }
- around { |example| travel_to(Time.zone.local(2010, 7, 12, 10, 25, 0)) { example.run } }
-
before do
+ travel_to(Time.zone.local(2010, 7, 12, 10, 25, 0))
login_user user
load_manifest_spec
visit(study_path(study))
diff --git a/spec/features/sample_manifests/uploader_for_manifests_with_tag_sequences_spec.rb b/spec/features/sample_manifests/uploader_for_manifests_with_tag_sequences_spec.rb
index f323b0e5ec..9e21150201 100644
--- a/spec/features/sample_manifests/uploader_for_manifests_with_tag_sequences_spec.rb
+++ b/spec/features/sample_manifests/uploader_for_manifests_with_tag_sequences_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-describe 'Sample manifest with tag sequences', sample_manifest: true do
+describe 'Sample manifest with tag sequences', :sample_manifest do
before(:all) do
SampleManifestExcel.configure do |config|
config.folder = File.join('spec', 'data', 'sample_manifest_excel')
diff --git a/spec/features/shared_examples/cherrypicking.rb b/spec/features/shared_examples/cherrypicking.rb
index 02479f07b7..5ebe7d0405 100644
--- a/spec/features/shared_examples/cherrypicking.rb
+++ b/spec/features/shared_examples/cherrypicking.rb
@@ -69,9 +69,9 @@
expect(page).to have_content('Batch released!')
expected_input_count = plates.count
expected_input_count += 1 if control_plate
- within('#input_assets table tbody') { expect(page).to have_selector('tr', count: expected_input_count) }
+ within('#input_assets table tbody') { expect(page).to have_css('tr', count: expected_input_count) }
within('#output_assets table tbody') do
- expect(page).to have_selector('tr', count: expected_plates_by_destination_plate.size)
+ expect(page).to have_css('tr', count: expected_plates_by_destination_plate.size)
end
end
end
@@ -233,7 +233,11 @@ def get_machine_barcode_for_bed(bedcode)
end
step "Download pick file for destination plate #{destination_barcode} pick number #{pick_number_index}" do
- expect(page).to have_content("Download #{robot.name.capitalize} File Step 3 of 3")
+ Capybara.using_wait_time(5) do
+ # This requires more time to perform the check between runs.
+ # Throws a JS error if not waiting enough
+ expect(page).to have_content("Download #{robot.name.capitalize} File Step 3 of 3")
+ end
click_link("Download #{robot.name} File")
diff --git a/spec/features/shared_examples/sequencing.rb b/spec/features/shared_examples/sequencing.rb
index a7e4989f14..3e53228444 100644
--- a/spec/features/shared_examples/sequencing.rb
+++ b/spec/features/shared_examples/sequencing.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
shared_examples 'a sequencing procedure' do
- it 'can be processed', warren: true do
+ it 'can be processed', :warren do
login_user(user)
visit pipeline_path(pipeline)
within('#available-requests') { all('input[type=checkbox]', count: 2).each(&:check) }
diff --git a/spec/features/studies/change_study_roles_spec.rb b/spec/features/studies/change_study_roles_spec.rb
index b458df5d6d..495434151a 100644
--- a/spec/features/studies/change_study_roles_spec.rb
+++ b/spec/features/studies/change_study_roles_spec.rb
@@ -7,7 +7,7 @@
let!(:study) { create :study_with_manager, updated_at: 1.year.ago }
let(:manager) { study.managers.first }
- it 'can be removed', js: true do
+ it 'can be removed', :js do
# We had an issue where the timestamp was not updating on study
# https://github.com/sanger/sequencescape/issues/2942
# which was user list to not be updated in the UWH
diff --git a/spec/features/studies/create_study_spec.rb b/spec/features/studies/create_study_spec.rb
index 548042899c..4500a0bc25 100644
--- a/spec/features/studies/create_study_spec.rb
+++ b/spec/features/studies/create_study_spec.rb
@@ -58,7 +58,7 @@
expect(page).to have_content "Study description can't be blank"
end
- it 'create managed study', js: true do
+ it 'create managed study', :js do
login_user user
visit root_path
click_link 'Create Study'
@@ -69,7 +69,7 @@
expect(page).not_to have_content "Study metadata HuMFre approval number can't be blank"
end
- it 'create open study', js: true do
+ it 'create open study', :js do
login_user user
visit new_study_path
expect(page).to have_content('Study Create')
diff --git a/spec/features/studies/edit_study_spec.rb b/spec/features/studies/edit_study_spec.rb
index 593a28d663..89f7649b3a 100644
--- a/spec/features/studies/edit_study_spec.rb
+++ b/spec/features/studies/edit_study_spec.rb
@@ -6,7 +6,7 @@
let(:user) { create :admin }
let!(:study) { create :study }
- it 'edit open study', js: true do
+ it 'edit open study', :js do
study.study_metadata.bam = false
study.save
login_user(user)
@@ -22,7 +22,7 @@
expect(page).to have_content('Alignments in BAM: true')
end
- it 'add external customer information', js: true do
+ it 'add external customer information', :js do
login_user(user)
visit study_path(study)
click_link 'Edit'
@@ -38,7 +38,7 @@
context 'when data release strategy is Not Applicable' do
let!(:study) { create :not_app_study }
- it 'does not error when setting strategy to Open', js: true do
+ it 'does not error when setting strategy to Open', :js do
study.study_metadata.data_release_strategy = 'not applicable'
study.save
login_user(user)
diff --git a/spec/features/studies/manage_study_spec.rb b/spec/features/studies/manage_study_spec.rb
index e56a8e8d0b..c5f242150a 100644
--- a/spec/features/studies/manage_study_spec.rb
+++ b/spec/features/studies/manage_study_spec.rb
@@ -6,7 +6,7 @@
let(:user) { create :admin }
let!(:study) { create :study, name: 'Original name' }
- it 'Rename a study', js: true do
+ it 'Rename a study', :js do
login_user(user)
visit study_path(study)
click_link 'Manage'
diff --git a/spec/features/studies/qc_reports_spec.rb b/spec/features/studies/qc_reports_spec.rb
index 992881a8f1..b132ba7cf2 100644
--- a/spec/features/studies/qc_reports_spec.rb
+++ b/spec/features/studies/qc_reports_spec.rb
@@ -25,6 +25,6 @@
plate_purpose_names.each { |plate_purpose| select(plate_purpose, from: 'Plate purpose') }
end
click_button('Create report')
- expect(QcReport.first.plate_purposes & plate_purpose_names).to contain_exactly(*plate_purpose_names)
+ expect(QcReport.first.plate_purposes & plate_purpose_names).to match_array(plate_purpose_names)
end
end
diff --git a/spec/features/studies/view_study_properties_spec.rb b/spec/features/studies/view_study_properties_spec.rb
index 41a40443bf..24699959f0 100644
--- a/spec/features/studies/view_study_properties_spec.rb
+++ b/spec/features/studies/view_study_properties_spec.rb
@@ -7,7 +7,7 @@
let(:prelim_id) { 'A1234' }
let(:study) { create(:study, study_metadata: create(:study_metadata, prelim_id: prelim_id)) }
- it 'view open study properties', js: true do
+ it 'view open study properties', :js do
login_user(user)
visit study_path(study)
click_link 'Study details'
diff --git a/spec/features/studies/view_study_request_links_spec.rb b/spec/features/studies/view_study_request_links_spec.rb
index 2b894b3d55..764090be4e 100644
--- a/spec/features/studies/view_study_request_links_spec.rb
+++ b/spec/features/studies/view_study_request_links_spec.rb
@@ -36,12 +36,12 @@
visit study_path(study)
end
- it 'No links to absent requests', js: true do
+ it 'No links to absent requests', :js do
click_link sequencing_request_type.name
expect(page).not_to have_link(title: "#{library_tube.human_barcode} started")
end
- it 'Single requests link directly to the request', js: true do
+ it 'Single requests link directly to the request', :js do
click_link sequencing_request_type.name
expect(page).to have_link('1', title: "#{library_tube.human_barcode} passed")
click_link('1', title: "#{library_tube.human_barcode} passed")
@@ -49,14 +49,14 @@
expect(page).to have_text(sequencing_request_type.name)
end
- it 'Multiple requests link to the summary', js: true do
+ it 'Multiple requests link to the summary', :js do
click_link sequencing_request_type.name
expect(page).to have_link('2', title: "#{library_tube.human_barcode} failed")
click_link('2', title: "#{library_tube.human_barcode} failed")
expect(page).to have_text("#{sequencing_request_type.name} Study 3871492")
end
- it 'Filtering by asset type', js: true do
+ it 'Filtering by asset type', :js do
click_link 'Assets progress'
within '#summary' do
expect(page).to have_text sample_tube.name
diff --git a/spec/features/tag_layout_template_spec.rb b/spec/features/tag_layout_template_spec.rb
index 459a42996c..5dd6411f53 100644
--- a/spec/features/tag_layout_template_spec.rb
+++ b/spec/features/tag_layout_template_spec.rb
@@ -12,7 +12,7 @@
tag_group_2
end
- it 'create a new layout template from a tag group', js: true do
+ it 'create a new layout template from a tag group', :js do
login_user user
visit tag_group_path(tag_group_1)
expect(page).to have_content 'Test tag group 1'
@@ -32,7 +32,7 @@
expect(page).to have_content 'To tag layout templates list'
end
- it 'create a new layout template directly', js: true do
+ it 'create a new layout template directly', :js do
login_user user
visit new_tag_layout_template_path
expect(page).to have_content 'Tag Layout Template New'
@@ -52,7 +52,7 @@
expect(page).to have_content 'To tag layout templates list'
end
- it 'get an error when creating a new layout template', js: true do
+ it 'get an error when creating a new layout template', :js do
login_user user
visit new_tag_layout_template_path
expect(page).to have_content 'Tag Layout Template New'
diff --git a/spec/helpers/deprecation_helper_spec.rb b/spec/helpers/deprecation_helper_spec.rb
index 77081b1aa5..f563ba48c1 100644
--- a/spec/helpers/deprecation_helper_spec.rb
+++ b/spec/helpers/deprecation_helper_spec.rb
@@ -8,7 +8,7 @@
include FontawesomeHelper
describe '#deprecate_section' do
- subject(:returned_html) { deprecate_section(params) { 'Deprecated content
' } }
+ subject(:returned_html) { deprecate_section(**params) { 'Deprecated content
' } }
context 'with only a message' do
let(:params) { { message: 'This is old' } }
diff --git a/spec/heron/factories/concerns/contents_spec.rb b/spec/heron/factories/concerns/contents_spec.rb
index 875d8bfbcb..ca09e482c4 100644
--- a/spec/heron/factories/concerns/contents_spec.rb
+++ b/spec/heron/factories/concerns/contents_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-RSpec.describe Heron::Factories::Concerns::Contents, heron: true, lighthouse: true, type: :model do
+RSpec.describe Heron::Factories::Concerns::Contents, :heron, :lighthouse, type: :model do
require 'rspec/mocks/standalone'
let(:factory_klass) do
Class.new do
@@ -20,7 +20,7 @@ def self.model_name
end
def content_factory
- ::Heron::Factories::Sample
+ Heron::Factories::Sample
end
def recipients_key
@@ -49,7 +49,7 @@ def recipients_key
it 'is not valid' do
factory = factory_klass.new(params)
- expect(factory).to be_invalid
+ expect(factory).not_to be_valid
end
it 'gets an error message about it for each wrong location' do
@@ -71,7 +71,7 @@ def recipients_key
it 'is not valid' do
factory = factory_klass.new(params)
- expect(factory).to be_invalid
+ expect(factory).not_to be_valid
end
context 'when supplying the study_uuid' do
@@ -113,15 +113,14 @@ def recipients_key
it 'is not valid' do
factory = factory_klass.new(params)
- expect(factory).to be_invalid
+ expect(factory).not_to be_valid
end
it 'gets an error message about it for each wrong sample' do
expect(factory_klass.new(params).tap(&:validate).errors.full_messages.uniq).to eq(
[
- 'Content b1, pos: 1 Phenotype No other params can be added when sample uuid specified',
- "Content c1 Study can't be blank",
- 'Content c1 Asdf Unexisting field for sample or sample_metadata'
+ 'Content b1, pos: 1 ["Phenotype No other params can be added when sample uuid specified"]',
+ "Content c1 [\"Study can't be blank\", \"Asdf Unexisting field for sample or sample_metadata\"]"
]
)
end
@@ -234,7 +233,7 @@ def recipients_key
context 'with a tube rack' do
let(:purpose) { create(:plate_purpose, target_type: 'Plate', name: 'Stock Plate', size: '96') }
- let(:tube_rack) { ::TubeRack.create!(size: '96', purpose: purpose) }
+ let(:tube_rack) { TubeRack.create!(size: '96', purpose: purpose) }
let(:plate) { tube_rack }
let(:tubes) do
%w[A1 B1 C1].map do |coordinate|
diff --git a/spec/heron/factories/concerns/eventful_spec.rb b/spec/heron/factories/concerns/eventful_spec.rb
index 71b225e33a..06b54f777f 100644
--- a/spec/heron/factories/concerns/eventful_spec.rb
+++ b/spec/heron/factories/concerns/eventful_spec.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
require 'rails_helper'
-RSpec.describe Heron::Factories::Concerns::Eventful, heron_events: true do
+RSpec.describe Heron::Factories::Concerns::Eventful, :heron_events do
let(:my_test_class) do
Class.new do
include ActiveModel::Model
diff --git a/spec/heron/factories/event_spec.rb b/spec/heron/factories/event_spec.rb
index ee7ef03cec..a2c7bd759e 100644
--- a/spec/heron/factories/event_spec.rb
+++ b/spec/heron/factories/event_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-RSpec.describe Heron::Factories::Event, heron: true, heron_events: true, type: :model do
+RSpec.describe Heron::Factories::Event, :heron, :heron_events, type: :model do
let(:plate) { create :plate }
let(:subjects) do
[
diff --git a/spec/heron/factories/plate_from_rack_spec.rb b/spec/heron/factories/plate_from_rack_spec.rb
index b9287181e0..8205c5ddd1 100644
--- a/spec/heron/factories/plate_from_rack_spec.rb
+++ b/spec/heron/factories/plate_from_rack_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-RSpec.describe Heron::Factories::PlateFromRack, heron: true, type: :model do
+RSpec.describe Heron::Factories::PlateFromRack, :heron, type: :model do
let(:purpose) { create(:plate_purpose, target_type: 'Plate', name: 'Stock Plate', size: '96') }
let(:rack) { create :tube_rack }
let(:plate_factory) { described_class.new(tube_rack: rack, plate_purpose: purpose) }
diff --git a/spec/heron/factories/plate_spec.rb b/spec/heron/factories/plate_spec.rb
index 3dfdbf0752..a6f8100ff6 100644
--- a/spec/heron/factories/plate_spec.rb
+++ b/spec/heron/factories/plate_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-RSpec.describe Heron::Factories::Plate, heron: true, heron_events: true, lighthouse: true, type: :model do
+RSpec.describe Heron::Factories::Plate, :heron, :heron_events, :lighthouse, type: :model do
let(:purpose) { create(:plate_purpose, target_type: 'Plate', name: 'Stock Plate', size: '96') }
let(:study) { create(:study) }
let(:barcode) { '0000000001' }
@@ -24,7 +24,7 @@
shared_examples_for 'an invalid parameter' do
let(:factory) { described_class.new(params) }
it 'is not valid' do
- expect(factory).to be_invalid
+ expect(factory).not_to be_valid
end
it 'has an error' do
@@ -141,15 +141,15 @@
end
it 'is invalid' do
- expect(plate_factory).to be_invalid
+ expect(plate_factory).not_to be_valid
end
it 'stores the error message from samples' do
expect(plate_factory.tap(&:validate).errors.full_messages).to eq(
[
- 'Content a1 Wrong Unexisting field for sample or sample_metadata',
- "Content c1, pos: 0 Study can't be blank",
- 'Content c1, pos: 1 Phenotype No other params can be added when sample uuid specified'
+ 'Content a1 ["Wrong Unexisting field for sample or sample_metadata"]',
+ "Content c1, pos: 0 [\"Study can't be blank\"]",
+ 'Content c1, pos: 1 ["Phenotype No other params can be added when sample uuid specified"]'
]
)
end
diff --git a/spec/heron/factories/sample_spec.rb b/spec/heron/factories/sample_spec.rb
index 4d88dd3320..f52fe446d9 100644
--- a/spec/heron/factories/sample_spec.rb
+++ b/spec/heron/factories/sample_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-RSpec.describe Heron::Factories::Sample, heron: true, lighthouse: true, type: :model do
+RSpec.describe Heron::Factories::Sample, :heron, :lighthouse, type: :model do
let(:study) { create :study }
describe '#valid?' do
@@ -20,7 +20,7 @@
it 'is not valid' do
factory = described_class.new(params)
- expect(factory).to be_invalid
+ expect(factory).not_to be_valid
end
it 'stores the error message' do
@@ -36,7 +36,7 @@
it 'is not valid' do
factory = described_class.new(params)
- expect(factory).to be_invalid
+ expect(factory).not_to be_valid
end
it 'stores the error message' do
@@ -63,7 +63,7 @@
it 'is valid' do
factory = described_class.new(params)
- expect(factory).to be_invalid
+ expect(factory).not_to be_valid
end
end
end
@@ -73,7 +73,7 @@
it 'is invalid' do
factory = described_class.new(params)
- expect(factory).to be_invalid
+ expect(factory).not_to be_valid
end
end
end
@@ -85,20 +85,18 @@
let(:factory) { described_class.new(study: study, aliquot: { tag_id: tag_id }) }
it 'can create an aliquot of the sample in the well' do
- expect { factory.create_aliquot_at(well) }.to change(::Aliquot, :count)
- .by(1)
- .and(change(::Sample, :count).by(1))
+ expect { factory.create_aliquot_at(well) }.to change(Aliquot, :count).by(1).and(change(Sample, :count).by(1))
end
it 'creates aliquots using the arguments provided' do
aliquot = factory.create_aliquot_at(well)
- expect(aliquot.class).to eq(::Aliquot)
+ expect(aliquot.class).to eq(Aliquot)
expect(aliquot.tag_id).to eq(tag_id)
end
it 'registers a stock resource message' do
expect { factory.create_aliquot_at(well) }.to change(
- ::Messenger.where(root: 'stock_resource', template: 'WellStockResourceIO', target: well),
+ Messenger.where(root: 'stock_resource', template: 'WellStockResourceIO', target: well),
:count
).by(1)
end
@@ -116,7 +114,7 @@
context 'when the factory is valid' do
it 'returns a sample instance' do
factory = described_class.new(study: study)
- expect(factory.create.class).to eq(::Sample)
+ expect(factory.create.class).to eq(Sample)
end
it 'returns the same sample instance in any subsequent call' do
@@ -152,7 +150,7 @@
it 'will be invalid if providing any other extra attributes' do
factory = described_class.new(study: study, sample_uuid: sample.uuid, sample_id: '1234')
- expect(factory).to be_invalid
+ expect(factory).not_to be_valid
end
it 'will be valid if providing any other attributes not sample related' do
diff --git a/spec/heron/factories/tube_rack_spec.rb b/spec/heron/factories/tube_rack_spec.rb
index aa1a5e5571..8ba2fcadd9 100644
--- a/spec/heron/factories/tube_rack_spec.rb
+++ b/spec/heron/factories/tube_rack_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-RSpec.describe Heron::Factories::TubeRack, heron: true, type: :model do
+RSpec.describe Heron::Factories::TubeRack, :heron, type: :model do
let(:study) { create(:study) }
let(:params) do
diff --git a/spec/heron/factories/tube_rack_status_spec.rb b/spec/heron/factories/tube_rack_status_spec.rb
index e1e2632bb9..8ca3b9b5cd 100644
--- a/spec/heron/factories/tube_rack_status_spec.rb
+++ b/spec/heron/factories/tube_rack_status_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-RSpec.describe Heron::Factories::TubeRackStatus, heron: true, type: :model do
+RSpec.describe Heron::Factories::TubeRackStatus, :heron, type: :model do
before { create(:study) }
let(:params) { { barcode: '0000000001', status: 'validation_failed', messages: ['message 1', 'message 2'] } }
diff --git a/spec/heron/factories/tube_spec.rb b/spec/heron/factories/tube_spec.rb
index 7721983b9e..b8f55f84d5 100644
--- a/spec/heron/factories/tube_spec.rb
+++ b/spec/heron/factories/tube_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-RSpec.describe Heron::Factories::Tube, heron: true, type: :model do
+RSpec.describe Heron::Factories::Tube, :heron, type: :model do
let(:params) { { barcode: 'FD00000001' } }
it 'is valid with all relevant attributes' do
@@ -19,7 +19,7 @@
barcode = 'FD00000001'
create(:barcode, barcode: barcode, asset: create(:sample_tube), format: Barcode.matching_barcode_format(barcode))
tube = described_class.new(params)
- expect(tube).to be_invalid
+ expect(tube).not_to be_valid
end
describe '#create' do
diff --git a/spec/lib/accession/accessionable_spec.rb b/spec/lib/accession/accessionable_spec.rb
index fa63192b37..75de4fce0d 100644
--- a/spec/lib/accession/accessionable_spec.rb
+++ b/spec/lib/accession/accessionable_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-RSpec.describe Accession::Accessionable, accession: true, type: :model do
+RSpec.describe Accession::Accessionable, :accession, type: :model do
class Accessionobubble
include Accession::Accessionable
diff --git a/spec/lib/accession/configuration_spec.rb b/spec/lib/accession/configuration_spec.rb
index 6b1fd1f456..aad3d618df 100644
--- a/spec/lib/accession/configuration_spec.rb
+++ b/spec/lib/accession/configuration_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-RSpec.describe Accession::Accessionable, accession: true, type: :model do
+RSpec.describe Accession::Accessionable, :accession, type: :model do
let(:configuration) { Accession::Configuration.new }
it 'is comparable' do
diff --git a/spec/lib/accession/contact_spec.rb b/spec/lib/accession/contact_spec.rb
index 3314cb2d71..ea8765ff72 100644
--- a/spec/lib/accession/contact_spec.rb
+++ b/spec/lib/accession/contact_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-RSpec.describe Accession::Contact, accession: true, type: :model do
+RSpec.describe Accession::Contact, :accession, type: :model do
subject { described_class.new(user) }
before(:all) do
diff --git a/spec/lib/accession/request_spec.rb b/spec/lib/accession/request_spec.rb
index 9909e257ce..b81fc984b4 100644
--- a/spec/lib/accession/request_spec.rb
+++ b/spec/lib/accession/request_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-RSpec.describe Accession::Request, accession: true, type: :model do
+RSpec.describe Accession::Request, :accession, type: :model do
include MockAccession
let(:submission) { build(:accession_submission) }
diff --git a/spec/lib/accession/response_spec.rb b/spec/lib/accession/response_spec.rb
index 9597d74474..f7cfa8fb1e 100644
--- a/spec/lib/accession/response_spec.rb
+++ b/spec/lib/accession/response_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-RSpec.describe Accession::Response, accession: true, type: :model do
+RSpec.describe Accession::Response, :accession, type: :model do
include MockAccession
it 'is successful if the status code is in the correct range' do
diff --git a/spec/lib/accession/sample_spec.rb b/spec/lib/accession/sample_spec.rb
index f25629f6ca..8872a1d7f8 100644
--- a/spec/lib/accession/sample_spec.rb
+++ b/spec/lib/accession/sample_spec.rb
@@ -15,7 +15,7 @@ def find_value_at_tag(xml_received, tag_name)
end
end
-RSpec.describe Accession::Sample, accession: true, type: :model do
+RSpec.describe Accession::Sample, :accession, type: :model do
let(:tag_list) { build(:standard_accession_tag_list) }
before { @country = create :insdc_country, name: 'Australia' }
diff --git a/spec/lib/accession/service_spec.rb b/spec/lib/accession/service_spec.rb
index 7134e30624..7a116eec75 100644
--- a/spec/lib/accession/service_spec.rb
+++ b/spec/lib/accession/service_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-RSpec.describe Accession::Service, accession: true, type: :model do
+RSpec.describe Accession::Service, :accession, type: :model do
it 'can have a provider' do
service = described_class.new('open')
expect(service.provider).to eq(:ENA)
diff --git a/spec/lib/accession/study_spec.rb b/spec/lib/accession/study_spec.rb
index cd85c9e2a4..c1268b040b 100644
--- a/spec/lib/accession/study_spec.rb
+++ b/spec/lib/accession/study_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-RSpec.describe Study, accession: true, type: :model do
+RSpec.describe Study, :accession, type: :model do
include MockAccession
context 'accession all samples in study' do
diff --git a/spec/lib/accession/submission_spec.rb b/spec/lib/accession/submission_spec.rb
index 3676c6437e..01ac12c4a8 100644
--- a/spec/lib/accession/submission_spec.rb
+++ b/spec/lib/accession/submission_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-RSpec.describe Accession::Submission, accession: true, type: :model do
+RSpec.describe Accession::Submission, :accession, type: :model do
let!(:user) { create(:user) }
let!(:sample) { build(:accession_sample) }
diff --git a/spec/lib/accession/tag_list_spec.rb b/spec/lib/accession/tag_list_spec.rb
index 81160406ac..0609381b35 100644
--- a/spec/lib/accession/tag_list_spec.rb
+++ b/spec/lib/accession/tag_list_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-RSpec.describe Accession::TagList, accession: true, type: :model do
+RSpec.describe Accession::TagList, :accession, type: :model do
include Accession::Helpers
let(:folder) { File.join('spec', 'data', 'accession') }
diff --git a/spec/lib/accession/tag_spec.rb b/spec/lib/accession/tag_spec.rb
index 58c2210faa..8af2b9666d 100644
--- a/spec/lib/accession/tag_spec.rb
+++ b/spec/lib/accession/tag_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-RSpec.describe Accession::Tag, accession: true, type: :model do
+RSpec.describe Accession::Tag, :accession, type: :model do
it 'onlies be valid with a name and groups' do
expect(described_class.new(name: :tag_1, groups: :a)).to be_valid
expect(described_class.new(name: :tag_1)).not_to be_valid
diff --git a/spec/lib/label_printer/sample_manifest_plate_double_spec.rb b/spec/lib/label_printer/sample_manifest_plate_double_spec.rb
index f6885777d6..d322b601c3 100644
--- a/spec/lib/label_printer/sample_manifest_plate_double_spec.rb
+++ b/spec/lib/label_printer/sample_manifest_plate_double_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-describe LabelPrinter::Label::SampleManifestPlateDouble, sample_manifest: true do
+describe LabelPrinter::Label::SampleManifestPlateDouble, :sample_manifest do
subject { described_class.new(label_options) }
let(:sample_manifest) { create :pending_plate_sample_manifest }
diff --git a/spec/lib/record_loader/barcode_printer_type_loader_spec.rb b/spec/lib/record_loader/barcode_printer_type_loader_spec.rb
index a4ad9db8c7..f720ea538f 100644
--- a/spec/lib/record_loader/barcode_printer_type_loader_spec.rb
+++ b/spec/lib/record_loader/barcode_printer_type_loader_spec.rb
@@ -4,7 +4,7 @@
require 'record_loader/barcode_printer_type_loader'
# This file was initially generated via `rails g record_loader`
-RSpec.describe RecordLoader::BarcodePrinterTypeLoader, loader: true, type: :model do
+RSpec.describe RecordLoader::BarcodePrinterTypeLoader, :loader, type: :model do
def a_new_record_loader
described_class.new(directory: test_directory, files: selected_files)
end
diff --git a/spec/lib/record_loader/flowcell_type_loader_spec.rb b/spec/lib/record_loader/flowcell_type_loader_spec.rb
index cdc81967a9..c5e877f5b3 100644
--- a/spec/lib/record_loader/flowcell_type_loader_spec.rb
+++ b/spec/lib/record_loader/flowcell_type_loader_spec.rb
@@ -4,7 +4,7 @@
require 'record_loader/flowcell_type_loader'
# This file was initially generated via `rails g record_loader`
-RSpec.describe RecordLoader::FlowcellTypeLoader, loader: true, type: :model do
+RSpec.describe RecordLoader::FlowcellTypeLoader, :loader, type: :model do
subject(:record_loader) { described_class.new(directory: test_directory, files: selected_files) }
# Tests use a separate directory to avoid coupling your specs to the data
diff --git a/spec/lib/record_loader/flowcell_type_request_type_loader_spec.rb b/spec/lib/record_loader/flowcell_type_request_type_loader_spec.rb
index 03500f12d8..00024a1059 100644
--- a/spec/lib/record_loader/flowcell_type_request_type_loader_spec.rb
+++ b/spec/lib/record_loader/flowcell_type_request_type_loader_spec.rb
@@ -4,7 +4,7 @@
require 'record_loader/flowcell_type_request_type_loader'
# This file was initially generated via `rails g record_loader`
-RSpec.describe RecordLoader::FlowcellTypeRequestTypeLoader, loader: true, type: :model do
+RSpec.describe RecordLoader::FlowcellTypeRequestTypeLoader, :loader, type: :model do
subject(:record_loader) { described_class.new(directory: test_directory, files: selected_files) }
# Tests use a separate directory to avoid coupling your specs to the data
diff --git a/spec/lib/record_loader/library_type_loader_spec.rb b/spec/lib/record_loader/library_type_loader_spec.rb
index 0af364a721..d4e0e52703 100644
--- a/spec/lib/record_loader/library_type_loader_spec.rb
+++ b/spec/lib/record_loader/library_type_loader_spec.rb
@@ -4,7 +4,7 @@
require 'record_loader/library_type_loader'
# This file was initially generated via `rails g record_loader`
-RSpec.describe RecordLoader::LibraryTypeLoader, loader: true, type: :model do
+RSpec.describe RecordLoader::LibraryTypeLoader, :loader, type: :model do
def a_new_record_loader
described_class.new(directory: test_directory, files: selected_files)
end
diff --git a/spec/lib/record_loader/pipeline_loader_spec.rb b/spec/lib/record_loader/pipeline_loader_spec.rb
index db2d6b446e..fda6e8b9db 100644
--- a/spec/lib/record_loader/pipeline_loader_spec.rb
+++ b/spec/lib/record_loader/pipeline_loader_spec.rb
@@ -4,7 +4,7 @@
require 'record_loader/pipeline_loader'
# This file was initially generated via `rails g record_loader`
-RSpec.describe RecordLoader::PipelineLoader, loader: true, type: :model do
+RSpec.describe RecordLoader::PipelineLoader, :loader, type: :model do
subject(:record_loader) { described_class.new(directory: test_directory, files: selected_files) }
# Tests use a separate directory to avoid coupling your specs to the data
diff --git a/spec/lib/record_loader/pipeline_request_information_type_loader_spec.rb b/spec/lib/record_loader/pipeline_request_information_type_loader_spec.rb
index 21fef3e30f..a8e851a2b2 100644
--- a/spec/lib/record_loader/pipeline_request_information_type_loader_spec.rb
+++ b/spec/lib/record_loader/pipeline_request_information_type_loader_spec.rb
@@ -4,7 +4,7 @@
require 'record_loader/pipeline_request_information_type_loader'
# This file was initially generated via `rails g record_loader`
-RSpec.describe RecordLoader::PipelineRequestInformationTypeLoader, loader: true, type: :model do
+RSpec.describe RecordLoader::PipelineRequestInformationTypeLoader, :loader, type: :model do
subject(:record_loader) { described_class.new(directory: test_directory, files: selected_files) }
# Tests use a separate directory to avoid coupling your specs to the data
diff --git a/spec/lib/record_loader/plate_purpose_loader_spec.rb b/spec/lib/record_loader/plate_purpose_loader_spec.rb
index 3c6e83d35f..d7f0d14259 100644
--- a/spec/lib/record_loader/plate_purpose_loader_spec.rb
+++ b/spec/lib/record_loader/plate_purpose_loader_spec.rb
@@ -3,7 +3,7 @@
require 'rails_helper'
require 'record_loader/plate_purpose_loader'
-RSpec.describe RecordLoader::PlatePurposeLoader, loader: true, type: :model do
+RSpec.describe RecordLoader::PlatePurposeLoader, :loader, type: :model do
def a_new_record_loader
described_class.new(directory: test_directory, files: selected_files)
end
diff --git a/spec/lib/record_loader/plate_type_loader_spec.rb b/spec/lib/record_loader/plate_type_loader_spec.rb
index a049dbdd38..c02482a1ac 100644
--- a/spec/lib/record_loader/plate_type_loader_spec.rb
+++ b/spec/lib/record_loader/plate_type_loader_spec.rb
@@ -4,7 +4,7 @@
require 'record_loader/plate_type_loader'
# This file was initially generated via `rails g record_loader`
-RSpec.describe RecordLoader::PlateTypeLoader, loader: true, type: :model do
+RSpec.describe RecordLoader::PlateTypeLoader, :loader, type: :model do
def a_new_record_loader
described_class.new(directory: test_directory, files: selected_files)
end
diff --git a/spec/lib/record_loader/primer_panel_loader_spec.rb b/spec/lib/record_loader/primer_panel_loader_spec.rb
index a1907a3ded..8b7fa1aea0 100644
--- a/spec/lib/record_loader/primer_panel_loader_spec.rb
+++ b/spec/lib/record_loader/primer_panel_loader_spec.rb
@@ -4,7 +4,7 @@
require 'record_loader/primer_panel_loader'
# This file was initially generated via `rails g record_loader`
-RSpec.describe RecordLoader::PrimerPanelLoader, loader: true, type: :model do
+RSpec.describe RecordLoader::PrimerPanelLoader, :loader, type: :model do
def a_new_record_loader
described_class.new(directory: test_directory, files: selected_files)
end
diff --git a/spec/lib/record_loader/product_catalogue_loader_spec.rb b/spec/lib/record_loader/product_catalogue_loader_spec.rb
index f2ae05a7df..746dad5f78 100644
--- a/spec/lib/record_loader/product_catalogue_loader_spec.rb
+++ b/spec/lib/record_loader/product_catalogue_loader_spec.rb
@@ -4,7 +4,7 @@
require 'record_loader/product_catalogue_loader'
# This file was initially generated via `rails g record_loader`
-RSpec.describe RecordLoader::ProductCatalogueLoader, loader: true, type: :model do
+RSpec.describe RecordLoader::ProductCatalogueLoader, :loader, type: :model do
subject(:record_loader) { described_class.new(directory: test_directory, files: selected_files) }
# Tests use a separate directory to avoid coupling your specs to the data
diff --git a/spec/lib/record_loader/request_information_type_loader_spec.rb b/spec/lib/record_loader/request_information_type_loader_spec.rb
index 9408c97518..c60d703ca9 100644
--- a/spec/lib/record_loader/request_information_type_loader_spec.rb
+++ b/spec/lib/record_loader/request_information_type_loader_spec.rb
@@ -4,7 +4,7 @@
require 'record_loader/request_information_type_loader'
# This file was initially generated via `rails g record_loader`
-RSpec.describe RecordLoader::RequestInformationTypeLoader, loader: true, type: :model do
+RSpec.describe RecordLoader::RequestInformationTypeLoader, :loader, type: :model do
subject(:record_loader) { described_class.new(directory: test_directory, files: selected_files) }
# Tests use a separate directory to avoid coupling your specs to the data
diff --git a/spec/lib/record_loader/request_type_loader_spec.rb b/spec/lib/record_loader/request_type_loader_spec.rb
index f9adadbf66..b059bc6d32 100644
--- a/spec/lib/record_loader/request_type_loader_spec.rb
+++ b/spec/lib/record_loader/request_type_loader_spec.rb
@@ -4,7 +4,7 @@
require 'record_loader/request_type_loader'
# This file was initially generated via `rails g record_loader`
-RSpec.describe RecordLoader::RequestTypeLoader, loader: true, type: :model do
+RSpec.describe RecordLoader::RequestTypeLoader, :loader, type: :model do
def a_new_record_loader(files = selected_files)
described_class.new(directory: test_directory, files: files)
end
diff --git a/spec/lib/record_loader/request_type_validators_loader_spec.rb b/spec/lib/record_loader/request_type_validators_loader_spec.rb
index 8383108045..a65411a494 100644
--- a/spec/lib/record_loader/request_type_validators_loader_spec.rb
+++ b/spec/lib/record_loader/request_type_validators_loader_spec.rb
@@ -4,7 +4,7 @@
require 'record_loader/request_type_validators_loader'
# This file was initially generated via `rails g record_loader`
-RSpec.describe RecordLoader::RequestTypeValidatorsLoader, loader: true, type: :model do
+RSpec.describe RecordLoader::RequestTypeValidatorsLoader, :loader, type: :model do
subject(:record_loader) { described_class.new(directory: test_directory, files: selected_files) }
# Tests use a separate directory to avoid coupling your specs to the data
diff --git a/spec/lib/record_loader/robot_loader_spec.rb b/spec/lib/record_loader/robot_loader_spec.rb
index 7aad02a200..89ba93e00c 100644
--- a/spec/lib/record_loader/robot_loader_spec.rb
+++ b/spec/lib/record_loader/robot_loader_spec.rb
@@ -4,7 +4,7 @@
require 'record_loader/robot_loader'
# This file was initially generated via `rails g record_loader`
-RSpec.describe RecordLoader::RobotLoader, loader: true, type: :model do
+RSpec.describe RecordLoader::RobotLoader, :loader, type: :model do
def a_new_record_loader
described_class.new(directory: test_directory, files: selected_files)
end
diff --git a/spec/lib/record_loader/robot_property_loader_spec.rb b/spec/lib/record_loader/robot_property_loader_spec.rb
index 51bcbcd3ad..97f87216b8 100644
--- a/spec/lib/record_loader/robot_property_loader_spec.rb
+++ b/spec/lib/record_loader/robot_property_loader_spec.rb
@@ -4,7 +4,7 @@
require 'record_loader/robot_property_loader'
# This file was initially generated via `rails g record_loader`
-RSpec.describe RecordLoader::RobotPropertyLoader, loader: true, type: :model do
+RSpec.describe RecordLoader::RobotPropertyLoader, :loader, type: :model do
def a_new_record_loader
described_class.new(directory: test_directory, files: selected_files)
end
diff --git a/spec/lib/record_loader/submission_template_loader_spec.rb b/spec/lib/record_loader/submission_template_loader_spec.rb
index 5529647e8f..ec1b61bc76 100644
--- a/spec/lib/record_loader/submission_template_loader_spec.rb
+++ b/spec/lib/record_loader/submission_template_loader_spec.rb
@@ -4,7 +4,7 @@
require 'record_loader/submission_template_loader'
# This file was initially generated via `rails g record_loader`
-RSpec.describe RecordLoader::SubmissionTemplateLoader, loader: true, type: :model do
+RSpec.describe RecordLoader::SubmissionTemplateLoader, :loader, type: :model do
subject(:record_loader) { described_class.new(directory: test_directory, files: selected_files) }
# Tests use a separate directory to avoid coupling your specs to the data
diff --git a/spec/lib/record_loader/tag_group_adapter_type_loader_spec.rb b/spec/lib/record_loader/tag_group_adapter_type_loader_spec.rb
index de38250454..67eb493780 100644
--- a/spec/lib/record_loader/tag_group_adapter_type_loader_spec.rb
+++ b/spec/lib/record_loader/tag_group_adapter_type_loader_spec.rb
@@ -4,7 +4,7 @@
require 'record_loader/tag_group_adapter_type_loader'
# This file was initially generated via `rails g record_loader`
-RSpec.describe RecordLoader::TagGroupAdapterTypeLoader, loader: true, type: :model do
+RSpec.describe RecordLoader::TagGroupAdapterTypeLoader, :loader, type: :model do
def a_new_record_loader
described_class.new(directory: test_directory, files: selected_files)
end
diff --git a/spec/lib/record_loader/tag_group_loader_spec.rb b/spec/lib/record_loader/tag_group_loader_spec.rb
index 4d9dd537a2..26428c2b54 100644
--- a/spec/lib/record_loader/tag_group_loader_spec.rb
+++ b/spec/lib/record_loader/tag_group_loader_spec.rb
@@ -4,7 +4,7 @@
require 'record_loader/tag_group_loader'
# This file was initially generated via `rails g record_loader`
-RSpec.describe RecordLoader::TagGroupLoader, loader: true, type: :model do
+RSpec.describe RecordLoader::TagGroupLoader, :loader, type: :model do
def a_new_record_loader
described_class.new(directory: test_directory, files: selected_files)
end
diff --git a/spec/lib/record_loader/tag_layout_templates_loader_spec.rb b/spec/lib/record_loader/tag_layout_templates_loader_spec.rb
index 9777d1801e..d8a1e153bb 100644
--- a/spec/lib/record_loader/tag_layout_templates_loader_spec.rb
+++ b/spec/lib/record_loader/tag_layout_templates_loader_spec.rb
@@ -4,7 +4,7 @@
require 'record_loader/tag_layout_templates_loader'
# This file was initially generated via `rails g record_loader`
-RSpec.describe RecordLoader::TagLayoutTemplatesLoader, loader: true, type: :model do
+RSpec.describe RecordLoader::TagLayoutTemplatesLoader, :loader, type: :model do
def a_new_record_loader
described_class.new(directory: test_directory, files: selected_files)
end
diff --git a/spec/lib/record_loader/transfer_template_loader_spec.rb b/spec/lib/record_loader/transfer_template_loader_spec.rb
index 75bcfaaa6a..5f8944a43b 100644
--- a/spec/lib/record_loader/transfer_template_loader_spec.rb
+++ b/spec/lib/record_loader/transfer_template_loader_spec.rb
@@ -3,7 +3,7 @@
require 'rails_helper'
require 'record_loader/transfer_template_loader'
-RSpec.describe RecordLoader::TransferTemplateLoader, loader: true, type: :model do
+RSpec.describe RecordLoader::TransferTemplateLoader, :loader, type: :model do
subject(:record_loader) { described_class.new(directory: test_directory, files: selected_files) }
let(:test_directory) { Rails.root.join('spec/data/record_loader/transfer_templates') }
diff --git a/spec/lib/record_loader/tube_purpose_loader_spec.rb b/spec/lib/record_loader/tube_purpose_loader_spec.rb
index c9a27004d0..d4ee0a2e47 100644
--- a/spec/lib/record_loader/tube_purpose_loader_spec.rb
+++ b/spec/lib/record_loader/tube_purpose_loader_spec.rb
@@ -4,7 +4,7 @@
require 'record_loader/tube_purpose_loader'
# This file was initially generated via `rails g record_loader`
-RSpec.describe RecordLoader::TubePurposeLoader, loader: true, type: :model do
+RSpec.describe RecordLoader::TubePurposeLoader, :loader, type: :model do
def a_new_record_loader
described_class.new(directory: test_directory, files: selected_files)
end
diff --git a/spec/lib/record_loader/tube_rack_purpose_loader_spec.rb b/spec/lib/record_loader/tube_rack_purpose_loader_spec.rb
index 4e5ace932f..867a6b552f 100644
--- a/spec/lib/record_loader/tube_rack_purpose_loader_spec.rb
+++ b/spec/lib/record_loader/tube_rack_purpose_loader_spec.rb
@@ -4,7 +4,7 @@
require 'record_loader/tube_rack_purpose_loader'
# This file was initially generated via `rails g record_loader`
-RSpec.describe RecordLoader::TubeRackPurposeLoader, loader: true, type: :model do
+RSpec.describe RecordLoader::TubeRackPurposeLoader, :loader, type: :model do
subject(:record_loader) { described_class.new(directory: test_directory, files: selected_files) }
# Tests use a separate directory to avoid coupling your specs to the data
diff --git a/spec/models/ability_spec.rb b/spec/models/ability_spec.rb
index bae36c99dd..f0a69e9262 100644
--- a/spec/models/ability_spec.rb
+++ b/spec/models/ability_spec.rb
@@ -110,7 +110,7 @@ def merge_permissions(*permissions)
end
shared_examples 'it grants only granted_permissions' do
- it 'grants expected permissions', aggregate_failures: true do
+ it 'grants expected permissions', :aggregate_failures do
all_actions.each do |klass, action|
next unless granted_permissions.fetch(klass, []).include?(action)
@@ -118,7 +118,7 @@ def merge_permissions(*permissions)
end
end
- it 'does not grant unexpected permissions', aggregate_failures: true do
+ it 'does not grant unexpected permissions', :aggregate_failures do
all_actions.each do |klass, action|
next if granted_permissions.fetch(klass, []).include?(action)
diff --git a/spec/models/broadcast_event/broadcast_event_spec.rb b/spec/models/broadcast_event/broadcast_event_spec.rb
index dc0e460fb5..e98ea36287 100644
--- a/spec/models/broadcast_event/broadcast_event_spec.rb
+++ b/spec/models/broadcast_event/broadcast_event_spec.rb
@@ -102,7 +102,7 @@ def accessible
end
end
-RSpec.describe BroadcastEvent, broadcast_event: true do
+RSpec.describe BroadcastEvent, :broadcast_event do
it 'is not directly instantiated' do
expect(described_class.new).not_to be_valid
end
@@ -149,7 +149,7 @@ def accessible
it 'has five subjects' do
expect(event.subjects).to be_present
- assert_equal 5, event.subjects.length
+ expect(event.subjects.length).to eq(5)
end
it 'finds subjects with a 1 to many relationship' do
@@ -199,7 +199,7 @@ def accessible
end
it 'finds all metadata as a hash' do
- assert_equal({ 'data_a' => value_a, 'data_b' => value_b, 'data_c' => 'value_c' }, event.metadata)
+ expect(event.metadata).to eq({ 'data_a' => value_a, 'data_b' => value_b, 'data_c' => 'value_c' })
end
describe '#routing_key' do
@@ -258,7 +258,7 @@ def accessible
'lims' => 'SQSCP'
}
- assert_equal expected_json, JSON.parse(event.to_json)
+ expect(JSON.parse(event.to_json)).to eq(expected_json)
end
end
end
diff --git a/spec/models/broadcast_event/helpers/external_subjects_spec.rb b/spec/models/broadcast_event/helpers/external_subjects_spec.rb
index bc349d47cc..fe0a44598a 100644
--- a/spec/models/broadcast_event/helpers/external_subjects_spec.rb
+++ b/spec/models/broadcast_event/helpers/external_subjects_spec.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
require 'rails_helper'
-RSpec.describe BroadcastEvent::Helpers::ExternalSubjects, heron_events: true do
+RSpec.describe BroadcastEvent::Helpers::ExternalSubjects, :heron_events do
let(:testing_event_class) { Class.new(BroadcastEvent) { include BroadcastEvent::Helpers::ExternalSubjects } }
let(:labware) { create :labware }
let(:sub1) do
diff --git a/spec/models/broadcast_event/lab_event_spec.rb b/spec/models/broadcast_event/lab_event_spec.rb
index df3d9a5385..572d91c3bd 100644
--- a/spec/models/broadcast_event/lab_event_spec.rb
+++ b/spec/models/broadcast_event/lab_event_spec.rb
@@ -4,7 +4,7 @@
require 'rails_helper'
-RSpec.describe BroadcastEvent::LabEvent, broadcast_event: true do
+RSpec.describe BroadcastEvent::LabEvent, :broadcast_event do
subject do
described_class.create!(seed: lab_event, user: user, created_at: Time.zone.parse('2018-01-12T13:37:03+00:00'))
end
diff --git a/spec/models/broadcast_event/library_complete_spec.rb b/spec/models/broadcast_event/library_complete_spec.rb
index e43566e479..a0233be7fe 100644
--- a/spec/models/broadcast_event/library_complete_spec.rb
+++ b/spec/models/broadcast_event/library_complete_spec.rb
@@ -3,7 +3,7 @@
require 'rails_helper'
require 'shared_contexts/limber_shared_context'
-RSpec.describe BroadcastEvent::LibraryComplete, broadcast_event: true do
+RSpec.describe BroadcastEvent::LibraryComplete, :broadcast_event do
include_context 'a limber target plate with submissions'
let(:user) { create(:user) }
diff --git a/spec/models/broadcast_event/plate_cherrypicked_spec.rb b/spec/models/broadcast_event/plate_cherrypicked_spec.rb
index 87cccba490..b28c9f4031 100644
--- a/spec/models/broadcast_event/plate_cherrypicked_spec.rb
+++ b/spec/models/broadcast_event/plate_cherrypicked_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-RSpec.describe BroadcastEvent::PlateCherrypicked, broadcast_event: true, heron_events: true do
+RSpec.describe BroadcastEvent::PlateCherrypicked, :broadcast_event, :heron_events do
def subject_record(subject_type, role_type, friendly_name, uuid)
{ role_type: role_type, subject_type: subject_type, friendly_name: friendly_name, uuid: uuid }
end
diff --git a/spec/models/broadcast_event/pool_released_spec.rb b/spec/models/broadcast_event/pool_released_spec.rb
index 1d95feb00b..8d2cf90a48 100644
--- a/spec/models/broadcast_event/pool_released_spec.rb
+++ b/spec/models/broadcast_event/pool_released_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-RSpec.describe BroadcastEvent::PoolReleased, broadcast_event: true do
+RSpec.describe BroadcastEvent::PoolReleased, :broadcast_event do
let(:source_plate) do
pl = create :full_stock_plate
pl.wells.first.aliquots << (create :aliquot, sample: tube.samples.first)
diff --git a/spec/models/broadcast_event/qc_assay_spec.rb b/spec/models/broadcast_event/qc_assay_spec.rb
index 46e8eb39cc..a611892d5c 100644
--- a/spec/models/broadcast_event/qc_assay_spec.rb
+++ b/spec/models/broadcast_event/qc_assay_spec.rb
@@ -4,7 +4,7 @@
require 'rails_helper'
-RSpec.describe BroadcastEvent::QcAssay, broadcast_event: true do
+RSpec.describe BroadcastEvent::QcAssay, :broadcast_event do
subject do
described_class.create!(
seed: qc_assay,
diff --git a/spec/models/broadcast_event/sequencing_complete_spec.rb b/spec/models/broadcast_event/sequencing_complete_spec.rb
index 61be5fcda8..b7e7690b1a 100644
--- a/spec/models/broadcast_event/sequencing_complete_spec.rb
+++ b/spec/models/broadcast_event/sequencing_complete_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-RSpec.describe BroadcastEvent::SequencingComplete, broadcast_event: true do
+RSpec.describe BroadcastEvent::SequencingComplete, :broadcast_event do
let(:user) { create(:user) }
let(:study) { create(:study) }
let(:project) { create(:project) }
diff --git a/spec/models/illumina_htp/requests/heron_request_spec.rb b/spec/models/illumina_htp/requests/heron_request_spec.rb
index 42cdb89877..8f38925810 100644
--- a/spec/models/illumina_htp/requests/heron_request_spec.rb
+++ b/spec/models/illumina_htp/requests/heron_request_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-describe IlluminaHtp::Requests::HeronRequest, heron: true do
+describe IlluminaHtp::Requests::HeronRequest, :heron do
subject(:request) { create :heron_request }
describe '#request_metadata' do
diff --git a/spec/models/illumina_htp/requests/heron_tailed_request_spec.rb b/spec/models/illumina_htp/requests/heron_tailed_request_spec.rb
index cb4f48ab68..8cc8468612 100644
--- a/spec/models/illumina_htp/requests/heron_tailed_request_spec.rb
+++ b/spec/models/illumina_htp/requests/heron_tailed_request_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-describe IlluminaHtp::Requests::HeronTailedRequest, heron: true do
+describe IlluminaHtp::Requests::HeronTailedRequest, :heron do
subject(:request) { build :heron_tailed_request }
describe '#request_metadata' do
diff --git a/spec/models/labware_spec.rb b/spec/models/labware_spec.rb
index 4d3bf663e5..5db0d34af9 100644
--- a/spec/models/labware_spec.rb
+++ b/spec/models/labware_spec.rb
@@ -18,19 +18,19 @@
let(:plate_fluidigm_2) { fluidigm_plates_list[1] }
it 'correctly finds a single ean13 barcode' do
- expect(described_class.with_barcode(plate_ean13_1.machine_barcode)).to match_array([plate_ean13_1])
+ expect(described_class.with_barcode(plate_ean13_1.machine_barcode)).to contain_exactly(plate_ean13_1)
end
it 'does not find anything when sent a non-valid ean13 barcode' do
- expect(described_class.with_barcode('1234567890123')).to match_array([])
+ expect(described_class.with_barcode('1234567890123')).to be_empty
end
it 'correctly finds a plate with a single fluidigm barcode' do
- expect(described_class.with_barcode(plate_fluidigm_1.fluidigm_barcode)).to match_array([plate_fluidigm_1])
+ expect(described_class.with_barcode(plate_fluidigm_1.fluidigm_barcode)).to contain_exactly(plate_fluidigm_1)
end
it 'does not find anything when sent any other string' do
- expect(described_class.with_barcode('INVALID123ABC')).to match_array([])
+ expect(described_class.with_barcode('INVALID123ABC')).to be_empty
end
context 'with valid barcodes' do
diff --git a/spec/models/linear_submission_spec.rb b/spec/models/linear_submission_spec.rb
index 2b5bf1ab91..502d9b2cd0 100644
--- a/spec/models/linear_submission_spec.rb
+++ b/spec/models/linear_submission_spec.rb
@@ -57,9 +57,10 @@
mpx_submission.requests.each do |request|
assert request.qc_metrics.include?(expected_metric),
"Metric not included in #{request.request_type.name}: #{request.qc_metrics.inspect}"
- assert_equal true,
- request.request_metadata.customer_accepts_responsibility,
- "Customer doesn't accept responsibility"
+ expect(request.request_metadata.customer_accepts_responsibility).to(
+ be(true),
+ "Customer doesn't accept responsibility"
+ )
end
end
end
@@ -181,7 +182,7 @@
end
it "save a comment if there's one passed in" do
- assert_equal ['This is a comment'], submission.comments
+ expect(submission.comments).to eq(['This is a comment'])
end
describe '#process!' do
@@ -197,7 +198,7 @@
let(:sequencing_request) { submission.requests.find_by!(request_type_id: sequencing_request_type.id) }
it 'assign submission ids to the requests' do
- assert_equal submission, submission.requests.first.submission
+ expect(submission.requests.first.submission).to eq(submission)
end
it 'sets metadata on library creation requests' do
diff --git a/spec/models/location_report_form_spec.rb b/spec/models/location_report_form_spec.rb
index 3f4d6026c2..830e90742a 100644
--- a/spec/models/location_report_form_spec.rb
+++ b/spec/models/location_report_form_spec.rb
@@ -193,7 +193,7 @@
expect(location_report_form.location_report).to be_valid
end
- it 'correctly records the form object information in the location report', aggregate_failures: true do
+ it 'correctly records the form object information in the location report', :aggregate_failures do
expect(location_report_form.location_report.name).to eq('Test_name')
expect(location_report_form.location_report.report_type).to eq('type_selection')
expect(location_report_form.location_report.faculty_sponsor_ids).to eq([study_1_sponsor.id])
@@ -261,7 +261,7 @@
expect(location_report_form.location_report).to be_valid
end
- it 'correctly records the form object information in the location report', aggregate_failures: true do
+ it 'correctly records the form object information in the location report', :aggregate_failures do
expect(location_report_form.location_report.name).to eq('Test_name')
expect(location_report_form.location_report.report_type).to eq('type_labwhere')
expect(location_report_form.location_report.location_barcode).to eq('1001')
diff --git a/spec/models/lot_type_spec.rb b/spec/models/lot_type_spec.rb
index 0842c73da4..d2a76a4121 100644
--- a/spec/models/lot_type_spec.rb
+++ b/spec/models/lot_type_spec.rb
@@ -29,8 +29,8 @@
end
it 'set the lot properties' do
- assert_equal user, lot.user
- assert_equal '123456789', lot.lot_number
+ expect(lot.user).to eq(user)
+ expect(lot.lot_number).to eq('123456789')
end
end
end
diff --git a/spec/models/orders/order_spec.rb b/spec/models/orders/order_spec.rb
index accbb56ea7..2953056178 100644
--- a/spec/models/orders/order_spec.rb
+++ b/spec/models/orders/order_spec.rb
@@ -80,9 +80,9 @@
yielded = false
order.duplicates_within(1.month) do |samples, orders, submissions|
yielded = true
- assert_equal [asset_a.samples.first], samples
- assert_equal [@secondary_order], orders
- assert_equal [@secondary_submission], submissions
+ expect(samples).to eq([asset_a.samples.first])
+ expect(orders).to eq([@secondary_order])
+ expect(submissions).to eq([@secondary_submission])
end
assert yielded, 'duplicates_within failed to yield'
end
diff --git a/spec/models/phi_x/spiked_buffer_spec.rb b/spec/models/phi_x/spiked_buffer_spec.rb
index b5b885f2a1..260178d970 100644
--- a/spec/models/phi_x/spiked_buffer_spec.rb
+++ b/spec/models/phi_x/spiked_buffer_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-RSpec.describe PhiX::SpikedBuffer, phi_x: true do
+RSpec.describe PhiX::SpikedBuffer, :phi_x do
subject { build :phi_x_spiked_buffer, custom_options }
context 'with suitable options' do
diff --git a/spec/models/phi_x/stock_spec.rb b/spec/models/phi_x/stock_spec.rb
index 93588e3fe4..51a0a54097 100644
--- a/spec/models/phi_x/stock_spec.rb
+++ b/spec/models/phi_x/stock_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-RSpec.describe PhiX::Stock, phi_x: true do
+RSpec.describe PhiX::Stock, :phi_x do
subject { build :phi_x_stock, custom_options }
context 'with suitable options' do
diff --git a/spec/models/pick_list_spec.rb b/spec/models/pick_list_spec.rb
index 160e98414f..b2c6524d37 100644
--- a/spec/models/pick_list_spec.rb
+++ b/spec/models/pick_list_spec.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
require 'rails_helper'
-RSpec.describe PickList, pick_list: true do
+RSpec.describe PickList, :pick_list do
subject(:pick_list) { described_class.new(pick_attributes: picks, asynchronous: asynchronous) }
let(:wells) { create_list :untagged_well, 2 }
diff --git a/spec/models/plate_purpose_spec.rb b/spec/models/plate_purpose_spec.rb
index 3fce2781d4..f2a7fabf6e 100644
--- a/spec/models/plate_purpose_spec.rb
+++ b/spec/models/plate_purpose_spec.rb
@@ -7,7 +7,6 @@
let(:plate_purpose) { create :plate_purpose, target_type: target_type, size: size }
shared_examples 'a plate factory' do
- # rubocop:todo RSpec/ExpectInHook
before { expect(PlateBarcode).to receive(:create_barcode).and_return(build(:plate_barcode)) }
# rubocop:enable RSpec/ExpectInHook
diff --git a/spec/models/plate_volume_spec.rb b/spec/models/plate_volume_spec.rb
index 61b948ac12..c80793bad0 100644
--- a/spec/models/plate_volume_spec.rb
+++ b/spec/models/plate_volume_spec.rb
@@ -100,7 +100,7 @@
plate_with_barcodes_in_csv
.wells
.includes(:well_attribute, :map)
- .each do |well|
+ .find_each do |well|
expect(well.qc_results).to be_one
expect(well.qc_results.first.key).to eq('volume')
expect(well.qc_results.first.assay_type).to eq('Volume Check')
diff --git a/spec/models/pooling_spec.rb b/spec/models/pooling_spec.rb
index fa1624aad1..955bd4eb46 100644
--- a/spec/models/pooling_spec.rb
+++ b/spec/models/pooling_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-describe Pooling, poolings: true do
+describe Pooling, :poolings do
let(:empty_lb_tube) { create :empty_library_tube, barcode: 1 }
let(:untagged_lb_tube1) { create :library_tube, barcode: 2 }
let(:untagged_lb_tube2) { create :library_tube, barcode: 3 }
@@ -94,7 +94,7 @@
)
end
- it 'sets up child relationships', aggregate_failures: true do
+ it 'sets up child relationships', :aggregate_failures do
expect(pooling.execute).to be true
input_tubes = Labware.with_barcode(barcodes)
expect(input_tubes.all? { |l| l.children.include?(pooling.stock_mx_tube) }).to be true
diff --git a/spec/models/qc_result/qc_result_factory_spec.rb b/spec/models/qc_result/qc_result_factory_spec.rb
index fa99a579aa..f65b592697 100644
--- a/spec/models/qc_result/qc_result_factory_spec.rb
+++ b/spec/models/qc_result/qc_result_factory_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-RSpec.describe QcResultFactory, qc_result: true do
+RSpec.describe QcResultFactory, :qc_result do
describe 'multiple resources' do
let(:asset_1) { attributes_for(:qc_result).merge(uuid: create(:receptacle).uuid) }
let(:asset_2) { attributes_for(:qc_result).merge(uuid: create(:receptacle).uuid) }
@@ -26,9 +26,9 @@
factory = described_class.new([asset_1, asset_2, asset_3])
expect(factory).to be_valid
expect(factory.save).to be_truthy
- expect(QcResult.all.count).to eq(3)
- expect(QcAssay.all.count).to eq(1)
- QcResult.all.each { |qc_result| expect(qc_result.qc_assay).to eq QcAssay.last }
+ expect(QcResult.count).to eq(3)
+ expect(QcAssay.count).to eq(1)
+ QcResult.find_each { |qc_result| expect(qc_result.qc_assay).to eq QcAssay.last }
end
it 'produces sensible error messages if the resource is not valid' do
@@ -67,9 +67,9 @@
factory = described_class.new(qc_results: [asset_1, asset_2, asset_3], lot_number: 'LN1234567')
expect(factory).to be_valid
expect(factory.save).to be_truthy
- expect(QcResult.all.count).to eq(3)
- expect(QcAssay.all.count).to eq(1)
- QcResult.all.each { |qc_result| expect(qc_result.qc_assay).to eq QcAssay.last }
+ expect(QcResult.count).to eq(3)
+ expect(QcAssay.count).to eq(1)
+ QcResult.find_each { |qc_result| expect(qc_result.qc_assay).to eq QcAssay.last }
end
end
@@ -93,7 +93,7 @@
it 'will save all of the assets with valid wells' do
expect(factory.save).to be_truthy
- expect(QcResult.all.count).to eq(2)
+ expect(QcResult.count).to eq(2)
end
end
end
diff --git a/spec/models/qc_result/qc_result_spec.rb b/spec/models/qc_result/qc_result_spec.rb
index 2f68744670..68143b16cd 100644
--- a/spec/models/qc_result/qc_result_spec.rb
+++ b/spec/models/qc_result/qc_result_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-RSpec.describe QcResult, qc_result: true do
+RSpec.describe QcResult, :qc_result do
it 'is not valid without a key' do
expect(build(:qc_result, key: nil)).not_to be_valid
end
@@ -60,7 +60,7 @@
end
end
-describe QcResult, warren: true do
+describe QcResult, :warren do
let(:warren) { Warren.handler }
before { warren.clear_messages }
diff --git a/spec/models/request_spec.rb b/spec/models/request_spec.rb
index be8f089ca1..394700e974 100644
--- a/spec/models/request_spec.rb
+++ b/spec/models/request_spec.rb
@@ -85,7 +85,7 @@
before { @request2 = create :request, submission: @submission, request_type: @genotyping_request_type }
it 'return the correct next request' do
- assert_equal [@request2], @request1.next_requests
+ expect(@request1.next_requests).to eq([@request2])
end
end
@@ -95,7 +95,7 @@
end
it 'return the correct next request' do
- assert_equal [@request2], @request1.next_requests
+ expect(@request1.next_requests).to eq([@request2])
end
end
end
@@ -243,7 +243,7 @@
@request.request_metadata.attributes.merge('id' => nil, 'request_id' => nil, 'updated_at' => nil)
copied_attributes =
@new_request.request_metadata.attributes.merge('id' => nil, 'request_id' => nil, 'updated_at' => nil)
- assert_equal original_attributes, copied_attributes
+ expect(copied_attributes).to eq(original_attributes)
end
it 'remove target_asset' do
@@ -279,7 +279,7 @@
context 'when a new request is created' do
it "return the default state 'pending'" do
- assert_equal 'pending', @request.state
+ expect(@request.state).to eq('pending')
end
end
@@ -324,19 +324,19 @@
end
it "return status of 'passed'" do
- assert_equal 'passed', @request.state
+ expect(@request.state).to eq('passed')
end
it 'not be pending' do
- assert_equal false, @request.pending?
+ expect(@request.pending?).to be(false)
end
it 'not be failed' do
- assert_equal false, @request.failed?
+ expect(@request.failed?).to be(false)
end
it 'not be started' do
- assert_equal false, @request.started?
+ expect(@request.started?).to be(false)
end
it 'be passed' do
@@ -360,19 +360,19 @@
end
it "return status of 'failed'" do
- assert_equal 'failed', @request.state
+ expect(@request.state).to eq('failed')
end
it 'not be pending' do
- assert_equal false, @request.pending?
+ expect(@request.pending?).to be(false)
end
it 'not be passed' do
- assert_equal false, @request.passed?
+ expect(@request.passed?).to be(false)
end
it 'not be started' do
- assert_equal false, @request.started?
+ expect(@request.started?).to be(false)
end
it 'be failed' do
@@ -412,18 +412,18 @@
@all_states.each { |state| create :request, state: state }
- assert_equal @all_states.size, described_class.count
+ expect(described_class.count).to eq(@all_states.size)
end
context 'open requests' do
it 'total right number' do
- assert_equal @open_states.size, described_class.opened.count
+ expect(described_class.opened.count).to eq(@open_states.size)
end
end
context 'closed requests' do
it 'total right number' do
- assert_equal @closed_states.size, described_class.closed.count
+ expect(described_class.closed.count).to eq(@closed_states.size)
end
end
end
@@ -432,7 +432,7 @@
before { @library_creation_request = create(:library_creation_request_for_testing_sequencing_requests) }
it 'check any non-sequencing request is always ready' do
- assert_equal true, @library_creation_request.ready?
+ expect(@library_creation_request.ready?).to be(true)
end
end
diff --git a/spec/models/request_type_spec.rb b/spec/models/request_type_spec.rb
index e575fe6e46..fa008faaee 100644
--- a/spec/models/request_type_spec.rb
+++ b/spec/models/request_type_spec.rb
@@ -38,7 +38,7 @@
it 'set purpose on request' do
request = @nrequest_type.create!
- assert_equal 'internal', request.request_purpose
+ expect(request.request_purpose).to eq('internal')
end
end
diff --git a/spec/models/robot/pick_data_spec.rb b/spec/models/robot/pick_data_spec.rb
index 81157bbd76..b5518b3c2d 100644
--- a/spec/models/robot/pick_data_spec.rb
+++ b/spec/models/robot/pick_data_spec.rb
@@ -3,10 +3,10 @@
require 'rails_helper'
require './spec/models/robot/pick_hash_tester_helper'
-RSpec.describe Robot::PickData, robot_verification: true do
+RSpec.describe Robot::PickData, :robot_verification do
subject(:pick_data) { described_class.new(batch, max_beds: 2) }
- around { |example| travel_to(time) { example.run } }
+ before { travel_to(time) }
describe '#picking_data_hash' do
let(:time) { Time.zone.local(2010, 7, 12, 10, 25, 0) }
diff --git a/spec/models/robot/verification/source_dest_beds_spec.rb b/spec/models/robot/verification/source_dest_beds_spec.rb
index 97ec98ddf9..03b030c91b 100644
--- a/spec/models/robot/verification/source_dest_beds_spec.rb
+++ b/spec/models/robot/verification/source_dest_beds_spec.rb
@@ -3,7 +3,7 @@
require 'rails_helper'
require 'broadcast_event/lab_event'
-RSpec.describe Robot::Verification::SourceDestBeds, robot_verification: true do
+RSpec.describe Robot::Verification::SourceDestBeds, :robot_verification do
subject(:verifier) { described_class.new }
# We test pick_number_to_expected_layout and pick_numbers with shared contexts
@@ -33,6 +33,7 @@
end
end
end
+
let(:source_plate_1) { create :plate, well_count: 2 }
let(:source_plate_3) { create :plate, well_count: 2 }
let(:destination_plate) { create :plate, well_count: 9 }
@@ -126,7 +127,7 @@
end
it 'does not add extra plates' do
- assert_equal plate_index_lookup.length, barcodes.length
+ expect(barcodes.length).to eq(plate_index_lookup.length)
end
end
@@ -155,7 +156,7 @@
end
it 'order source plates by destination well barcode to match the way the robot picks' do
- assert_equal expected_order, source_index
+ expect(source_index).to eq(expected_order)
end
end
diff --git a/spec/models/robot/verification/source_dest_control_beds_spec.rb b/spec/models/robot/verification/source_dest_control_beds_spec.rb
index 0d9b34626e..8785f6f502 100644
--- a/spec/models/robot/verification/source_dest_control_beds_spec.rb
+++ b/spec/models/robot/verification/source_dest_control_beds_spec.rb
@@ -3,7 +3,7 @@
require 'rails_helper'
require 'broadcast_event/lab_event'
-RSpec.describe Robot::Verification::SourceDestControlBeds, robot_verification: true do
+RSpec.describe Robot::Verification::SourceDestControlBeds, :robot_verification do
subject(:verifier) { described_class.new }
describe '#pick_number_to_expected_layout' do
diff --git a/spec/models/sample_compound_component_spec.rb b/spec/models/sample_compound_component_spec.rb
index 579c841036..3ed7acfd51 100644
--- a/spec/models/sample_compound_component_spec.rb
+++ b/spec/models/sample_compound_component_spec.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: true
-RSpec.describe SampleCompoundComponent, cardinal: true do
+RSpec.describe SampleCompoundComponent, :cardinal do
describe '#validate' do
let(:compound_sample) { create(:sample) }
let(:component_sample) { create(:sample) }
diff --git a/spec/models/sample_manifest/generator_spec.rb b/spec/models/sample_manifest/generator_spec.rb
index 28d36c4eb1..dea5c17c3e 100644
--- a/spec/models/sample_manifest/generator_spec.rb
+++ b/spec/models/sample_manifest/generator_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-RSpec.describe SampleManifest::Generator, sample_manifest: true, sample_manifest_excel: true do
+RSpec.describe SampleManifest::Generator, :sample_manifest, :sample_manifest_excel do
before(:all) do
SampleManifestExcel.configure do |config|
config.folder = File.join('spec', 'data', 'sample_manifest_excel')
diff --git a/spec/models/sample_manifest/uploader_spec.rb b/spec/models/sample_manifest/uploader_spec.rb
index 92718af728..7487f6f7ba 100644
--- a/spec/models/sample_manifest/uploader_spec.rb
+++ b/spec/models/sample_manifest/uploader_spec.rb
@@ -3,7 +3,7 @@
require 'rails_helper'
require 'pry'
-RSpec.describe SampleManifest::Uploader, sample_manifest: true, sample_manifest_excel: true do
+RSpec.describe SampleManifest::Uploader, :sample_manifest, :sample_manifest_excel do
before(:all) do
SampleManifestExcel.configure do |config|
config.folder = File.join('spec', 'data', 'sample_manifest_excel')
@@ -161,7 +161,7 @@
expect(uploader.upload.sample_manifest).to be_completed
end
- it 'will generate sample accessions', accessioning_enabled: true do
+ it 'will generate sample accessions', :accessioning_enabled do
number_of_plates = 2
samples_per_plate = 2
download =
diff --git a/spec/models/sample_manifest_spec.rb b/spec/models/sample_manifest_spec.rb
index 5d28213792..a03fa5cd9c 100644
--- a/spec/models/sample_manifest_spec.rb
+++ b/spec/models/sample_manifest_spec.rb
@@ -5,7 +5,7 @@
# Rubocop doesn't like the .and change {}.by bits and will
# result in repeatedly indenting them to the level of the last call in the previous chain
-RSpec.describe SampleManifest, sample_manifest: true do
+RSpec.describe SampleManifest, :sample_manifest do
let(:user) { create :user }
let(:study) { create :study }
@@ -83,7 +83,7 @@
before { manifest.generate }
it 'create a plate of the correct purpose' do
- assert_equal purpose, Plate.last.purpose
+ expect(Plate.last.purpose).to eq(purpose)
end
end
end
@@ -142,7 +142,7 @@
before { manifest.generate }
it 'create a plate of the correct purpose' do
- assert_equal purpose, Plate.last.purpose
+ expect(Plate.last.purpose).to eq(purpose)
end
end
end
@@ -174,7 +174,7 @@
it 'create sample manifest asset' do
expect { manifest.generate }.to change(SampleManifestAsset, :count).by(count)
- expect(manifest.assets).to contain_exactly(*LibraryTube.with_barcode(manifest.barcodes).map(&:receptacle))
+ expect(manifest.assets).to match_array(LibraryTube.with_barcode(manifest.barcodes).map(&:receptacle))
end
context 'after generation' do
diff --git a/spec/models/sample_spec.rb b/spec/models/sample_spec.rb
index 8518fc8757..08042600fa 100644
--- a/spec/models/sample_spec.rb
+++ b/spec/models/sample_spec.rb
@@ -4,7 +4,7 @@
require 'support/barcode_helper'
require 'sample_accessioning_job'
-RSpec.describe Sample, accession: true, cardinal: true do
+RSpec.describe Sample, :accession, :cardinal do
include MockAccession
context 'accessioning' do
@@ -174,12 +174,12 @@
end
it 'compound samples are able to query their component samples' do
- expect(compound_sample.component_samples).to match_array [component_sample1, component_sample2]
+ expect(compound_sample.component_samples).to contain_exactly(component_sample1, component_sample2)
end
it 'component samples are able to query their compound samples' do
- expect(component_sample1.compound_samples).to match_array [compound_sample]
- expect(component_sample2.compound_samples).to match_array [compound_sample]
+ expect(component_sample1.compound_samples).to contain_exactly(compound_sample)
+ expect(component_sample2.compound_samples).to contain_exactly(compound_sample)
end
it 'removing a component sample removes both sides of the relationship' do
@@ -187,8 +187,8 @@
compound_sample.save
component_sample2.reload
- expect(compound_sample.component_samples).to match_array [component_sample1]
- expect(component_sample1.compound_samples).to match_array [compound_sample]
+ expect(compound_sample.component_samples).to contain_exactly(component_sample1)
+ expect(component_sample1.compound_samples).to contain_exactly(compound_sample)
expect(component_sample2.compound_samples).to be_empty
end
@@ -196,18 +196,18 @@
component_sample1.compound_samples.delete(compound_sample)
compound_sample.reload
- expect(compound_sample.component_samples).to match_array [component_sample2]
+ expect(compound_sample.component_samples).to contain_exactly(component_sample2)
expect(component_sample1.compound_samples).to be_empty
- expect(component_sample2.compound_samples).to match_array [compound_sample]
+ expect(component_sample2.compound_samples).to contain_exactly(compound_sample)
end
it 'component samples can belong to many compound samples' do
other_compound_sample = create(:sample, component_samples: [component_sample1])
component_sample1.reload
- expect(other_compound_sample.component_samples).to match_array [component_sample1]
- expect(component_sample1.compound_samples).to match_array [compound_sample, other_compound_sample]
- expect(component_sample2.compound_samples).to match_array [compound_sample]
+ expect(other_compound_sample.component_samples).to contain_exactly(component_sample1)
+ expect(component_sample1.compound_samples).to contain_exactly(compound_sample, other_compound_sample)
+ expect(component_sample2.compound_samples).to contain_exactly(compound_sample)
end
context 'changing associations modifies the updated_at time of affected samples' do
@@ -264,7 +264,7 @@
context '(DPL-148) on updating sample metadata' do
let(:sample) { create :sample }
- it 'triggers warehouse update', warren: true do
+ it 'triggers warehouse update', :warren do
expect do
# We try with a valid update
sample.sample_metadata.update(gender: 'Male')
diff --git a/spec/models/state_changer/initial_stock_tube_spec.rb b/spec/models/state_changer/initial_stock_tube_spec.rb
index c099cc5297..60aa04bc01 100644
--- a/spec/models/state_changer/initial_stock_tube_spec.rb
+++ b/spec/models/state_changer/initial_stock_tube_spec.rb
@@ -44,7 +44,7 @@
let(:target_state) { 'started' }
let(:request_state) { 'pending' }
- it 'updates the tube to "started" with "started" requests', aggregate_failures: true do
+ it 'updates the tube to "started" with "started" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('started')
expect(request.reload.state).to eq('started')
end
@@ -54,7 +54,7 @@
let(:target_state) { 'started' }
let(:request_state) { 'started' }
- it 'updates the tube to "started" with "started" requests', aggregate_failures: true do
+ it 'updates the tube to "started" with "started" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('started')
expect(request.reload.state).to eq('started')
end
@@ -64,7 +64,7 @@
let(:target_state) { 'started' }
let(:request_state) { 'failed' }
- it 'updates the tube to "started" with "failed" requests', aggregate_failures: true do
+ it 'updates the tube to "started" with "failed" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('started')
expect(request.reload.state).to eq('failed')
end
@@ -74,7 +74,7 @@
let(:target_state) { 'started' }
let(:request_state) { 'passed' }
- it 'updates the tube to "started" with "passed" requests', aggregate_failures: true do
+ it 'updates the tube to "started" with "passed" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('started')
expect(request.reload.state).to eq('passed')
end
@@ -84,7 +84,7 @@
let(:target_state) { 'started' }
let(:request_state) { 'cancelled' }
- it 'updates the tube to "started" with "cancelled" requests', aggregate_failures: true do
+ it 'updates the tube to "started" with "cancelled" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('started')
expect(request.reload.state).to eq('cancelled')
end
@@ -94,7 +94,7 @@
let(:target_state) { 'processed_1' }
let(:request_state) { 'pending' }
- it 'updates the tube to "processed_1" with "started" requests', aggregate_failures: true do
+ it 'updates the tube to "processed_1" with "started" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('processed_1')
expect(request.reload.state).to eq('started')
end
@@ -104,7 +104,7 @@
let(:target_state) { 'passed' }
let(:request_state) { 'pending' }
- it 'updates the tube to "passed" with "started" requests', aggregate_failures: true do
+ it 'updates the tube to "passed" with "started" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('passed')
expect(request.reload.state).to eq('started')
end
@@ -114,7 +114,7 @@
let(:target_state) { 'passed' }
let(:request_state) { 'cancelled' }
- it 'updates the tube to "passed" with "cancelled" requests', aggregate_failures: true do
+ it 'updates the tube to "passed" with "cancelled" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('passed')
expect(request.reload.state).to eq('cancelled')
end
@@ -124,7 +124,7 @@
let(:target_state) { 'failed' }
let(:request_state) { 'started' }
- it 'updates the tube to "failed" with "failed" requests', aggregate_failures: true do
+ it 'updates the tube to "failed" with "failed" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('failed')
expect(request.reload.state).to eq('failed')
end
@@ -134,7 +134,7 @@
let(:target_state) { 'failed' }
let(:request_state) { 'passed' }
- it 'updates the tube to "failed" with "failed" requests', aggregate_failures: true do
+ it 'updates the tube to "failed" with "failed" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('failed')
expect(request.reload.state).to eq('failed')
end
@@ -144,7 +144,7 @@
let(:target_state) { 'cancelled' }
let(:request_state) { 'pending' }
- it 'updates the tube to "cancelled" with "pending" requests', aggregate_failures: true do
+ it 'updates the tube to "cancelled" with "pending" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('cancelled')
expect(request.reload.state).to eq('pending')
end
@@ -158,7 +158,7 @@
let(:target_state) { 'processed_2' }
let(:request_state) { 'started' }
- it 'updates the tube to "processed_2" with "started" requests', aggregate_failures: true do
+ it 'updates the tube to "processed_2" with "started" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('processed_2')
expect(request.reload.state).to eq('started')
end
@@ -172,7 +172,7 @@
let(:target_state) { 'passed' }
let(:request_state) { 'started' }
- it 'updates the tube to "passed" with "started" requests', aggregate_failures: true do
+ it 'updates the tube to "passed" with "started" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('passed')
expect(request.reload.state).to eq('started')
end
@@ -182,7 +182,7 @@
let(:target_state) { 'failed' }
let(:request_state) { 'started' }
- it 'updates the tube to "failed" with "failed" requests', aggregate_failures: true do
+ it 'updates the tube to "failed" with "failed" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('failed')
expect(request.reload.state).to eq('failed')
end
@@ -192,7 +192,7 @@
let(:target_state) { 'failed' }
let(:request_state) { 'passed' }
- it 'updates the tube to "failed" with "failed" requests', aggregate_failures: true do
+ it 'updates the tube to "failed" with "failed" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('failed')
expect(request.reload.state).to eq('failed')
end
@@ -213,7 +213,7 @@
let(:target_state) { 'passed' }
let(:request_state) { 'pending' }
- it 'updates the tube to "failed" with "started" requests', aggregate_failures: true do
+ it 'updates the tube to "failed" with "started" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('failed')
expect(request.reload.state).to eq('pending')
end
@@ -227,7 +227,7 @@
let(:target_state) { 'passed' }
let(:request_state) { 'started' }
- it 'updates the tube to "passed" with "started" requests', aggregate_failures: true do
+ it 'updates the tube to "passed" with "started" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('passed')
expect(request.reload.state).to eq('started')
end
@@ -241,7 +241,7 @@
let(:target_state) { 'failed' }
let(:request_state) { 'started' }
- it 'updates the tube to "failed" with "failed" requests', aggregate_failures: true do
+ it 'updates the tube to "failed" with "failed" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('failed')
expect(request.reload.state).to eq('failed')
end
@@ -251,7 +251,7 @@
let(:target_state) { 'failed' }
let(:request_state) { 'passed' }
- it 'updates the tube to "failed" with "failed" requests', aggregate_failures: true do
+ it 'updates the tube to "failed" with "failed" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('failed')
expect(request.reload.state).to eq('failed')
end
@@ -261,7 +261,7 @@
let(:target_state) { 'qc_complete' }
let(:request_state) { 'started' }
- it 'updates the tube to "qc_complete" with "started" requests', aggregate_failures: true do
+ it 'updates the tube to "qc_complete" with "started" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('qc_complete')
expect(request.reload.state).to eq('started')
end
@@ -276,7 +276,7 @@
let(:target_state) { 'cancelled' }
let(:request_state) { 'started' }
- it 'updates the tube to "cancelled" with "started" requests', aggregate_failures: true do
+ it 'updates the tube to "cancelled" with "started" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('cancelled')
expect(request.reload.state).to eq('started')
end
diff --git a/spec/models/state_changer/mx_tube_spec.rb b/spec/models/state_changer/mx_tube_spec.rb
index 2945b91dc5..41b73e874a 100644
--- a/spec/models/state_changer/mx_tube_spec.rb
+++ b/spec/models/state_changer/mx_tube_spec.rb
@@ -38,7 +38,7 @@ def create_requests_and_transfers
let(:target_state) { 'started' }
let(:request_state) { 'pending' }
- it 'updates the tube to "started" with "pending" requests', aggregate_failures: true do
+ it 'updates the tube to "started" with "pending" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('started')
expect(request.reload.state).to eq('pending')
end
@@ -48,7 +48,7 @@ def create_requests_and_transfers
let(:target_state) { 'started' }
let(:request_state) { 'started' }
- it 'updates the tube to "started" with "started" requests', aggregate_failures: true do
+ it 'updates the tube to "started" with "started" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('started')
expect(request.reload.state).to eq('started')
end
@@ -58,7 +58,7 @@ def create_requests_and_transfers
let(:target_state) { 'started' }
let(:request_state) { 'failed' }
- it 'updates the tube to "started" with "failed" requests', aggregate_failures: true do
+ it 'updates the tube to "started" with "failed" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('started')
expect(request.reload.state).to eq('failed')
end
@@ -68,7 +68,7 @@ def create_requests_and_transfers
let(:target_state) { 'started' }
let(:request_state) { 'passed' }
- it 'updates the tube to "started" with "passed" requests', aggregate_failures: true do
+ it 'updates the tube to "started" with "passed" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('started')
expect(request.reload.state).to eq('passed')
end
@@ -78,7 +78,7 @@ def create_requests_and_transfers
let(:target_state) { 'started' }
let(:request_state) { 'cancelled' }
- it 'updates the tube to "started" with "cancelled" requests', aggregate_failures: true do
+ it 'updates the tube to "started" with "cancelled" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('started')
expect(request.reload.state).to eq('cancelled')
end
@@ -88,7 +88,7 @@ def create_requests_and_transfers
let(:target_state) { 'processed_1' }
let(:request_state) { 'pending' }
- it 'updates the tube to "processed_1" with "pending" requests', aggregate_failures: true do
+ it 'updates the tube to "processed_1" with "pending" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('processed_1')
expect(request.reload.state).to eq('pending')
end
@@ -98,7 +98,7 @@ def create_requests_and_transfers
let(:target_state) { 'passed' }
let(:request_state) { 'failed' }
- it 'updates the tube to "passed" with "failed" requests', aggregate_failures: true do
+ it 'updates the tube to "passed" with "failed" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('passed')
expect(request.reload.state).to eq('failed')
end
@@ -108,7 +108,7 @@ def create_requests_and_transfers
let(:target_state) { 'passed' }
let(:request_state) { 'passed' }
- it 'updates the tube to "passed" with "passed" requests', aggregate_failures: true do
+ it 'updates the tube to "passed" with "passed" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('passed')
expect(request.reload.state).to eq('passed')
end
@@ -118,7 +118,7 @@ def create_requests_and_transfers
let(:target_state) { 'passed' }
let(:request_state) { 'cancelled' }
- it 'updates the tube to "passed" with "cancelled" requests', aggregate_failures: true do
+ it 'updates the tube to "passed" with "cancelled" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('passed')
expect(request.reload.state).to eq('cancelled')
end
@@ -128,7 +128,7 @@ def create_requests_and_transfers
let(:target_state) { 'failed' }
let(:request_state) { 'started' }
- it 'updates the tube to "failed" with "failed" requests', aggregate_failures: true do
+ it 'updates the tube to "failed" with "failed" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('failed')
expect(request.reload.state).to eq('failed')
end
@@ -138,7 +138,7 @@ def create_requests_and_transfers
let(:target_state) { 'failed' }
let(:request_state) { 'passed' }
- it 'updates the tube to "failed" with "passed" requests', aggregate_failures: true do
+ it 'updates the tube to "failed" with "passed" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('failed')
expect(request.reload.state).to eq('passed')
end
@@ -148,7 +148,7 @@ def create_requests_and_transfers
let(:target_state) { 'cancelled' }
let(:request_state) { 'pending' }
- it 'updates the tube to "cancelled" with "pending" requests', aggregate_failures: true do
+ it 'updates the tube to "cancelled" with "pending" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('cancelled')
expect(request.reload.state).to eq('pending')
end
@@ -162,7 +162,7 @@ def create_requests_and_transfers
let(:target_state) { 'processed_2' }
let(:request_state) { 'started' }
- it 'updates the tube to "processed_2" with "started" requests', aggregate_failures: true do
+ it 'updates the tube to "processed_2" with "started" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('processed_2')
expect(request.reload.state).to eq('started')
end
@@ -176,7 +176,7 @@ def create_requests_and_transfers
let(:target_state) { 'passed' }
let(:request_state) { 'started' }
- it 'updates the tube to "passed" with "passed" requests', aggregate_failures: true do
+ it 'updates the tube to "passed" with "passed" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('passed')
expect(request.reload.state).to eq('passed')
end
@@ -186,7 +186,7 @@ def create_requests_and_transfers
let(:target_state) { 'passed' }
let(:request_state) { 'failed' }
- it 'updates the tube to "passed" with "failed" requests', aggregate_failures: true do
+ it 'updates the tube to "passed" with "failed" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('passed')
expect(request.reload.state).to eq('failed')
end
@@ -196,7 +196,7 @@ def create_requests_and_transfers
let(:target_state) { 'passed' }
let(:request_state) { 'cancelled' }
- it 'updates the tube to "passed" with "cancelled" requests', aggregate_failures: true do
+ it 'updates the tube to "passed" with "cancelled" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('passed')
expect(request.reload.state).to eq('cancelled')
end
@@ -206,7 +206,7 @@ def create_requests_and_transfers
let(:target_state) { 'failed' }
let(:request_state) { 'started' }
- it 'updates the tube to "failed" with "failed" requests', aggregate_failures: true do
+ it 'updates the tube to "failed" with "failed" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('failed')
expect(request.reload.state).to eq('failed')
end
@@ -216,7 +216,7 @@ def create_requests_and_transfers
let(:target_state) { 'failed' }
let(:request_state) { 'passed' }
- it 'updates the tube to "failed" with "passed" requests', aggregate_failures: true do
+ it 'updates the tube to "failed" with "passed" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('failed')
expect(request.reload.state).to eq('passed')
end
@@ -226,7 +226,7 @@ def create_requests_and_transfers
let(:target_state) { 'cancelled' }
let(:request_state) { 'pending' }
- it 'updates the tube to "cancelled" with "pending" requests', aggregate_failures: true do
+ it 'updates the tube to "cancelled" with "pending" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('cancelled')
expect(request.reload.state).to eq('pending')
end
@@ -242,7 +242,7 @@ def create_requests_and_transfers
let(:target_state) { 'passed' }
let(:request_state) { 'started' }
- it 'updates the tube to "passed" with "passed" requests', aggregate_failures: true do
+ it 'updates the tube to "passed" with "passed" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('passed')
expect(request.reload.state).to eq('passed')
end
@@ -253,7 +253,7 @@ def create_requests_and_transfers
let(:target_state) { 'passed' }
let(:request_state) { 'failed' }
- it 'updates the tube to "passed" with "failed" requests', aggregate_failures: true do
+ it 'updates the tube to "passed" with "failed" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('passed')
expect(request.reload.state).to eq('failed')
end
@@ -267,7 +267,7 @@ def create_requests_and_transfers
let(:target_state) { 'passed' }
let(:request_state) { 'started' }
- it 'updates the tube to "passed" with "passed" requests', aggregate_failures: true do
+ it 'updates the tube to "passed" with "passed" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('passed')
expect(request.reload.state).to eq('passed')
end
@@ -281,7 +281,7 @@ def create_requests_and_transfers
let(:target_state) { 'failed' }
let(:request_state) { 'started' }
- it 'updates the tube to "failed" with "failed" requests', aggregate_failures: true do
+ it 'updates the tube to "failed" with "failed" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('failed')
expect(request.reload.state).to eq('failed')
end
@@ -291,7 +291,7 @@ def create_requests_and_transfers
let(:target_state) { 'failed' }
let(:request_state) { 'passed' }
- it 'updates the tube to "failed" with "passed" requests', aggregate_failures: true do
+ it 'updates the tube to "failed" with "passed" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('failed')
expect(request.reload.state).to eq('passed')
end
@@ -301,7 +301,7 @@ def create_requests_and_transfers
let(:target_state) { 'qc_complete' }
let(:request_state) { 'started' }
- it 'updates the tube to "qc_complete" with "started" requests', aggregate_failures: true do
+ it 'updates the tube to "qc_complete" with "started" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('qc_complete')
expect(request.reload.state).to eq('started')
end
@@ -311,7 +311,7 @@ def create_requests_and_transfers
let(:target_state) { 'qc_complete' }
let(:request_state) { 'passed' }
- it 'updates the tube to "qc_complete" with "passed" requests', aggregate_failures: true do
+ it 'updates the tube to "qc_complete" with "passed" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('qc_complete')
expect(request.reload.state).to eq('passed')
end
@@ -325,7 +325,7 @@ def create_requests_and_transfers
let(:target_state) { 'cancelled' }
let(:request_state) { 'started' }
- it 'updates the tube to "cancelled" with "started" requests', aggregate_failures: true do
+ it 'updates the tube to "cancelled" with "started" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('cancelled')
expect(request.reload.state).to eq('started')
end
diff --git a/spec/models/state_changer/qcable_library_plate_spec.rb b/spec/models/state_changer/qcable_library_plate_spec.rb
index e5a122071c..1fd755cd82 100644
--- a/spec/models/state_changer/qcable_library_plate_spec.rb
+++ b/spec/models/state_changer/qcable_library_plate_spec.rb
@@ -30,8 +30,8 @@ def save!
it 'sets library type on aliquots' do
state_changer.update_labware_state
- assert_equal aliquot.library, well
- assert_equal aliquot.library_type, 'QA1'
- assert_equal aliquot.insert_size.from, 100
+ expect(well).to eq(aliquot.library)
+ expect(aliquot.library_type).to eq('QA1')
+ expect(aliquot.insert_size.from).to eq(100)
end
end
diff --git a/spec/models/state_changer/stock_tube_spec.rb b/spec/models/state_changer/stock_tube_spec.rb
index 55c81050e8..b3d6f517a1 100644
--- a/spec/models/state_changer/stock_tube_spec.rb
+++ b/spec/models/state_changer/stock_tube_spec.rb
@@ -31,7 +31,7 @@
let(:target_state) { 'started' }
let(:request_state) { 'pending' }
- it 'updates the tube to "started" with "pending" requests', aggregate_failures: true do
+ it 'updates the tube to "started" with "pending" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('started')
expect(request.reload.state).to eq('pending')
end
@@ -41,7 +41,7 @@
let(:target_state) { 'started' }
let(:request_state) { 'started' }
- it 'updates the tube to "started" with "started" requests', aggregate_failures: true do
+ it 'updates the tube to "started" with "started" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('started')
expect(request.reload.state).to eq('started')
end
@@ -51,7 +51,7 @@
let(:target_state) { 'started' }
let(:request_state) { 'failed' }
- it 'updates the tube to "started" with "failed" requests', aggregate_failures: true do
+ it 'updates the tube to "started" with "failed" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('started')
expect(request.reload.state).to eq('failed')
end
@@ -61,7 +61,7 @@
let(:target_state) { 'started' }
let(:request_state) { 'passed' }
- it 'updates the tube to "started" with "passed" requests', aggregate_failures: true do
+ it 'updates the tube to "started" with "passed" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('started')
expect(request.reload.state).to eq('passed')
end
@@ -71,7 +71,7 @@
let(:target_state) { 'started' }
let(:request_state) { 'cancelled' }
- it 'updates the tube to "started" with "cancelled" requests', aggregate_failures: true do
+ it 'updates the tube to "started" with "cancelled" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('started')
expect(request.reload.state).to eq('cancelled')
end
@@ -81,7 +81,7 @@
let(:target_state) { 'processed_1' }
let(:request_state) { 'pending' }
- it 'updates the tube to "processed_1" with "pending" requests', aggregate_failures: true do
+ it 'updates the tube to "processed_1" with "pending" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('processed_1')
expect(request.reload.state).to eq('pending')
end
@@ -91,7 +91,7 @@
let(:target_state) { 'passed' }
let(:request_state) { 'failed' }
- it 'updates the tube to "passed" with "failed" requests', aggregate_failures: true do
+ it 'updates the tube to "passed" with "failed" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('passed')
expect(request.reload.state).to eq('failed')
end
@@ -101,7 +101,7 @@
let(:target_state) { 'passed' }
let(:request_state) { 'passed' }
- it 'updates the tube to "passed" with "passed" requests', aggregate_failures: true do
+ it 'updates the tube to "passed" with "passed" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('passed')
expect(request.reload.state).to eq('passed')
end
@@ -111,7 +111,7 @@
let(:target_state) { 'passed' }
let(:request_state) { 'cancelled' }
- it 'updates the tube to "passed" with "cancelled" requests', aggregate_failures: true do
+ it 'updates the tube to "passed" with "cancelled" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('passed')
expect(request.reload.state).to eq('cancelled')
end
@@ -122,7 +122,7 @@
let(:target_state) { 'failed' }
let(:request_state) { 'started' }
- it 'updates the tube to "failed" with "failed" requests', aggregate_failures: true do
+ it 'updates the tube to "failed" with "failed" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('failed')
expect(request.reload.state).to eq('failed')
end
@@ -132,7 +132,7 @@
let(:target_state) { 'failed' }
let(:request_state) { 'passed' }
- it 'updates the tube to "failed" with "failed" requests', aggregate_failures: true do
+ it 'updates the tube to "failed" with "failed" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('failed')
expect(request.reload.state).to eq('failed')
end
@@ -142,7 +142,7 @@
let(:target_state) { 'cancelled' }
let(:request_state) { 'pending' }
- it 'updates the tube to "cancelled" with "pending" requests', aggregate_failures: true do
+ it 'updates the tube to "cancelled" with "pending" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('cancelled')
expect(request.reload.state).to eq('pending')
end
@@ -156,7 +156,7 @@
let(:target_state) { 'processed_2' }
let(:request_state) { 'started' }
- it 'updates the tube to "processed_2" with "started" requests', aggregate_failures: true do
+ it 'updates the tube to "processed_2" with "started" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('processed_2')
expect(request.reload.state).to eq('started')
end
@@ -170,7 +170,7 @@
let(:target_state) { 'passed' }
let(:request_state) { 'started' }
- it 'updates the tube to "passed" with "started" requests', aggregate_failures: true do
+ it 'updates the tube to "passed" with "started" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('passed')
expect(request.reload.state).to eq('started')
end
@@ -180,7 +180,7 @@
let(:target_state) { 'passed' }
let(:request_state) { 'failed' }
- it 'updates the tube to "passed" with "failed" requests', aggregate_failures: true do
+ it 'updates the tube to "passed" with "failed" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('passed')
expect(request.reload.state).to eq('failed')
end
@@ -190,7 +190,7 @@
let(:target_state) { 'passed' }
let(:request_state) { 'cancelled' }
- it 'updates the tube to "passed" with "cancelled" requests', aggregate_failures: true do
+ it 'updates the tube to "passed" with "cancelled" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('passed')
expect(request.reload.state).to eq('cancelled')
end
@@ -200,7 +200,7 @@
let(:target_state) { 'failed' }
let(:request_state) { 'started' }
- it 'updates the tube to "failed" with "failed" requests', aggregate_failures: true do
+ it 'updates the tube to "failed" with "failed" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('failed')
expect(request.reload.state).to eq('failed')
end
@@ -210,7 +210,7 @@
let(:target_state) { 'failed' }
let(:request_state) { 'passed' }
- it 'updates the tube to "failed" with "failed" requests', aggregate_failures: true do
+ it 'updates the tube to "failed" with "failed" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('failed')
expect(request.reload.state).to eq('failed')
end
@@ -220,7 +220,7 @@
let(:target_state) { 'cancelled' }
let(:request_state) { 'pending' }
- it 'updates the tube to "cancelled" with "pending" requests', aggregate_failures: true do
+ it 'updates the tube to "cancelled" with "pending" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('cancelled')
expect(request.reload.state).to eq('pending')
end
@@ -234,7 +234,7 @@
let(:target_state) { 'passed' }
let(:request_state) { 'pending' }
- it 'updates the tube to "passed" with "pending" requests', aggregate_failures: true do
+ it 'updates the tube to "passed" with "pending" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('failed')
expect(request.reload.state).to eq('pending')
end
@@ -244,7 +244,7 @@
let(:target_state) { 'passed' }
let(:request_state) { 'started' }
- it 'updates the tube to "passed" with "started" requests', aggregate_failures: true do
+ it 'updates the tube to "passed" with "started" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('failed')
expect(request.reload.state).to eq('started')
end
@@ -254,7 +254,7 @@
let(:target_state) { 'passed' }
let(:request_state) { 'failed' }
- it 'updates the tube to "passed" with "failed" requests', aggregate_failures: true do
+ it 'updates the tube to "passed" with "failed" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('failed')
expect(request.reload.state).to eq('failed')
end
@@ -268,7 +268,7 @@
let(:target_state) { 'passed' }
let(:request_state) { 'started' }
- it 'updates the tube to "passed" with "started" requests', aggregate_failures: true do
+ it 'updates the tube to "passed" with "started" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('passed')
expect(request.reload.state).to eq('started')
end
@@ -282,7 +282,7 @@
let(:target_state) { 'failed' }
let(:request_state) { 'started' }
- it 'updates the tube to "failed" with "failed" requests', aggregate_failures: true do
+ it 'updates the tube to "failed" with "failed" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('failed')
expect(request.reload.state).to eq('failed')
end
@@ -292,7 +292,7 @@
let(:target_state) { 'failed' }
let(:request_state) { 'passed' }
- it 'updates the tube to "failed" with "failed" requests', aggregate_failures: true do
+ it 'updates the tube to "failed" with "failed" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('failed')
expect(request.reload.state).to eq('failed')
end
@@ -302,7 +302,7 @@
let(:target_state) { 'qc_complete' }
let(:request_state) { 'started' }
- it 'updates the tube to "qc_complete" with "started" requests', aggregate_failures: true do
+ it 'updates the tube to "qc_complete" with "started" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('qc_complete')
expect(request.reload.state).to eq('started')
end
@@ -312,7 +312,7 @@
let(:target_state) { 'qc_complete' }
let(:request_state) { 'passed' }
- it 'updates the tube to "qc_complete" with "passed" requests', aggregate_failures: true do
+ it 'updates the tube to "qc_complete" with "passed" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('qc_complete')
expect(request.reload.state).to eq('passed')
end
@@ -326,7 +326,7 @@
let(:target_state) { 'cancelled' }
let(:request_state) { 'started' }
- it 'updates the tube to "cancelled" with "started" requests', aggregate_failures: true do
+ it 'updates the tube to "cancelled" with "started" requests', :aggregate_failures do
expect(transfer_request.reload.state).to eq('cancelled')
expect(request.reload.state).to eq('started')
end
diff --git a/spec/models/study_spec.rb b/spec/models/study_spec.rb
index c7b5555f55..9828d84086 100644
--- a/spec/models/study_spec.rb
+++ b/spec/models/study_spec.rb
@@ -704,7 +704,7 @@
let(:study) { create :study }
let(:user) { create :user }
- it 'triggers warehouse update', warren: true do
+ it 'triggers warehouse update', :warren do
expect { user.grant_follower(study) }.to change(Warren.handler.messages, :count).from(0)
end
end
diff --git a/spec/models/tag2_layout_template_spec.rb b/spec/models/tag2_layout_template_spec.rb
index 739299ba70..618d69597a 100644
--- a/spec/models/tag2_layout_template_spec.rb
+++ b/spec/models/tag2_layout_template_spec.rb
@@ -33,6 +33,6 @@
expect(Tag2Layout::TemplateSubmission.where(submission_id: submissions)).to be_present
Tag2Layout::TemplateSubmission
.where(submission_id: submissions)
- .each { |t2lts| expect(t2lts.tag2_layout_template).to eq(tag2_layout_template) }
+ .find_each { |t2lts| expect(t2lts.tag2_layout_template).to eq(tag2_layout_template) }
end
end
diff --git a/spec/models/tag_layout_template_spec.rb b/spec/models/tag_layout_template_spec.rb
index 6e05728bac..65473dc58c 100644
--- a/spec/models/tag_layout_template_spec.rb
+++ b/spec/models/tag_layout_template_spec.rb
@@ -46,7 +46,7 @@
expect(TagLayout::TemplateSubmission.where(submission_id: submissions)).to be_present
TagLayout::TemplateSubmission
.where(submission_id: submissions)
- .each do |tlts|
+ .find_each do |tlts|
expect(tlts.tag_layout_template).to eq(template)
expect(tlts.enforce_uniqueness).to eq(enforce_uniqueness)
end
@@ -71,7 +71,7 @@
expect(TagLayout::TemplateSubmission.where(submission_id: submissions)).to be_present
TagLayout::TemplateSubmission
.where(submission_id: submissions)
- .each do |tlts|
+ .find_each do |tlts|
expect(tlts.tag_layout_template).to eq(template)
expect(tlts.enforce_uniqueness).to eq(enforce_uniqueness)
end
@@ -99,7 +99,7 @@
expect(TagLayout::TemplateSubmission.where(submission_id: submissions)).to be_present
TagLayout::TemplateSubmission
.where(submission_id: submissions)
- .each do |tlts|
+ .find_each do |tlts|
expect(tlts.tag_layout_template).to eq(template)
expect(tlts.enforce_uniqueness).to eq(enforce_uniqueness)
end
diff --git a/spec/models/tag_substitutions_spec.rb b/spec/models/tag_substitutions_spec.rb
index 4329d601b3..af24e4729f 100644
--- a/spec/models/tag_substitutions_spec.rb
+++ b/spec/models/tag_substitutions_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-describe TagSubstitution, warren: true do
+describe TagSubstitution, :warren do
# Works for: Library manifests, old tube pipelines
# We have two samples, each with unique tags, which only exist
# in aliquots identified by the library id. We don't need to consider:
@@ -294,7 +294,7 @@
it 'return false and an error of the details don\'t match' do
expect(subject.save).to be false
- assert_includes subject.errors.full_messages, 'Substitution Matching aliquots could not be found'
+ assert_includes subject.errors.full_messages, 'Substitution ["Matching aliquots could not be found"]'
end
end
@@ -333,9 +333,9 @@
it 'also update allow update of other attributes' do
[library_aliquot_a, library_aliquot_b, mx_aliquot_a, mx_aliquot_b].each do |aliquot|
aliquot.reload
- assert_equal aliquot.library_type, library_type.name
- assert_equal 20, aliquot.insert_size_from
- assert_equal 400, aliquot.insert_size_to
+ expect(library_type.name).to eq(aliquot.library_type)
+ expect(aliquot.insert_size_from).to eq(20)
+ expect(aliquot.insert_size_to).to eq(400)
end
end
end
diff --git a/spec/models/transfer_request_collection_spec.rb b/spec/models/transfer_request_collection_spec.rb
index 78ab920e41..e357ec1de5 100644
--- a/spec/models/transfer_request_collection_spec.rb
+++ b/spec/models/transfer_request_collection_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-RSpec.describe TransferRequestCollection, transfer_request_collection: true do
+RSpec.describe TransferRequestCollection, :transfer_request_collection do
subject { described_class.new(creation_attributes) }
let(:user) { create :user }
diff --git a/spec/models/well_attribute_spec.rb b/spec/models/well_attribute_spec.rb
index 7ced37b697..d09f8755e9 100644
--- a/spec/models/well_attribute_spec.rb
+++ b/spec/models/well_attribute_spec.rb
@@ -17,7 +17,7 @@
expect(described_class.last.current_volume).to eq 1.0
end
- it 'triggers warehouse message on well attribute update', warren: true do
+ it 'triggers warehouse message on well attribute update', :warren do
current_message_count = Warren.handler.messages.count
expect { well_attribute.update(concentration: 200) }.to change(Warren.handler.messages, :count).from(
current_message_count
diff --git a/spec/models/well_spec.rb b/spec/models/well_spec.rb
index 9efdc52f58..2cd6989c94 100644
--- a/spec/models/well_spec.rb
+++ b/spec/models/well_spec.rb
@@ -181,62 +181,62 @@
result = described_class.hash_stock_with_targets(stock_plate.wells, purposes.map(&:name))
- assert_equal result.count, 3
- assert_equal result[stock_plate.wells[1].id].count, 1
- assert_equal result[stock_plate.wells[2].id].count, 1
- assert_equal result[stock_plate.wells[0].id].count, 3
+ expect(result.count).to eq(3)
+ expect(result[stock_plate.wells[1].id].count).to eq(1)
+ expect(result[stock_plate.wells[2].id].count).to eq(1)
+ expect(result[stock_plate.wells[0].id].count).to eq(3)
end
it 'have pico pass' do
well.well_attribute.pico_pass = 'Yes'
- assert_equal 'Yes', well.get_pico_pass
+ expect(well.get_pico_pass).to eq('Yes')
end
it 'have gel pass' do
well.well_attribute.gel_pass = 'Pass'
- assert_equal 'Pass', well.get_gel_pass
+ expect(well.get_gel_pass).to eq('Pass')
assert well.get_gel_pass.is_a?(String)
end
it 'have picked volume' do
well.set_picked_volume(3.6)
- assert_equal 3.6, well.get_picked_volume
+ expect(well.get_picked_volume).to eq(3.6)
end
it 'allow concentration to be set' do
well.set_concentration(1.0)
concentration = well.get_concentration
- assert_equal 1.0, concentration
+ expect(concentration).to eq(1.0)
assert concentration.is_a?(Float)
end
it 'allow volume to be set' do
well.set_current_volume(2.5)
vol = well.get_volume
- assert_equal 2.5, vol
+ expect(vol).to eq(2.5)
assert vol.is_a?(Float)
end
it 'allow current volume to be set' do
well.set_current_volume(3.5)
vol = well.get_current_volume
- assert_equal 3.5, vol
+ expect(vol).to eq(3.5)
assert vol.is_a?(Float)
end
it 'record the initial volume as initial_volume' do
well.well_attribute.measured_volume = 3.5
vol = well.well_attribute.initial_volume
- assert_equal 3.5, vol
+ expect(vol).to eq(3.5)
well.well_attribute.measured_volume = 2.5
orig_vol = well.well_attribute.initial_volume
- assert_equal 3.5, orig_vol
+ expect(orig_vol).to eq(3.5)
end
it 'allow buffer volume to be set' do
well.set_buffer_volume(4.5)
vol = well.get_buffer_volume
- assert_equal 4.5, vol
+ expect(vol).to eq(4.5)
assert vol.is_a?(Float)
end
@@ -249,14 +249,14 @@
it 'have a parent plate' do
parent = well.plate
assert parent.is_a?(Plate)
- assert_equal parent.id, @plate.id
+ expect(@plate.id).to eq(parent.id)
end
context 'for a tecan' do
it 'have a parent plate' do
parent = well.plate
assert parent.is_a?(Plate)
- assert_equal parent.id, @plate.id
+ expect(@plate.id).to eq(parent.id)
end
end
end
@@ -298,14 +298,14 @@
# rubocop:disable Layout/LineLength
it "output stock_to_pick #{stock_to_pick} for a target of #{target_ng} with vol #{measured_volume} and conc #{measured_concentration}" do
- assert_equal stock_to_pick, @target_well.well_attribute.picked_volume
+ expect(@target_well.well_attribute.picked_volume).to eq(stock_to_pick)
end
# rubocop:enable Layout/LineLength
# rubocop:disable Layout/LineLength
it "output buffer #{buffer_added} for a target of #{target_ng} with vol #{measured_volume} and conc #{measured_concentration}" do
- assert_equal buffer_added, @target_well.well_attribute.buffer_volume
+ expect(@target_well.well_attribute.buffer_volume).to eq(buffer_added)
end
# rubocop:enable Layout/LineLength
end
@@ -336,8 +336,8 @@
@source_well,
robot_minimum_picking_volume
)
- assert_equal stock_to_pick, @target_well.get_picked_volume
- assert_equal buffer_added, @target_well.well_attribute.buffer_volume
+ expect(@target_well.get_picked_volume).to eq(stock_to_pick)
+ expect(@target_well.well_attribute.buffer_volume).to eq(buffer_added)
end
it "get correct buffer volume when it's above robot minimum picking volume" do
@@ -352,8 +352,8 @@
@source_well,
robot_minimum_picking_volume
)
- assert_equal stock_to_pick, @target_well.get_picked_volume
- assert_equal buffer_added, @target_well.well_attribute.buffer_volume
+ expect(@target_well.get_picked_volume).to eq(stock_to_pick)
+ expect(@target_well.well_attribute.buffer_volume).to eq(buffer_added)
end
it 'get no buffer volume if the minimum picking volume exceeds the minimum volume' do
@@ -368,8 +368,8 @@
@source_well,
robot_minimum_picking_volume
)
- assert_equal stock_to_pick, @target_well.get_picked_volume
- assert_equal buffer_added, @target_well.well_attribute.buffer_volume
+ expect(@target_well.get_picked_volume).to eq(stock_to_pick)
+ expect(@target_well.well_attribute.buffer_volume).to eq(buffer_added)
end
it 'get robot minimum picking volume if the correct buffer volume is below this value' do
@@ -384,8 +384,8 @@
@source_well,
robot_minimum_picking_volume
)
- assert_equal stock_to_pick, @target_well.get_picked_volume
- assert_equal buffer_added, @target_well.well_attribute.buffer_volume
+ expect(@target_well.get_picked_volume).to eq(stock_to_pick)
+ expect(@target_well.well_attribute.buffer_volume).to eq(buffer_added)
end
end
end
@@ -401,22 +401,22 @@
end
it 'return volume to pick' do
- assert_equal 1.25, well.volume_to_cherrypick_by_nano_grams_per_micro_litre(5.0, 50.0, 200.0, 20)
- assert_equal 3.9, well.volume_to_cherrypick_by_nano_grams_per_micro_litre(13.0, 30.0, 100.0, 20)
- assert_equal 9.1, well.get_buffer_volume
+ expect(well.volume_to_cherrypick_by_nano_grams_per_micro_litre(5.0, 50.0, 200.0, 20)).to eq(1.25)
+ expect(well.volume_to_cherrypick_by_nano_grams_per_micro_litre(13.0, 30.0, 100.0, 20)).to eq(3.9)
+ expect(well.get_buffer_volume).to eq(9.1)
end
it 'sets the buffer volume' do
well.volume_to_cherrypick_by_nano_grams_per_micro_litre(5.0, 50.0, 200.0, 20)
- assert_equal 3.75, well.get_buffer_volume
+ expect(well.get_buffer_volume).to eq(3.75)
well.volume_to_cherrypick_by_nano_grams_per_micro_litre(13.0, 30.0, 100.0, 20)
- assert_equal 9.1, well.get_buffer_volume
+ expect(well.get_buffer_volume).to eq(9.1)
end
it 'sets buffer and volume_to_pick correctly' do
vol_to_pick = well.volume_to_cherrypick_by_nano_grams_per_micro_litre(5.0, 50.0, 200.0, 20)
- assert_equal well.get_picked_volume, vol_to_pick
- assert_equal 5.0, well.get_buffer_volume + vol_to_pick
+ expect(vol_to_pick).to eq(well.get_picked_volume)
+ expect(well.get_buffer_volume + vol_to_pick).to eq(5.0)
end
[
@@ -458,11 +458,11 @@
end
it 'gets correct volume quantity' do
- assert_equal source_volume_obtained, @result_volume
+ expect(@result_volume).to eq(source_volume_obtained)
end
it 'gets correct buffer volume measures' do
- assert_equal buffer_volume_obtained, @result_buffer_volume
+ expect(@result_buffer_volume).to eq(buffer_volume_obtained)
end
end
end
@@ -502,7 +502,7 @@
end
it 'report appropriate metrics' do
- assert_equal [@expected_metric], well.latest_stock_metrics(@our_product_criteria.product)
+ expect(well.latest_stock_metrics(@our_product_criteria.product)).to eq([@expected_metric])
end
end
@@ -568,7 +568,7 @@
context '(DPL-148) on updating well attribute' do
let(:well) { create :well }
- it 'triggers warehouse update', warren: true do
+ it 'triggers warehouse update', :warren do
expect do
# We try a valid update
well.well_attribute.update(concentration: 200)
diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb
index ad34daa5a1..4c85f7ed6a 100644
--- a/spec/rails_helper.rb
+++ b/spec/rails_helper.rb
@@ -32,7 +32,7 @@
# directory. Alternatively, in the individual `*_spec.rb` files, manually
# require only the support files necessary.
#
-Dir[Rails.root.join('spec/support/**/*.rb')].sort.each { |f| require f }
+Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f }
# Added with rails 6 update, the problem almost certainly exists elsewhere.
ActiveRecord::Base.connection.reconnect!
diff --git a/spec/requests/api/v2/heron/plates_spec.rb b/spec/requests/api/v2/heron/plates_spec.rb
index b21ce30189..d10ce771c4 100644
--- a/spec/requests/api/v2/heron/plates_spec.rb
+++ b/spec/requests/api/v2/heron/plates_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-describe 'Plates Heron API', heron: true, heron_events: true, lighthouse: true, with: :api_v2 do
+describe 'Plates Heron API', :heron, :heron_events, :lighthouse, with: :api_v2 do
describe '#create' do
include BarcodeHelper
@@ -13,13 +13,13 @@
let(:purpose) { create(:plate_purpose, target_type: 'Plate', name: 'Stock Plate', size: '96') }
let(:plate) do
request
- uuid = JSON.parse(response.body).dig('data', 'attributes', 'uuid')
+ uuid = response.parsed_body.dig('data', 'attributes', 'uuid')
Plate.with_uuid(uuid).first
end
- let(:url_for_plate) { JSON.parse(response.body).dig('data', 'links', 'self') }
+ let(:url_for_plate) { response.parsed_body.dig('data', 'links', 'self') }
let(:error_messages) do
request
- JSON.parse(response.body).dig('errors')
+ response.parsed_body.dig('errors')
end
shared_examples_for 'a successful plate creation' do
@@ -151,8 +151,8 @@
it 'displays the error' do
expect(error_messages).to eq(
[
- 'Content a1 Asdf Unexisting field for sample or sample_metadata',
- 'Content b1 Phenotype No other params can be added when sample uuid specified'
+ 'Content a1 ["Asdf Unexisting field for sample or sample_metadata"]',
+ 'Content b1 ["Phenotype No other params can be added when sample uuid specified"]'
]
)
end
@@ -175,12 +175,12 @@
it_behaves_like 'a failed plate creation'
it 'displays the error' do
- expect(error_messages).to eq(["Content a1 Study can't be blank"])
+ expect(error_messages).to eq(["Content a1 [\"Study can't be blank\"]"])
end
end
context 'when there is an exception during plate creation' do
- before { allow(::Sample).to receive(:with_uuid).with(sample.uuid).and_raise('BOOM!!') }
+ before { allow(Sample).to receive(:with_uuid).with(sample.uuid).and_raise('BOOM!!') }
it 'does not create any plates' do
expect(Plate.count).to eq(0)
diff --git a/spec/requests/api/v2/heron/tube_racks_spec.rb b/spec/requests/api/v2/heron/tube_racks_spec.rb
index 3c836a3860..4df9dd827d 100644
--- a/spec/requests/api/v2/heron/tube_racks_spec.rb
+++ b/spec/requests/api/v2/heron/tube_racks_spec.rb
@@ -3,7 +3,7 @@
require 'rails_helper'
require 'support/barcode_helper'
-RSpec.describe 'TubeRacks Heron API', heron: true, lighthouse: true, with: :api_v2 do
+RSpec.describe 'TubeRacks Heron API', :heron, :lighthouse, with: :api_v2 do
let(:size) { 96 }
let(:purpose) { create(:purpose, type: 'TubeRack::Purpose', target_type: 'TubeRack', size: 96) }
@@ -17,10 +17,10 @@
let(:supplier_sample_ids) { %w[PHEC-nnnnnnn1 PHEC-nnnnnnn2] }
let(:purpose_uuid) { purpose.uuid }
let(:rack) do
- uuid = JSON.parse(response.body).dig('data', 'attributes', 'uuid')
+ uuid = response.parsed_body.dig('data', 'attributes', 'uuid')
TubeRack.with_uuid(uuid).first
end
- let(:url_for_rack) { JSON.parse(response.body).dig('data', 'links', 'self') }
+ let(:url_for_rack) { response.parsed_body.dig('data', 'links', 'self') }
let(:tubes) do
{
@@ -64,7 +64,7 @@
it 'contains errors in the response' do
request
- expect(!JSON.parse(response.body)['errors'].empty?).to be_truthy
+ expect(!response.parsed_body['errors'].empty?).to be_truthy
end
end
@@ -96,7 +96,7 @@
it 'writes the supplier name' do
request
expect(
- ::Sample::Metadata
+ Sample::Metadata
.joins(sample: { aliquots: { receptacle: :barcodes } })
.where(barcodes: { barcode: tubes_barcodes })
.map(&:supplier_name)
@@ -130,7 +130,7 @@
it 'writes the control' do
request
expect(
- ::Sample
+ Sample
.joins(aliquots: { receptacle: :barcodes })
.where(barcodes: { barcode: tubes_barcodes })
.map(&:control)
@@ -140,7 +140,7 @@
it 'writes the control type' do
request
expect(
- ::Sample
+ Sample
.joins(aliquots: { receptacle: :barcodes })
.where(barcodes: { barcode: tubes_barcodes })
.map(&:control_type)
diff --git a/spec/requests/api/v2/pick_lists_spec.rb b/spec/requests/api/v2/pick_lists_spec.rb
index 918d48ffbf..d4558a4a29 100644
--- a/spec/requests/api/v2/pick_lists_spec.rb
+++ b/spec/requests/api/v2/pick_lists_spec.rb
@@ -3,7 +3,7 @@
require 'rails_helper'
require './spec/requests/api/v2/shared_examples/api_key_authenticatable'
-describe 'PickLists API', pick_list: true, with: :api_v2 do
+describe 'PickLists API', :pick_list, with: :api_v2 do
let(:base_endpoint) { '/api/v2/pick_lists' }
it_behaves_like 'ApiKeyAuthenticatable'
diff --git a/spec/requests/api/v2/plates_spec.rb b/spec/requests/api/v2/plates_spec.rb
index 4b8a8afc19..1c14967345 100644
--- a/spec/requests/api/v2/plates_spec.rb
+++ b/spec/requests/api/v2/plates_spec.rb
@@ -17,7 +17,7 @@
let(:request) { api_post base_endpoint, payload }
let(:plate) do
request
- uuid = JSON.parse(response.body).dig('data', 'attributes', 'uuid')
+ uuid = json.dig('data', 'attributes', 'uuid')
Plate.with_uuid(uuid).first
end
@@ -99,7 +99,7 @@
context 'when the ancestor is a tube rack' do
let(:purpose) { create(:plate_purpose, target_type: 'Plate', name: 'Stock Plate', size: '96') }
let(:rack) { create :tube_rack }
- let(:plate_factory) { ::Heron::Factories::PlateFromRack.new(tube_rack: rack, plate_purpose: purpose) }
+ let(:plate_factory) { Heron::Factories::PlateFromRack.new(tube_rack: rack, plate_purpose: purpose) }
let(:tubes) { create_list(:sample_tube, 2) }
include BarcodeHelper
diff --git a/spec/requests/api/v2/qc_assays_spec.rb b/spec/requests/api/v2/qc_assays_spec.rb
index 5051cb7dc4..a52268b506 100644
--- a/spec/requests/api/v2/qc_assays_spec.rb
+++ b/spec/requests/api/v2/qc_assays_spec.rb
@@ -3,7 +3,7 @@
require 'rails_helper'
require './spec/requests/api/v2/shared_examples/api_key_authenticatable'
-RSpec.describe Api::V2::QcAssaysController, qc_result: true, with: :api_v2 do
+RSpec.describe Api::V2::QcAssaysController, :qc_result, with: :api_v2 do
let(:asset_1) { attributes_for(:qc_result).merge(uuid: create(:receptacle).uuid) }
let(:asset_2) { attributes_for(:qc_result).merge(uuid: create(:receptacle).uuid) }
let(:asset_3) { attributes_for(:qc_result).merge(uuid: create(:receptacle).uuid) }
diff --git a/spec/requests/api/v2/qc_results_spec.rb b/spec/requests/api/v2/qc_results_spec.rb
index 8a291b8b87..7936893685 100644
--- a/spec/requests/api/v2/qc_results_spec.rb
+++ b/spec/requests/api/v2/qc_results_spec.rb
@@ -3,7 +3,7 @@
require 'rails_helper'
require './spec/requests/api/v2/shared_examples/api_key_authenticatable'
-RSpec.describe Api::V2::QcResultsController, qc_result: true, with: :api_v2 do
+RSpec.describe Api::V2::QcResultsController, :qc_result, with: :api_v2 do
let(:asset_invalid) { attributes_for(:qc_result) }
let(:base_endpoint) { '/api/v2/qc_results' }
diff --git a/spec/requests/plate_picks_request_spec.rb b/spec/requests/plate_picks_request_spec.rb
index 437488e1f6..ebaa591159 100644
--- a/spec/requests/plate_picks_request_spec.rb
+++ b/spec/requests/plate_picks_request_spec.rb
@@ -58,7 +58,7 @@
get "/plate_picks/plates/#{plate.machine_barcode}", headers: headers
expect(response.media_type).to eq('application/json')
expect(response).to have_http_status(:success)
- expect(JSON.parse(response.body)).to eq(found_plate)
+ expect(response.parsed_body).to eq(found_plate)
end
it 'returns 404 if the plate is missing', :aggregate_failures do
@@ -81,7 +81,7 @@
get "/plate_picks/batches/#{released_cherrypick_batch.id}", headers: headers
expect(response.media_type).to eq('application/json')
expect(response).to have_http_status(:success)
- expect(JSON.parse(response.body)).to eq(found_batch)
+ expect(response.parsed_body).to eq(found_batch)
end
it 'returns an error if the batch has no pick info', :aggregate_failures do
diff --git a/spec/resources/api/v2/pick_list_resource_spec.rb b/spec/resources/api/v2/pick_list_resource_spec.rb
index 987941c815..b3e2cfd4d6 100644
--- a/spec/resources/api/v2/pick_list_resource_spec.rb
+++ b/spec/resources/api/v2/pick_list_resource_spec.rb
@@ -3,7 +3,7 @@
require 'rails_helper'
require './app/resources/api/v2/pick_list_resource'
-RSpec.describe Api::V2::PickListResource, pick_list: true, type: :resource do
+RSpec.describe Api::V2::PickListResource, :pick_list, type: :resource do
subject(:resource) { described_class.new(resource_model, {}) }
let(:resource_model) { build_stubbed :pick_list }
diff --git a/spec/resources/api/v2/tube_resource_spec.rb b/spec/resources/api/v2/tube_resource_spec.rb
index 5f7f87eccf..ab049b52c1 100644
--- a/spec/resources/api/v2/tube_resource_spec.rb
+++ b/spec/resources/api/v2/tube_resource_spec.rb
@@ -9,7 +9,7 @@
let(:resource_model) { build_stubbed :tube, barcode_number: 1 }
# Test attributes
- it 'exposes the expected data', aggregate_failures: true do
+ it 'exposes the expected data', :aggregate_failures do
expect(subject).to have_attribute :uuid
expect(subject).to have_attribute :name
expect(subject).not_to have_updatable_field(:id)
diff --git a/spec/sample_manifest_excel/configuration_spec.rb b/spec/sample_manifest_excel/configuration_spec.rb
index 81913d0a3b..a5df5ea5db 100644
--- a/spec/sample_manifest_excel/configuration_spec.rb
+++ b/spec/sample_manifest_excel/configuration_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-RSpec.describe SampleManifestExcel::Configuration, sample_manifest: true, sample_manifest_excel: true, type: :model do
+RSpec.describe SampleManifestExcel::Configuration, :sample_manifest, :sample_manifest_excel, type: :model do
let(:configuration) { described_class.new }
it 'is comparable' do
diff --git a/spec/sample_manifest_excel/download_spec.rb b/spec/sample_manifest_excel/download_spec.rb
index 2d6d6c7842..bf634bd64f 100644
--- a/spec/sample_manifest_excel/download_spec.rb
+++ b/spec/sample_manifest_excel/download_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-RSpec.describe SampleManifestExcel::Download, sample_manifest: true, sample_manifest_excel: true, type: :model do
+RSpec.describe SampleManifestExcel::Download, :sample_manifest, :sample_manifest_excel, type: :model do
attr_reader :download, :spreadsheet
let(:test_file) { 'test.xlsx' }
diff --git a/spec/sample_manifest_excel/manifest_type_list_spec.rb b/spec/sample_manifest_excel/manifest_type_list_spec.rb
index 756f2f586e..456deb8459 100644
--- a/spec/sample_manifest_excel/manifest_type_list_spec.rb
+++ b/spec/sample_manifest_excel/manifest_type_list_spec.rb
@@ -2,10 +2,7 @@
require 'rails_helper'
-RSpec.describe SampleManifestExcel::ManifestTypeList,
- sample_manifest: true,
- sample_manifest_excel: true,
- type: :model do
+RSpec.describe SampleManifestExcel::ManifestTypeList, :sample_manifest, :sample_manifest_excel, type: :model do
include SequencescapeExcel::Helpers
let(:folder) { File.join('spec', 'data', 'sample_manifest_excel', 'extract') }
diff --git a/spec/sample_manifest_excel/sample_manifest_excel_spec.rb b/spec/sample_manifest_excel/sample_manifest_excel_spec.rb
index 028a4b36b4..15c698dbfc 100644
--- a/spec/sample_manifest_excel/sample_manifest_excel_spec.rb
+++ b/spec/sample_manifest_excel/sample_manifest_excel_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-RSpec.describe SampleManifestExcel, sample_manifest: true, sample_manifest_excel: true, type: :model do
+RSpec.describe SampleManifestExcel, :sample_manifest, :sample_manifest_excel, type: :model do
before do
described_class.configure do |config|
config.folder = File.join('spec', 'data', 'sample_manifest_excel')
diff --git a/spec/sample_manifest_excel/tags_spec.rb b/spec/sample_manifest_excel/tags_spec.rb
index 4e9e2d127e..4c85c3701e 100644
--- a/spec/sample_manifest_excel/tags_spec.rb
+++ b/spec/sample_manifest_excel/tags_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-RSpec.describe SampleManifestExcel::Tags, sample_manifest: true, sample_manifest_excel: true, type: :model do
+RSpec.describe SampleManifestExcel::Tags, :sample_manifest, :sample_manifest_excel, type: :model do
describe 'example_data' do
let(:data) { SampleManifestExcel::Tags::ExampleData.new }
diff --git a/spec/sample_manifest_excel/test_download_spec.rb b/spec/sample_manifest_excel/test_download_spec.rb
index 6e4ba24323..12ee3fb207 100644
--- a/spec/sample_manifest_excel/test_download_spec.rb
+++ b/spec/sample_manifest_excel/test_download_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-RSpec.describe SampleManifestExcel::TestDownload, sample_manifest: true, sample_manifest_excel: true, type: :model do
+RSpec.describe SampleManifestExcel::TestDownload, :sample_manifest, :sample_manifest_excel, type: :model do
attr_reader :spreadsheet
let(:test_file) { 'test.xlsx' }
diff --git a/spec/sample_manifest_excel/upload/data_spec.rb b/spec/sample_manifest_excel/upload/data_spec.rb
index e9a44bc43f..46e911bdc7 100644
--- a/spec/sample_manifest_excel/upload/data_spec.rb
+++ b/spec/sample_manifest_excel/upload/data_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-RSpec.describe SampleManifestExcel::Upload::Data, sample_manifest: true, sample_manifest_excel: true, type: :model do
+RSpec.describe SampleManifestExcel::Upload::Data, :sample_manifest, :sample_manifest_excel, type: :model do
before(:all) do
SampleManifestExcel.configure do |config|
config.folder = File.join('spec', 'data', 'sample_manifest_excel')
diff --git a/spec/sample_manifest_excel/upload/processor_spec.rb b/spec/sample_manifest_excel/upload/processor_spec.rb
index 70787e25d3..6decb49b75 100644
--- a/spec/sample_manifest_excel/upload/processor_spec.rb
+++ b/spec/sample_manifest_excel/upload/processor_spec.rb
@@ -904,7 +904,7 @@ def cell(row, column)
.first(no_of_racks)
.map { |scan_result| scan_result['layout'].keys }
.flatten
- tube_barcodes.reject! { |key| ::CsvParserClient.no_read?(key) }
+ tube_barcodes.reject! { |key| CsvParserClient.no_read?(key) }
expect(barcodes.size).to eq(no_of_rows)
expect(barcodes.map(&:barcode)).to eq(tube_barcodes)
@@ -938,7 +938,7 @@ def cell(row, column)
layout = mock_microservice_responses[tube_rack_barcode]['layout']
layout.each_key do |tube_barcode|
- next if ::CsvParserClient.no_read?(tube_barcode)
+ next if CsvParserClient.no_read?(tube_barcode)
tube = Barcode.find_by(barcode: tube_barcode).asset
expect(tube.tube_rack).to eq(tube_rack)
diff --git a/spec/sample_manifest_excel/upload/row_spec.rb b/spec/sample_manifest_excel/upload/row_spec.rb
index bfd23604ce..3ab56dcdb6 100644
--- a/spec/sample_manifest_excel/upload/row_spec.rb
+++ b/spec/sample_manifest_excel/upload/row_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-RSpec.describe SampleManifestExcel::Upload::Row, sample_manifest: true, sample_manifest_excel: true, type: :model do
+RSpec.describe SampleManifestExcel::Upload::Row, :sample_manifest, :sample_manifest_excel, type: :model do
before do
create(:library_type, name: 'My New Library Type')
create(:reference_genome, name: 'My reference genome')
diff --git a/spec/sample_manifest_excel/upload/rows_spec.rb b/spec/sample_manifest_excel/upload/rows_spec.rb
index 4779ee2d8d..8d3ef7fa08 100644
--- a/spec/sample_manifest_excel/upload/rows_spec.rb
+++ b/spec/sample_manifest_excel/upload/rows_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-RSpec.describe SampleManifestExcel::Upload::Rows, sample_manifest: true, sample_manifest_excel: true, type: :model do
+RSpec.describe SampleManifestExcel::Upload::Rows, :sample_manifest, :sample_manifest_excel, type: :model do
before(:all) do
SampleManifestExcel.configure do |config|
config.folder = File.join('spec', 'data', 'sample_manifest_excel')
diff --git a/spec/sample_manifest_excel/upload/upload_spec.rb b/spec/sample_manifest_excel/upload/upload_spec.rb
index ef53fedf97..4833e3b5d5 100644
--- a/spec/sample_manifest_excel/upload/upload_spec.rb
+++ b/spec/sample_manifest_excel/upload/upload_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-RSpec.describe SampleManifestExcel::Upload, sample_manifest: true, sample_manifest_excel: true, type: :model do
+RSpec.describe SampleManifestExcel::Upload, :sample_manifest, :sample_manifest_excel, type: :model do
before(:all) do
SampleManifestExcel.configure do |config|
config.folder = File.join('spec', 'data', 'sample_manifest_excel')
@@ -326,7 +326,7 @@
expect(upload).to be_processed
end
- context 'when accessioning is enabled', accessioning_enabled: true do
+ context 'when accessioning is enabled', :accessioning_enabled do
it 'suppresses accessioning to allow explicit triggering after upload' do
expect { upload.process(nil) }.not_to change(Delayed::Job, :count)
end
diff --git a/spec/sample_manifest_excel/worksheet_spec.rb b/spec/sample_manifest_excel/worksheet_spec.rb
index 45b09d45f4..0c0b7bd512 100644
--- a/spec/sample_manifest_excel/worksheet_spec.rb
+++ b/spec/sample_manifest_excel/worksheet_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-RSpec.describe SampleManifestExcel::Worksheet, sample_manifest: true, sample_manifest_excel: true, type: :model do
+RSpec.describe SampleManifestExcel::Worksheet, :sample_manifest, :sample_manifest_excel, type: :model do
attr_reader :sample_manifest, :spreadsheet
let(:xls) { Axlsx::Package.new }
diff --git a/spec/sequencescape_excel/cell_spec.rb b/spec/sequencescape_excel/cell_spec.rb
index c19b0530aa..e951e3ea52 100644
--- a/spec/sequencescape_excel/cell_spec.rb
+++ b/spec/sequencescape_excel/cell_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-RSpec.describe SequencescapeExcel::Cell, sample_manifest: true, sample_manifest_excel: true, type: :model do
+RSpec.describe SequencescapeExcel::Cell, :sample_manifest, :sample_manifest_excel, type: :model do
it 'creates a row' do
expect(described_class.new(1, 4).row).to eq(1)
end
diff --git a/spec/sequencescape_excel/column_list_spec.rb b/spec/sequencescape_excel/column_list_spec.rb
index a67b581ee0..cd2bd3affb 100644
--- a/spec/sequencescape_excel/column_list_spec.rb
+++ b/spec/sequencescape_excel/column_list_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-RSpec.describe SequencescapeExcel::ColumnList, sample_manifest: true, sample_manifest_excel: true, type: :model do
+RSpec.describe SequencescapeExcel::ColumnList, :sample_manifest, :sample_manifest_excel, type: :model do
include SequencescapeExcel::Helpers
let(:folder) { File.join('spec', 'data', 'sample_manifest_excel', 'extract') }
diff --git a/spec/sequencescape_excel/column_spec.rb b/spec/sequencescape_excel/column_spec.rb
index 1b95ec69d2..9453a9c737 100644
--- a/spec/sequencescape_excel/column_spec.rb
+++ b/spec/sequencescape_excel/column_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-RSpec.describe SequencescapeExcel::Column, sample_manifest: true, sample_manifest_excel: true, type: :model do
+RSpec.describe SequencescapeExcel::Column, :sample_manifest, :sample_manifest_excel, type: :model do
let(:range_list) do
build(:range_list, ranges_data: { attributes_for(:validation)[:range_name] => attributes_for(:range) })
end
diff --git a/spec/sequencescape_excel/conditional_formatting_default_list_spec.rb b/spec/sequencescape_excel/conditional_formatting_default_list_spec.rb
index 3d82f67963..c5a106a5cf 100644
--- a/spec/sequencescape_excel/conditional_formatting_default_list_spec.rb
+++ b/spec/sequencescape_excel/conditional_formatting_default_list_spec.rb
@@ -3,8 +3,8 @@
require 'rails_helper'
RSpec.describe SequencescapeExcel::ConditionalFormattingDefaultList,
- sample_manifest: true,
- sample_manifest_excel: true,
+ :sample_manifest,
+ :sample_manifest_excel,
type: :model do
include SequencescapeExcel::Helpers
diff --git a/spec/sequencescape_excel/conditional_formatting_default_spec.rb b/spec/sequencescape_excel/conditional_formatting_default_spec.rb
index 0fda896a35..a6aa64603a 100644
--- a/spec/sequencescape_excel/conditional_formatting_default_spec.rb
+++ b/spec/sequencescape_excel/conditional_formatting_default_spec.rb
@@ -3,8 +3,8 @@
require 'rails_helper'
RSpec.describe SequencescapeExcel::ConditionalFormattingDefault,
- sample_manifest: true,
- sample_manifest_excel: true,
+ :sample_manifest,
+ :sample_manifest_excel,
type: :model do
context 'basic' do
let(:options) do
diff --git a/spec/sequencescape_excel/conditional_formatting_list_spec.rb b/spec/sequencescape_excel/conditional_formatting_list_spec.rb
index bee9d74b10..01dfe3d623 100644
--- a/spec/sequencescape_excel/conditional_formatting_list_spec.rb
+++ b/spec/sequencescape_excel/conditional_formatting_list_spec.rb
@@ -2,10 +2,7 @@
require 'rails_helper'
-RSpec.describe SequencescapeExcel::ConditionalFormattingList,
- sample_manifest: true,
- sample_manifest_excel: true,
- type: :model do
+RSpec.describe SequencescapeExcel::ConditionalFormattingList, :sample_manifest, :sample_manifest_excel, type: :model do
include SequencescapeExcel::Helpers
let(:folder) { File.join('spec', 'data', 'sample_manifest_excel', 'extract') }
diff --git a/spec/sequencescape_excel/conditional_formatting_spec.rb b/spec/sequencescape_excel/conditional_formatting_spec.rb
index 58357f1c78..bfa5c1920d 100644
--- a/spec/sequencescape_excel/conditional_formatting_spec.rb
+++ b/spec/sequencescape_excel/conditional_formatting_spec.rb
@@ -2,10 +2,7 @@
require 'rails_helper'
-RSpec.describe SequencescapeExcel::ConditionalFormatting,
- sample_manifest: true,
- sample_manifest_excel: true,
- type: :model do
+RSpec.describe SequencescapeExcel::ConditionalFormatting, :sample_manifest, :sample_manifest_excel, type: :model do
let(:worksheet) { Axlsx::Workbook.new.add_worksheet }
let(:rule) do
{
diff --git a/spec/sequencescape_excel/configuration_spec.rb b/spec/sequencescape_excel/configuration_spec.rb
index 81913d0a3b..a5df5ea5db 100644
--- a/spec/sequencescape_excel/configuration_spec.rb
+++ b/spec/sequencescape_excel/configuration_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-RSpec.describe SampleManifestExcel::Configuration, sample_manifest: true, sample_manifest_excel: true, type: :model do
+RSpec.describe SampleManifestExcel::Configuration, :sample_manifest, :sample_manifest_excel, type: :model do
let(:configuration) { described_class.new }
it 'is comparable' do
diff --git a/spec/sequencescape_excel/formula_spec.rb b/spec/sequencescape_excel/formula_spec.rb
index d39730f82c..3762d4a2a3 100644
--- a/spec/sequencescape_excel/formula_spec.rb
+++ b/spec/sequencescape_excel/formula_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-RSpec.describe SequencescapeExcel::Formula, sample_manifest: true, sample_manifest_excel: true, type: :model do
+RSpec.describe SequencescapeExcel::Formula, :sample_manifest, :sample_manifest_excel, type: :model do
let(:references) { build(:range).references }
let(:options) { { type: :smooth, operator: '>', operand: 30 } }
let(:formula) { described_class.new(options) }
diff --git a/spec/sequencescape_excel/list_spec.rb b/spec/sequencescape_excel/list_spec.rb
index e7120af627..8cc5f7657d 100644
--- a/spec/sequencescape_excel/list_spec.rb
+++ b/spec/sequencescape_excel/list_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-RSpec.describe SequencescapeExcel::List, sample_manifest: true, sample_manifest_excel: true, type: :model do
+RSpec.describe SequencescapeExcel::List, :sample_manifest, :sample_manifest_excel, type: :model do
class ListItem
attr_reader :attr_a, :attr_b, :attr_c, :attr_d
diff --git a/spec/sequencescape_excel/range_list_spec.rb b/spec/sequencescape_excel/range_list_spec.rb
index d92704d9f4..e4fe5b5c59 100644
--- a/spec/sequencescape_excel/range_list_spec.rb
+++ b/spec/sequencescape_excel/range_list_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-RSpec.describe SequencescapeExcel::RangeList, sample_manifest: true, sample_manifest_excel: true, type: :model do
+RSpec.describe SequencescapeExcel::RangeList, :sample_manifest, :sample_manifest_excel, type: :model do
include SequencescapeExcel::Helpers
let(:folder) { File.join('spec', 'data', 'sample_manifest_excel') }
diff --git a/spec/sequencescape_excel/range_spec.rb b/spec/sequencescape_excel/range_spec.rb
index ca2c8d5aad..49acf82e95 100644
--- a/spec/sequencescape_excel/range_spec.rb
+++ b/spec/sequencescape_excel/range_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-RSpec.describe SequencescapeExcel::Range, sample_manifest: true, sample_manifest_excel: true, type: :model do
+RSpec.describe SequencescapeExcel::Range, :sample_manifest, :sample_manifest_excel, type: :model do
let(:options) { %w[option1 option2 option3] }
it 'is comparable' do
@@ -88,51 +88,50 @@
it 'has identifier, scope, options' do
assert range.identifier
assert range.scope
- assert_equal original_option_size, range.options.count
+ expect(range.options.count).to eq(original_option_size)
end
it 'has a first row' do
- assert_equal 4, range.first_row
+ expect(range.first_row).to eq(4)
end
it 'sets the first column' do
- assert_equal 1, range.first_column
+ expect(range.first_column).to eq(1)
end
it 'sets the last column' do
- assert_equal original_option_size, range.last_column
- assert_equal 3 + original_option_size, described_class.new(attributes.merge(first_column: 4)).last_column
+ expect(range.last_column).to eq(original_option_size)
+ expect(described_class.new(attributes.merge(first_column: 4)).last_column).to eq(3 + original_option_size)
end
it 'has a first_cell' do
- assert_equal SequencescapeExcel::Cell.new(range.first_row, range.first_column), range.first_cell
+ expect(range.first_cell).to eq(SequencescapeExcel::Cell.new(range.first_row, range.first_column))
end
it 'has a last_cell' do
- assert_equal SequencescapeExcel::Cell.new(range.last_row, range.last_column), range.last_cell
+ expect(range.last_cell).to eq(SequencescapeExcel::Cell.new(range.last_row, range.last_column))
end
it 'has a first cell reference' do
- assert_equal range.first_cell.reference, range.first_cell_reference
+ expect(range.first_cell_reference).to eq(range.first_cell.reference)
end
it 'sets the reference' do
- assert_equal "#{range.first_cell.reference}:#{range.last_cell.reference}", range.reference
+ expect(range.reference).to eq("#{range.first_cell.reference}:#{range.last_cell.reference}")
end
it 'sets the fixed reference' do
- assert_equal "#{range.first_cell.fixed}:#{range.last_cell.fixed}", range.fixed_reference
+ expect(range.fixed_reference).to eq("#{range.first_cell.fixed}:#{range.last_cell.fixed}")
end
it '#references should return first_cell reference, reference, fixed_reference and absolute_reference' do
- assert_equal(
+ expect(range.references).to eq(
{
first_cell_reference: range.first_cell_reference,
reference: range.reference,
fixed_reference: range.fixed_reference,
absolute_reference: range.absolute_reference
- },
- range.references
+ }
)
end
@@ -144,8 +143,8 @@
it 'adjusts to changes in option number' do
previous_last_cell = range.last_cell.column
create :library_type, name: 'Other'
- assert_equal original_option_size + 1, range.last_column
- assert_equal previous_last_cell.next, range.last_cell.column
+ expect(range.last_column).to eq(original_option_size + 1)
+ expect(range.last_cell.column).to eq(previous_last_cell.next)
end
end
diff --git a/spec/sequencescape_excel/specialised_field_spec.rb b/spec/sequencescape_excel/specialised_field_spec.rb
index 542828a9a4..5a1ff3e311 100644
--- a/spec/sequencescape_excel/specialised_field_spec.rb
+++ b/spec/sequencescape_excel/specialised_field_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-RSpec.describe SequencescapeExcel::SpecialisedField, sample_manifest: true, sample_manifest_excel: true, type: :model do
+RSpec.describe SequencescapeExcel::SpecialisedField, :sample_manifest, :sample_manifest_excel, type: :model do
let(:map) { create(:map) }
let(:asset) { create(:untagged_well, map: map) }
let(:asset2) { create(:untagged_well, map: map) }
@@ -61,7 +61,7 @@ def self.name
it 'will produce the correct error message' do
my_perfect_class = class_with_base_and_value_required.new(value: nil)
my_perfect_class.valid?
- expect(my_perfect_class.errors.full_messages).to include('My perfect class can\'t be blank')
+ expect(my_perfect_class.errors.full_messages.join).to include('My perfect class can\'t be blank')
end
end
@@ -688,7 +688,7 @@ def self.name
it 'will not be valid if value does not match enum' do
sf = described_class.new(value: '5', sample_manifest_asset: sample_manifest_asset)
expect(sf).not_to be_valid
- expect(sf.errors.full_messages).to include('the priority 5 was not recognised.')
+ expect(sf.errors.full_messages.join).to include('the priority 5 was not recognised.')
end
it 'will update the priority on the sample when present' do
@@ -881,7 +881,7 @@ def self.name
sf = described_class.new(value: nil, sample_manifest_asset: sample_manifest_asset)
expect(sf).not_to be_valid
- expect(sf.errors.full_messages).to include('Retention instruction can\'t be blank')
+ expect(sf.errors.full_messages.join).to include('Retention instruction can\'t be blank')
end
it 'will be valid if the value matches one of the expected values' do
diff --git a/spec/sequencescape_excel/validation_spec.rb b/spec/sequencescape_excel/validation_spec.rb
index 7f6c6c0bf0..2aa5248d56 100644
--- a/spec/sequencescape_excel/validation_spec.rb
+++ b/spec/sequencescape_excel/validation_spec.rb
@@ -2,7 +2,7 @@
require 'rails_helper'
-RSpec.describe SequencescapeExcel::Validation, sample_manifest: true, sample_manifest_excel: true, type: :model do
+RSpec.describe SequencescapeExcel::Validation, :sample_manifest, :sample_manifest_excel, type: :model do
let(:options) { { option1: 'value1', option2: 'value2', type: :whole, formula1: 'smth' }.freeze }
let(:range) { build(:range) }
let(:worksheet) { instance_double(Axlsx::Worksheet, add_data_validation: true) }
diff --git a/spec/sequencescape_excel/worksheet_spec.rb b/spec/sequencescape_excel/worksheet_spec.rb
index bdc9c166e5..16ba4e6cca 100644
--- a/spec/sequencescape_excel/worksheet_spec.rb
+++ b/spec/sequencescape_excel/worksheet_spec.rb
@@ -3,7 +3,7 @@
require 'rails_helper'
require 'pry'
-RSpec.describe SequencescapeExcel::Worksheet, sample_manifest: true, sample_manifest_excel: true, type: :model do
+RSpec.describe SequencescapeExcel::Worksheet, :sample_manifest, :sample_manifest_excel, type: :model do
attr_reader :sample_manifest, :spreadsheet
let(:xls) { Axlsx::Package.new }
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index d865751e60..6a82929a29 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -59,6 +59,12 @@
the_driver
end
+Capybara.register_driver :selenium_chrome do |app|
+ driver = Capybara::Selenium::Driver.new(app, browser: :chrome)
+ driver.browser.download_path = DownloadHelpers::PATH.to_s
+ driver
+end
+
Capybara.javascript_driver = ENV.fetch('JS_DRIVER', 'headless_chrome').to_sym
Capybara.default_max_wait_time = 10
@@ -149,7 +155,7 @@
config.include UserLogin
- config.around(:each, warren: true) do |ex|
+ config.around(:each, :warren) do |ex|
Warren.handler.enable!
ex.run
Warren.handler.disable!
@@ -166,7 +172,7 @@
# expect { upload.process(nil) }.not_to change(Delayed::Job, :count)
# end
# end
- config.around(:each, accessioning_enabled: true) do |ex|
+ config.around(:each, :accessioning_enabled) do |ex|
original_value = configatron.accession_samples
original_config = Accession.configuration
Accession.configure do |accession|
@@ -185,9 +191,9 @@
FactoryBot.rewind_sequences
end
- config.before(:each, js: true) { page.driver.browser.manage.window.resize_to(1024, 1024) }
+ config.before(:each, :js) { page.driver.browser.manage.window.resize_to(1024, 1024) }
- config.after(:each, js: true) do |example|
+ config.after(:each, :js) do |example|
if example.exception
name = example.full_description.gsub(/\s/, '_')
CapybaraFailureLogger.log_failure(name, page)
diff --git a/spec/tasks/create_mbrave_tags_spec.rb b/spec/tasks/create_mbrave_tags_spec.rb
index 4713dd7962..9533765a6b 100644
--- a/spec/tasks/create_mbrave_tags_spec.rb
+++ b/spec/tasks/create_mbrave_tags_spec.rb
@@ -146,7 +146,7 @@
xit 'creates the right content in the yaml file' do
run_task
- contents = YAML.safe_load(File.read('mbrave.yml'), aliases: true)
+ contents = YAML.safe_load_file('mbrave.yml', aliases: true)
expect(contents[Rails.env].keys).to eq(
%w[Bioscan_forward_96_v1 Bioscan_reverse_4_1_v1 Bioscan_reverse_4_2_v1]
)
diff --git a/spec/uat_actions/generate_project_spec.rb b/spec/uat_actions/generate_project_spec.rb
index 8fe4142460..8d99d25a59 100644
--- a/spec/uat_actions/generate_project_spec.rb
+++ b/spec/uat_actions/generate_project_spec.rb
@@ -12,7 +12,7 @@
describe '#perform' do
context 'when generating a project' do
it 'generates a project' do
- expect { uat_action.perform }.to(change { Project.all.count }.by(1))
+ expect { uat_action.perform }.to(change(Project, :count).by(1))
end
it 'creates the project with the correct data' do
diff --git a/spec/uat_actions/generate_sample_manifest_spec.rb b/spec/uat_actions/generate_sample_manifest_spec.rb
index 146022df02..b34ba1400e 100644
--- a/spec/uat_actions/generate_sample_manifest_spec.rb
+++ b/spec/uat_actions/generate_sample_manifest_spec.rb
@@ -29,11 +29,11 @@
let(:with_samples) { '1' }
it 'generates tubes' do
- expect { uat_action.perform }.to(change { Tube.all.count }.by(2))
+ expect { uat_action.perform }.to(change(Tube, :count).by(2))
end
it 'generates samples' do
- expect { uat_action.perform }.to(change { Sample.all.count }.by(2))
+ expect { uat_action.perform }.to(change(Sample, :count).by(2))
end
it 'links to those samples' do
@@ -46,11 +46,11 @@
let(:with_samples) { '0' }
it 'generates tubes' do
- expect { uat_action.perform }.to(change { Tube.all.count }.by(2))
+ expect { uat_action.perform }.to(change(Tube, :count).by(2))
end
it 'does not generate samples' do
- expect { uat_action.perform }.not_to(change { Sample.all.count })
+ expect { uat_action.perform }.not_to(change(Sample, :count))
end
end
end
diff --git a/spec/uat_actions/generate_study_spec.rb b/spec/uat_actions/generate_study_spec.rb
index 8a608ef256..9f4e302fa9 100644
--- a/spec/uat_actions/generate_study_spec.rb
+++ b/spec/uat_actions/generate_study_spec.rb
@@ -11,7 +11,7 @@
describe '#perform' do
context 'when generating a study' do
it 'generates a study' do
- expect { uat_action.perform }.to(change { Study.all.count }.by(1))
+ expect { uat_action.perform }.to(change(Study, :count).by(1))
end
it 'creates the study with the correct data' do
diff --git a/test/controllers/plates_controller_test.rb b/test/controllers/plates_controller_test.rb
index c30b7a896d..18c8ae6eaa 100644
--- a/test/controllers/plates_controller_test.rb
+++ b/test/controllers/plates_controller_test.rb
@@ -106,7 +106,7 @@ class PlatesControllerTest < ActionController::TestCase
@missing_barcode_create_params = {
plates: {
creator_id: @dilution_plates_creator.id,
- source_plates: @plate_barcodes.concat(['missing']).join(','),
+ source_plates: @plate_barcodes.push('missing').join(','),
barcode_printer: @barcode_printer.id,
user_barcode: '1234567',
create_asset_group: 'Yes'
diff --git a/test/factories/location_report_factories.rb b/test/factories/location_report_factories.rb
index 33f2b65e25..b20a02ea4a 100644
--- a/test/factories/location_report_factories.rb
+++ b/test/factories/location_report_factories.rb
@@ -1,7 +1,7 @@
# frozen_string_literal: true
FactoryBot.define do
- factory :location_report, class: LocationReport do
+ factory :location_report, class: 'LocationReport' do
user
sequence(:name) { |n| "Location Report #{n}" }
report_type { :type_selection }
@@ -14,7 +14,7 @@
end
end
- factory(:location_report_form, class: LocationReport::LocationReportForm) do
+ factory(:location_report_form, class: 'LocationReport::LocationReportForm') do
skip_create
user
diff --git a/test/shoulda_macros/sanger_macros/resource_test.rb b/test/shoulda_macros/sanger_macros/resource_test.rb
index 17b50e2073..9e33d2163e 100644
--- a/test/shoulda_macros/sanger_macros/resource_test.rb
+++ b/test/shoulda_macros/sanger_macros/resource_test.rb
@@ -6,7 +6,6 @@
# elsewhere.
# rubocop:disable Metrics/MethodLength
# rubocop:disable Metrics/AbcSize
-# rubocop:disable Metrics/ParameterLists
module Sanger
module Testing
module Controller
@@ -14,21 +13,20 @@ module Macros # rubocop:todo Metrics/ModuleLength
RESTFUL_ACTIONS = %w[index new create show update destroy edit].freeze
# rubocop:todo Metrics/PerceivedComplexity, Metrics/CyclomaticComplexity
- def resource_test(
- resource_name,
- ignore_actions: [],
- actions: (RESTFUL_ACTIONS - ignore_actions),
- with_prefix: '',
- other_actions: [],
- formats: %w[html xml json],
- defaults: {},
- protect_on_update: [],
- extra_on_update: {},
- parent: nil,
- setup_with: nil,
- teardown_with: nil,
- user: :user
- )
+ def resource_test(resource_name, kwords)
+ ignore_actions = kwords[:ignore_actions] || []
+ actions = kwords[:actions] || (RESTFUL_ACTIONS - ignore_actions)
+ with_prefix = kwords[:with_prefix] || ''
+ other_actions = kwords[:other_actions] || []
+ formats = kwords[:formats] || %w[html xml json]
+ defaults = kwords[:defaults] || {}
+ protect_on_update = kwords[:protect_on_update] || []
+ extra_on_update = kwords[:extra_on_update] || {}
+ parent = kwords[:parent] || nil
+ setup_with = kwords[:setup_with] || nil
+ teardown_with = kwords[:teardown_with] || nil
+ user = kwords[:user] || :user
+
resource_name = resource_name.to_sym
untested_actions = (RESTFUL_ACTIONS - ignore_actions) - actions
@@ -233,4 +231,4 @@ def resource_test(
end
end
end
-# rubocop:enable Metrics/MethodLength, Metrics/AbcSize, Metrics/ParameterLists
+# rubocop:enable Metrics/MethodLength, Metrics/AbcSize
diff --git a/test/test_helper.rb b/test/test_helper.rb
index d1dacdb0c8..f486ad20e8 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -22,10 +22,10 @@
end
Dir.glob(File.expand_path(File.join(Rails.root, %w[spec factories ** *.rb]))) # rubocop:disable Rails/RootPathnameMethods
- .sort.each { |factory_filename| require factory_filename }
+ .each { |factory_filename| require factory_filename }
Dir.glob(File.expand_path(File.join(Rails.root, %w[test shoulda_macros *.rb]))) # rubocop:disable Rails/RootPathnameMethods
- .sort.each { |macro_filename| require macro_filename }
+ .each { |macro_filename| require macro_filename }
require "#{Rails.root}/test/unit/task_test_base"
diff --git a/test/unit/cherrypick_task_test.rb b/test/unit/cherrypick_task_test.rb
index b896d7499c..de5921fb2f 100644
--- a/test/unit/cherrypick_task_test.rb
+++ b/test/unit/cherrypick_task_test.rb
@@ -148,9 +148,9 @@ def maps_for(num, from = 0, order = 'column')
(1..4).inject([]) do |plate, row|
plate.tap do
request = @requests[row - 1]
- plate.concat([CherrypickTask::TEMPLATE_EMPTY_WELL])
+ plate.push(CherrypickTask::TEMPLATE_EMPTY_WELL)
plate.push([request.id, request.asset.plate.human_barcode, request.asset.map.description])
- plate.concat([CherrypickTask::EMPTY_WELL])
+ plate.push(CherrypickTask::EMPTY_WELL)
end
end
diff --git a/test/unit/request_factory_test.rb b/test/unit/request_factory_test.rb
index 76c1febf28..5339e13433 100644
--- a/test/unit/request_factory_test.rb
+++ b/test/unit/request_factory_test.rb
@@ -51,7 +51,7 @@ class RequestcreateTest < ActiveSupport::TestCase
context '.create_assets_requests' do
setup do
@study = create(:study)
- @assets = [create(:sample_tube, study: nil, project: nil), create(:sample_tube, study: nil, project: nil)]
+ @assets = create_list(:sample_tube, 2, study: nil, project: nil)
RequestFactory.create_assets_requests(@assets, @study)
end