Browse Source

Rubocop

pull/21/head
baarkerlounger 3 years ago
parent
commit
dbe12960aa
  1. 6
      Gemfile
  2. 2
      app/models/case_log.rb
  3. 2
      spec/factories/case_log.rb
  4. 4
      spec/features/case_log_spec.rb
  5. 3
      spec/spec_helper.rb

6
Gemfile

@ -25,10 +25,10 @@ group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console # Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem "byebug", platforms: %i[mri mingw x64_mingw] gem "byebug", platforms: %i[mri mingw x64_mingw]
gem "capybara" gem "capybara"
gem "pry-byebug"
gem "dotenv-rails" gem "dotenv-rails"
gem "selenium-webdriver"
gem "factory_bot_rails" gem "factory_bot_rails"
gem "pry-byebug"
gem "selenium-webdriver"
%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" gem lib, git: "https://github.com/rspec/#{lib}.git", branch: "main"
end end
@ -40,12 +40,12 @@ group :development do
# Display performance information such as SQL time and flame graphs for each request in your browser. # Display performance information such as SQL time and flame graphs for each request in your browser.
# Can be configured to work on production as well see: https://github.com/MiniProfiler/rack-mini-profiler/blob/master/README.md # Can be configured to work on production as well see: https://github.com/MiniProfiler/rack-mini-profiler/blob/master/README.md
gem "listen", "~> 3.3" gem "listen", "~> 3.3"
gem "overcommit", ">= 0.37.0", require: false
gem "rack-mini-profiler", "~> 2.0" gem "rack-mini-profiler", "~> 2.0"
gem "rubocop-govuk" gem "rubocop-govuk"
gem "rubocop-performance", require: false gem "rubocop-performance", require: false
gem "rubocop-rails" gem "rubocop-rails"
gem "scss_lint-govuk" gem "scss_lint-govuk"
gem "overcommit", ">= 0.37.0", require: false
end end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem # Windows does not include zoneinfo files, so bundle the tzinfo-data gem

2
app/models/case_log.rb

@ -1,3 +1,3 @@
class CaseLog < ApplicationRecord class CaseLog < ApplicationRecord
enum status: ["in progress", "submitted"] enum status: { "in progress" => 0, "submitted" => 1 }
end end

2
spec/factories/case_log.rb

@ -1,6 +1,6 @@
FactoryBot.define do FactoryBot.define do
factory :case_log do factory :case_log do
id { 342351 } id { 342_351 }
status { 0 } status { 0 }
end end
end end

4
spec/features/case_log_spec.rb

@ -1,7 +1,7 @@
require "rails_helper" require "rails_helper"
RSpec.describe "Test Features" do RSpec.describe "Test Features" do
let!(:case_log){ FactoryBot.create(:case_log) } let!(:case_log) { FactoryBot.create(:case_log) }
let(:id){ case_log.id } let(:id) { case_log.id }
let(:status) { case_log.status } let(:status) { case_log.status }
it "Displays a tasklist header" do it "Displays a tasklist header" do

3
spec/spec_helper.rb

@ -87,7 +87,7 @@ RSpec.configure do |config|
# # order dependency and want to debug it, you can fix the order by providing # # order dependency and want to debug it, you can fix the order by providing
# # the seed, which is printed after each run. # # the seed, which is printed after each run.
# # --seed 1234 # # --seed 1234
config.order = :random config.order = :random
# #
# # Seed global randomization in this process using the `--seed` CLI option. # # Seed global randomization in this process using the `--seed` CLI option.
# # Setting this allows you to use `--seed` to deterministically reproduce # # Setting this allows you to use `--seed` to deterministically reproduce
@ -95,6 +95,5 @@ RSpec.configure do |config|
# # as the one that triggered the failure. # # as the one that triggered the failure.
# Kernel.srand config.seed # Kernel.srand config.seed
config.include FactoryBot::Syntax::Methods config.include FactoryBot::Syntax::Methods
end end

Loading…
Cancel
Save