Browse Source

Add simplecov

pull/21/head
baarkerlounger 3 years ago
parent
commit
62c43a50ef
  1. 3
      .gitignore
  2. 1
      Gemfile
  3. 8
      Gemfile.lock
  4. 1
      spec/controllers/case_logs_controller_spec.rb
  5. 12
      spec/spec_helper.rb

3
.gitignore vendored

@ -36,3 +36,6 @@ yarn-debug.log*
.yarn-integrity
.env
# Code coverage results
/coverage

1
Gemfile

@ -30,6 +30,7 @@ group :development, :test do
gem "factory_bot_rails"
gem "pry-byebug"
gem "selenium-webdriver"
gem "simplecov"
%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"
end

8
Gemfile.lock

@ -129,6 +129,7 @@ GEM
crass (1.0.6)
deep_merge (1.2.1)
diff-lcs (1.4.4)
docile (1.4.0)
dotenv (2.7.6)
dotenv-rails (2.7.6)
dotenv (= 2.7.6)
@ -280,6 +281,12 @@ GEM
childprocess (>= 0.5, < 4.0)
rubyzip (>= 1.2.2)
semantic_range (3.0.0)
simplecov (0.21.2)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.3)
sprockets (4.0.2)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
@ -346,6 +353,7 @@ DEPENDENCIES
rubocop-rails
scss_lint-govuk
selenium-webdriver
simplecov
tzinfo-data
web-console (>= 4.1.0)
webpacker (~> 5.0)

1
spec/controllers/case_logs_controller_spec.rb

@ -33,7 +33,6 @@ RSpec.describe CaseLogsController, type: :controller do
describe "GET #edit" do
it "returns a success response" do
get :edit, params: { id: id }
puts response
expect(response).to be_successful
end
end

12
spec/spec_helper.rb

@ -15,6 +15,18 @@
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
require "factory_bot"
require "simplecov"
SimpleCov.start "rails" do
add_filter "/bin/"
add_filter "/db/"
add_filter "/spec/"
add_filter "app/channels/application_cable/channel.rb"
add_filter "app/jobs/application_job.rb"
add_filter "app/mailers/application_mailer.rb"
add_filter "app/controllers/application_controller.rb"
add_filter "app/channels/application_cable/connection.rb"
end
RSpec.configure do |config|
# rspec-expectations config goes here. You can use an alternate

Loading…
Cancel
Save