Browse Source

rubocop

pull/64/head
magicmilo 3 years ago
parent
commit
073ccfe633
  1. 2
      Gemfile
  2. 4
      spec/models/case_log_spec.rb
  3. 3
      spec/rails_helper.rb

2
Gemfile

@ -49,10 +49,10 @@ end
group :test do group :test do
gem "capybara", require: false gem "capybara", require: false
gem "database_cleaner-active_record", require: false
gem "factory_bot_rails" gem "factory_bot_rails"
gem "selenium-webdriver", require: false gem "selenium-webdriver", require: false
gem "simplecov", require: false gem "simplecov", require: false
gem "database_cleaner-active_record", require: false
%w[rspec-core rspec-expectations rspec-mocks rspec-rails rspec-support].each do |lib| %w[rspec-core rspec-expectations rspec-mocks rspec-rails rspec-support].each do |lib|
gem lib, git: "https://github.com/rspec/#{lib}.git", branch: "main", require: false gem lib, git: "https://github.com/rspec/#{lib}.git", branch: "main", require: false
end end

4
spec/models/case_log_spec.rb

@ -176,7 +176,7 @@ RSpec.describe Form, type: :model do
expect { expect {
CaseLog.create!(armed_forces: "No", CaseLog.create!(armed_forces: "No",
armed_forces_active: "Yes") armed_forces_active: "Yes")
}.to raise_error }.to raise_error(ActiveRecord::RecordInvalid)
end end
# Crossover over tests here as injured must be answered as well for no error # Crossover over tests here as injured must be answered as well for no error
@ -185,7 +185,7 @@ RSpec.describe Form, type: :model do
CaseLog.create!(armed_forces: "Yes - a regular", CaseLog.create!(armed_forces: "Yes - a regular",
armed_forces_active: "Yes", armed_forces_active: "Yes",
armed_forces_injured: "Yes") armed_forces_injured: "Yes")
}.not_to raise_error }.not_to raise_error
end end
end end
end end

3
spec/rails_helper.rb

@ -6,7 +6,7 @@ require File.expand_path("../config/environment", __dir__)
abort("The Rails environment is running in production mode!") if Rails.env.production? abort("The Rails environment is running in production mode!") if Rails.env.production?
require "rspec/rails" require "rspec/rails"
require "capybara/rspec" require "capybara/rspec"
require 'database_cleaner/active_record' require "database_cleaner/active_record"
# Comment to run `js: true specs` with visible browser interaction # Comment to run `js: true specs` with visible browser interaction
Capybara.javascript_driver = :selenium_headless Capybara.javascript_driver = :selenium_headless
@ -58,6 +58,7 @@ RSpec.configure do |config|
uncommitted transaction data setup over the spec's database connection. uncommitted transaction data setup over the spec's database connection.
MSG MSG
end end
DatabaseCleaner.clean_with(:truncation) DatabaseCleaner.clean_with(:truncation)
end end

Loading…
Cancel
Save