From 29d8ae30e80f00fac8ff062a4242982134492872 Mon Sep 17 00:00:00 2001 From: AlexVKO Date: Mon, 18 Jan 2021 19:22:37 -0500 Subject: [PATCH 1/9] Install PG --- Gemfile | 4 ++-- Gemfile.lock | 4 ++-- config/database.yml | 8 ++++---- db/schema.rb | 39 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 47 insertions(+), 8 deletions(-) create mode 100644 db/schema.rb diff --git a/Gemfile b/Gemfile index c45917c..56b9d1e 100644 --- a/Gemfile +++ b/Gemfile @@ -9,8 +9,8 @@ gem 'rails', '~> 6.1.1' # DBS # mysql -# postgresql -gem 'sqlite3' +gem 'pg' +# gem 'sqlite3' # oracle # sqlserver # jdbcmysql diff --git a/Gemfile.lock b/Gemfile.lock index 3ad0e4d..27a9782 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -104,6 +104,7 @@ GEM nio4r (2.5.4) nokogiri (1.11.1-x86_64-darwin) racc (~> 1.4) + pg (1.2.3) public_suffix (4.0.6) puma (5.1.1) nio4r (~> 2.0) @@ -169,7 +170,6 @@ GEM actionpack (>= 4.0) activesupport (>= 4.0) sprockets (>= 3.0.0) - sqlite3 (1.4.2) thor (1.0.1) tilt (2.0.10) turbolinks (5.2.1) @@ -207,13 +207,13 @@ DEPENDENCIES capybara (>= 3.26) jbuilder (~> 2.7) listen (~> 3.3) + pg puma (~> 5.0) rack-mini-profiler (~> 2.0) rails (~> 6.1.1) sass-rails (>= 6) selenium-webdriver spring - sqlite3 turbolinks (~> 5) tzinfo-data web-console (>= 4.1.0) diff --git a/config/database.yml b/config/database.yml index 4a8a1b2..41d5726 100644 --- a/config/database.yml +++ b/config/database.yml @@ -5,21 +5,21 @@ # gem 'sqlite3' # default: &default - adapter: sqlite3 + adapter: postgresql pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> timeout: 5000 development: <<: *default - database: db/development.sqlite3 + database: development_rails_6 # Warning: The database defined as "test" will be erased and # re-generated from your development database when you run "rake". # Do not set this db to the same as development or production. test: <<: *default - database: db/test.sqlite3 + database: test_rails_6 production: <<: *default - database: db/production.sqlite3 + database: development_rails_6 diff --git a/db/schema.rb b/db/schema.rb new file mode 100644 index 0000000..00783ce --- /dev/null +++ b/db/schema.rb @@ -0,0 +1,39 @@ +# This file is auto-generated from the current state of the database. Instead +# of editing this file, please use the migrations feature of Active Record to +# incrementally modify your database, and then regenerate this schema definition. +# +# This file is the source Rails uses to define your schema when running `bin/rails +# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to +# be faster and is potentially less error prone than running all of your +# migrations from scratch. Old migrations may fail to apply correctly if those +# migrations use external dependencies or application code. +# +# It's strongly recommended that you check this file into your version control system. + +ActiveRecord::Schema.define(version: 2021_01_19_001655) do + + # These are extensions that must be enabled in order to support this database + enable_extension "plpgsql" + + create_table "cities", force: :cascade do |t| + t.string "name" + t.bigint "user_id", null: false + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.index ["user_id"], name: "index_cities_on_user_id" + end + + create_table "companies", force: :cascade do |t| + t.string "name" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + end + + create_table "users", force: :cascade do |t| + t.string "name" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + end + + add_foreign_key "cities", "users" +end From ef6f6df1cdde7eff99d6f3013f46785c94b08522 Mon Sep 17 00:00:00 2001 From: AlexVKO Date: Mon, 18 Jan 2021 19:37:28 -0500 Subject: [PATCH 2/9] Add rspec --- .rspec | 1 + Gemfile | 3 +- Gemfile.lock | 19 ++++++++ db/schema.rb | 36 ++++++++++++++ spec/models/city_spec.rb | 0 spec/models/company_spec.rb | 0 spec/models/user_spec.rb | 19 ++++++++ spec/rails_helper.rb | 64 +++++++++++++++++++++++++ spec/spec_helper.rb | 96 +++++++++++++++++++++++++++++++++++++ 9 files changed, 236 insertions(+), 2 deletions(-) create mode 100644 .rspec create mode 100644 db/schema.rb create mode 100644 spec/models/city_spec.rb create mode 100644 spec/models/company_spec.rb create mode 100644 spec/models/user_spec.rb create mode 100644 spec/rails_helper.rb create mode 100644 spec/spec_helper.rb diff --git a/.rspec b/.rspec new file mode 100644 index 0000000..c99d2e7 --- /dev/null +++ b/.rspec @@ -0,0 +1 @@ +--require spec_helper diff --git a/Gemfile b/Gemfile index c45917c..85337c7 100644 --- a/Gemfile +++ b/Gemfile @@ -20,7 +20,7 @@ gem 'sqlite3' # TestFrameworks # minutest -# rspec +gem "rspec-rails" # cucumber # test-unit # selenium @@ -64,7 +64,6 @@ group :development do end - group :test do # Adds support for Capybara system testing and selenium driver gem 'capybara', '>= 3.26' diff --git a/Gemfile.lock b/Gemfile.lock index 3ad0e4d..00ee7b7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -78,6 +78,7 @@ GEM childprocess (3.0.0) concurrent-ruby (1.1.7) crass (1.0.6) + diff-lcs (1.4.4) erubi (1.10.0) ffi (1.14.2) globalid (0.4.2) @@ -146,6 +147,23 @@ GEM rb-inotify (0.10.1) ffi (~> 1.0) regexp_parser (1.8.2) + rspec-core (3.10.1) + rspec-support (~> 3.10.0) + rspec-expectations (3.10.1) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.10.0) + rspec-mocks (3.10.1) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.10.0) + rspec-rails (4.0.2) + actionpack (>= 4.2) + activesupport (>= 4.2) + railties (>= 4.2) + rspec-core (~> 3.10) + rspec-expectations (~> 3.10) + rspec-mocks (~> 3.10) + rspec-support (~> 3.10) + rspec-support (3.10.1) rubyzip (2.3.0) sass-rails (6.0.0) sassc-rails (~> 2.1, >= 2.1.1) @@ -210,6 +228,7 @@ DEPENDENCIES puma (~> 5.0) rack-mini-profiler (~> 2.0) rails (~> 6.1.1) + rspec-rails sass-rails (>= 6) selenium-webdriver spring diff --git a/db/schema.rb b/db/schema.rb new file mode 100644 index 0000000..361ba39 --- /dev/null +++ b/db/schema.rb @@ -0,0 +1,36 @@ +# This file is auto-generated from the current state of the database. Instead +# of editing this file, please use the migrations feature of Active Record to +# incrementally modify your database, and then regenerate this schema definition. +# +# This file is the source Rails uses to define your schema when running `bin/rails +# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to +# be faster and is potentially less error prone than running all of your +# migrations from scratch. Old migrations may fail to apply correctly if those +# migrations use external dependencies or application code. +# +# It's strongly recommended that you check this file into your version control system. + +ActiveRecord::Schema.define(version: 2021_01_19_001655) do + + create_table "cities", force: :cascade do |t| + t.string "name" + t.integer "user_id", null: false + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.index ["user_id"], name: "index_cities_on_user_id" + end + + create_table "companies", force: :cascade do |t| + t.string "name" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + end + + create_table "users", force: :cascade do |t| + t.string "name" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + end + + add_foreign_key "cities", "users" +end diff --git a/spec/models/city_spec.rb b/spec/models/city_spec.rb new file mode 100644 index 0000000..e69de29 diff --git a/spec/models/company_spec.rb b/spec/models/company_spec.rb new file mode 100644 index 0000000..e69de29 diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb new file mode 100644 index 0000000..ad956ab --- /dev/null +++ b/spec/models/user_spec.rb @@ -0,0 +1,19 @@ +require 'rails_helper' + +RSpec.describe User do + describe "#generate_jwt" do + it "generates a valid jwt with a payload of id" do + end + end + + describe "#personal_data" do + it "returns data of first_name, last_name, and email" do + end + end + + describe "#subscription" do + it "returns the associated subscription" do + end + end +end + diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb new file mode 100644 index 0000000..00345af --- /dev/null +++ b/spec/rails_helper.rb @@ -0,0 +1,64 @@ +# This file is copied to spec/ when you run 'rails generate rspec:install' +require 'spec_helper' +ENV['RAILS_ENV'] ||= 'test' +require File.expand_path('../config/environment', __dir__) +# Prevent database truncation if the environment is production +abort("The Rails environment is running in production mode!") if Rails.env.production? +require 'rspec/rails' +# Add additional requires below this line. Rails is not loaded until this point! + +# Requires supporting ruby files with custom matchers and macros, etc, in +# spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are +# run as spec files by default. This means that files in spec/support that end +# in _spec.rb will both be required and run as specs, causing the specs to be +# run twice. It is recommended that you do not name files matching this glob to +# end with _spec.rb. You can configure this pattern with the --pattern +# option on the command line or in ~/.rspec, .rspec or `.rspec-local`. +# +# The following line is provided for convenience purposes. It has the downside +# of increasing the boot-up time by auto-requiring all files in the support +# 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 } + +# Checks for pending migrations and applies them before tests are run. +# If you are not using ActiveRecord, you can remove these lines. +begin + ActiveRecord::Migration.maintain_test_schema! +rescue ActiveRecord::PendingMigrationError => e + puts e.to_s.strip + exit 1 +end +RSpec.configure do |config| + # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures + config.fixture_path = "#{::Rails.root}/spec/fixtures" + + # If you're not using ActiveRecord, or you'd prefer not to run each of your + # examples within a transaction, remove the following line or assign false + # instead of true. + config.use_transactional_fixtures = true + + # You can uncomment this line to turn off ActiveRecord support entirely. + # config.use_active_record = false + + # RSpec Rails can automatically mix in different behaviours to your tests + # based on their file location, for example enabling you to call `get` and + # `post` in specs under `spec/controllers`. + # + # You can disable this behaviour by removing the line below, and instead + # explicitly tag your specs with their type, e.g.: + # + # RSpec.describe UsersController, type: :controller do + # # ... + # end + # + # The different available types are documented in the features, such as in + # https://relishapp.com/rspec/rspec-rails/docs + config.infer_spec_type_from_file_location! + + # Filter lines from Rails gems in backtraces. + config.filter_rails_from_backtrace! + # arbitrary gems may also be filtered via: + # config.filter_gems_from_backtrace("gem name") +end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb new file mode 100644 index 0000000..ce33d66 --- /dev/null +++ b/spec/spec_helper.rb @@ -0,0 +1,96 @@ +# This file was generated by the `rails generate rspec:install` command. Conventionally, all +# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. +# The generated `.rspec` file contains `--require spec_helper` which will cause +# this file to always be loaded, without a need to explicitly require it in any +# files. +# +# Given that it is always loaded, you are encouraged to keep this file as +# light-weight as possible. Requiring heavyweight dependencies from this file +# will add to the boot time of your test suite on EVERY test run, even for an +# individual file that may not need all of that loaded. Instead, consider making +# a separate helper file that requires the additional dependencies and performs +# the additional setup, and require it from the spec files that actually need +# it. +# +# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration +RSpec.configure do |config| + # rspec-expectations config goes here. You can use an alternate + # assertion/expectation library such as wrong or the stdlib/minitest + # assertions if you prefer. + config.expect_with :rspec do |expectations| + # This option will default to `true` in RSpec 4. It makes the `description` + # and `failure_message` of custom matchers include text for helper methods + # defined using `chain`, e.g.: + # be_bigger_than(2).and_smaller_than(4).description + # # => "be bigger than 2 and smaller than 4" + # ...rather than: + # # => "be bigger than 2" + expectations.include_chain_clauses_in_custom_matcher_descriptions = true + end + + # rspec-mocks config goes here. You can use an alternate test double + # library (such as bogus or mocha) by changing the `mock_with` option here. + config.mock_with :rspec do |mocks| + # Prevents you from mocking or stubbing a method that does not exist on + # a real object. This is generally recommended, and will default to + # `true` in RSpec 4. + mocks.verify_partial_doubles = true + end + + # This option will default to `:apply_to_host_groups` in RSpec 4 (and will + # have no way to turn it off -- the option exists only for backwards + # compatibility in RSpec 3). It causes shared context metadata to be + # inherited by the metadata hash of host groups and examples, rather than + # triggering implicit auto-inclusion in groups with matching metadata. + config.shared_context_metadata_behavior = :apply_to_host_groups + +# The settings below are suggested to provide a good initial experience +# with RSpec, but feel free to customize to your heart's content. +=begin + # This allows you to limit a spec run to individual examples or groups + # you care about by tagging them with `:focus` metadata. When nothing + # is tagged with `:focus`, all examples get run. RSpec also provides + # aliases for `it`, `describe`, and `context` that include `:focus` + # metadata: `fit`, `fdescribe` and `fcontext`, respectively. + config.filter_run_when_matching :focus + + # Allows RSpec to persist some state between runs in order to support + # the `--only-failures` and `--next-failure` CLI options. We recommend + # you configure your source control system to ignore this file. + config.example_status_persistence_file_path = "spec/examples.txt" + + # Limits the available syntax to the non-monkey patched syntax that is + # recommended. For more details, see: + # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/ + # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/ + # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode + config.disable_monkey_patching! + + # Many RSpec users commonly either run the entire suite or an individual + # file, and it's useful to allow more verbose output when running an + # individual spec file. + if config.files_to_run.one? + # Use the documentation formatter for detailed output, + # unless a formatter has already been configured + # (e.g. via a command-line flag). + config.default_formatter = "doc" + end + + # Print the 10 slowest examples and example groups at the + # end of the spec run, to help surface which specs are running + # particularly slow. + config.profile_examples = 10 + + # Run specs in random order to surface order dependencies. If you find an + # order dependency and want to debug it, you can fix the order by providing + # the seed, which is printed after each run. + # --seed 1234 + config.order = :random + + # Seed global randomization in this process using the `--seed` CLI option. + # Setting this allows you to use `--seed` to deterministically reproduce + # test failures related to randomization by passing the same `--seed` value + # as the one that triggered the failure. + Kernel.srand config.seed +=end +end From d0e91ad752198fe5ba0b00e4db0c37ff39967bb3 Mon Sep 17 00:00:00 2001 From: AlexVKO Date: Mon, 18 Jan 2021 19:50:31 -0500 Subject: [PATCH 3/9] add some specs --- spec/models/city_spec.rb | 19 +++++++++++++++++++ spec/models/company_spec.rb | 17 +++++++++++++++++ spec/models/user_spec.rb | 3 +++ 3 files changed, 39 insertions(+) diff --git a/spec/models/city_spec.rb b/spec/models/city_spec.rb index e69de29..7b66550 100644 --- a/spec/models/city_spec.rb +++ b/spec/models/city_spec.rb @@ -0,0 +1,19 @@ +require 'rails_helper' + +RSpec.describe City do + it 'belongs to country' do + sleep 1 + rand + end + + it 'has many neighbourhoods' do + sleep 1 + rand + end + + it 'validates name' do + sleep 1 + rand + end + + it 'has people living in' do + sleep 1 + rand + end +end diff --git a/spec/models/company_spec.rb b/spec/models/company_spec.rb index e69de29..0db71e8 100644 --- a/spec/models/company_spec.rb +++ b/spec/models/company_spec.rb @@ -0,0 +1,17 @@ +require 'rails_helper' + +RSpec.describe Company do + describe '#generate_invoice' do + it 'generates pdf' do + sleep 1 + rand + end + + it 'total is the sum of all lines' do + sleep 1 + rand + end + + it 'it starts with non paid' do + sleep 1 + rand + end + end +end diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index ad956ab..6395078 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -3,16 +3,19 @@ RSpec.describe User do describe "#generate_jwt" do it "generates a valid jwt with a payload of id" do + sleep 1 + rand end end describe "#personal_data" do it "returns data of first_name, last_name, and email" do + sleep 1 + rand end end describe "#subscription" do it "returns the associated subscription" do + sleep 1 + rand end end end From 803796bbe84957305c5a816f9e8930bd7f4cbee4 Mon Sep 17 00:00:00 2001 From: AlexVKO Date: Mon, 18 Jan 2021 20:02:00 -0500 Subject: [PATCH 4/9] update readme --- README.md | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 1dd36cc..49b1b65 100644 --- a/README.md +++ b/README.md @@ -1,33 +1,33 @@ # Base Branches main - rspec - failed - success - error + [x] rspec + [ ] failed + [ ] success + [ ] error - rubocop - failed - success - error + [ ] rubocop + [ ] failed + [ ] success + [ ] error - simplecov - failed - success + [ ] simplecov + [ ] failed + [ ] success - pg - mysql - mongo - sqlite3 + [ ] pg + [ ] mysql + [ ] mongo + [ ] sqlite3 # Test Branches - rspec_failed + pg - rspec_success + pg - rspec_failed + pg + [x] rspec_failed + pg + [x] rspec_success + pg + [ ] rspec_failed + pg - rspec_failed + pg + simplecov - rspec_success + pg + simplecov - rspec_failed + pg + simplecov + [ ] rspec_failed + pg + simplecov + [ ] rspec_success + pg + simplecov + [ ] rspec_failed + pg + simplecov - rspec_failed + pg + simplecov + rubocop - rspec_success + pg + simplecov + rubocop - rspec_failed + pg + simplecov + rubocop + [ ] rspec_failed + pg + simplecov + rubocop + [ ] rspec_success + pg + simplecov + rubocop + [ ] rspec_failed + pg + simplecov + rubocop From b003e2408c1c40e25c68c9832dde736d1aea6f72 Mon Sep 17 00:00:00 2001 From: AlexVKO Date: Mon, 18 Jan 2021 20:07:38 -0500 Subject: [PATCH 5/9] Update readme --- README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 49b1b65..d4e29ae 100644 --- a/README.md +++ b/README.md @@ -20,14 +20,14 @@ main [ ] sqlite3 # Test Branches - [x] rspec_failed + pg - [x] rspec_success + pg - [ ] rspec_failed + pg + [x] rspec_failed_pg + [x] rspec_success_pg + [ ] rspec_failed_pg - [ ] rspec_failed + pg + simplecov - [ ] rspec_success + pg + simplecov - [ ] rspec_failed + pg + simplecov + [ ] rspec_failed_pg_simplecov + [ ] rspec_success_pg_simplecov + [ ] rspec_failed_pg_simplecov - [ ] rspec_failed + pg + simplecov + rubocop - [ ] rspec_success + pg + simplecov + rubocop - [ ] rspec_failed + pg + simplecov + rubocop + [ ] rspec_failed_pg_simplecov_rubocop + [ ] rspec_success_pg_simplecov_rubocop + [ ] rspec_failed_pg_simplecov_rubocop From 2f99649fa5172f2a9d50f5c7e54a5add10fa7d35 Mon Sep 17 00:00:00 2001 From: AlexVKO Date: Mon, 18 Jan 2021 20:14:42 -0500 Subject: [PATCH 6/9] readme --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index d4e29ae..d01a5f4 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ # Base Branches main [x] rspec - [ ] failed - [ ] success - [ ] error + [x] failed + [x] success + [x] error [ ] rubocop [ ] failed @@ -14,7 +14,7 @@ main [ ] failed [ ] success - [ ] pg + [x] pg [ ] mysql [ ] mongo [ ] sqlite3 @@ -22,7 +22,7 @@ main # Test Branches [x] rspec_failed_pg [x] rspec_success_pg - [ ] rspec_failed_pg + [x] rspec_failed_pg [ ] rspec_failed_pg_simplecov [ ] rspec_success_pg_simplecov From 953e4e07899c8a28fc1dfe776ebf01ad2aea16df Mon Sep 17 00:00:00 2001 From: AlexVKO Date: Mon, 18 Jan 2021 20:20:56 -0500 Subject: [PATCH 7/9] Add rubocop --- Gemfile | 1 + Gemfile.lock | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/Gemfile b/Gemfile index d5d2e66..89fd948 100644 --- a/Gemfile +++ b/Gemfile @@ -35,6 +35,7 @@ gem 'webpacker', '~> 5.0' # Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks gem 'turbolinks', '~> 5' # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder +gem 'rubocop', require: false gem 'jbuilder', '~> 2.7' # Use Redis adapter to run Action Cable in production # gem 'redis', '~> 4.0' diff --git a/Gemfile.lock b/Gemfile.lock index 328c258..8a27702 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -62,6 +62,7 @@ GEM zeitwerk (~> 2.3) addressable (2.7.0) public_suffix (>= 2.0.2, < 5.0) + ast (2.4.1) bindex (0.8.1) bootsnap (1.5.1) msgpack (~> 1.0) @@ -104,6 +105,9 @@ GEM nio4r (2.5.4) nokogiri (1.11.1-x86_64-darwin) racc (~> 1.4) + parallel (1.20.1) + parser (3.0.0.0) + ast (~> 2.4.1) public_suffix (4.0.6) puma (5.1.1) nio4r (~> 2.0) @@ -141,12 +145,25 @@ GEM method_source rake (>= 0.8.7) thor (~> 1.0) + rainbow (3.0.0) rake (13.0.3) rb-fsevent (0.10.4) rb-inotify (0.10.1) ffi (~> 1.0) regexp_parser (1.8.2) rexml (3.2.4) + rubocop (1.8.1) + parallel (~> 1.10) + parser (>= 3.0.0.0) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 1.8, < 3.0) + rexml + rubocop-ast (>= 1.2.0, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 1.4.0, < 3.0) + rubocop-ast (1.4.0) + parser (>= 2.7.1.5) + ruby-progressbar (1.11.0) rubyzip (2.3.0) sass-rails (6.0.0) sassc-rails (~> 2.1, >= 2.1.1) @@ -178,6 +195,7 @@ GEM turbolinks-source (5.2.0) tzinfo (2.0.4) concurrent-ruby (~> 1.0) + unicode-display_width (2.0.0) web-console (4.1.0) actionview (>= 6.0.0) activemodel (>= 6.0.0) @@ -212,6 +230,7 @@ DEPENDENCIES rack-mini-profiler (~> 2.0) rails (~> 6.1.1) rexml + rubocop sass-rails (>= 6) selenium-webdriver spring From 05f0dd37ee463cd542c4afd5f99655fe61f3a725 Mon Sep 17 00:00:00 2001 From: AlexVKO Date: Mon, 18 Jan 2021 20:42:07 -0500 Subject: [PATCH 8/9] Add simplecov --- Gemfile | 2 +- Gemfile.lock | 12 ++++++++++-- spec/spec_helper.rb | 2 ++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 3a0a48e..e64aa88 100644 --- a/Gemfile +++ b/Gemfile @@ -2,7 +2,7 @@ source 'https://rubygems.org' git_source(:github) { |repo| "https://github.com/#{repo}.git" } ruby '3.0.0' - +gem 'simplecov', require: false, group: :test # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '~> 6.1.1' # Use sqlite3 as the database for Active Record diff --git a/Gemfile.lock b/Gemfile.lock index 0a70c08..0931bc5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -79,6 +79,7 @@ GEM concurrent-ruby (1.1.7) crass (1.0.6) diff-lcs (1.4.4) + docile (1.3.5) erubi (1.10.0) ffi (1.14.2) globalid (0.4.2) @@ -147,6 +148,7 @@ GEM rb-inotify (0.10.1) ffi (~> 1.0) regexp_parser (1.8.2) + rexml (3.2.4) rspec-core (3.10.1) rspec-support (~> 3.10.0) rspec-expectations (3.10.1) @@ -164,7 +166,6 @@ GEM rspec-mocks (~> 3.10) rspec-support (~> 3.10) rspec-support (3.10.1) - rexml (3.2.4) rubyzip (2.3.0) sass-rails (6.0.0) sassc-rails (~> 2.1, >= 2.1.1) @@ -180,6 +181,12 @@ GEM childprocess (>= 0.5, < 4.0) rubyzip (>= 1.2.2) semantic_range (2.3.1) + 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.2) spring (2.1.1) sprockets (4.0.2) concurrent-ruby (~> 1.0) @@ -229,10 +236,11 @@ DEPENDENCIES puma (~> 5.0) rack-mini-profiler (~> 2.0) rails (~> 6.1.1) - rspec-rails rexml + rspec-rails sass-rails (>= 6) selenium-webdriver + simplecov spring sqlite3 turbolinks (~> 5) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index ce33d66..8b10c8c 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,3 +1,5 @@ +require 'simplecov' +SimpleCov.start 'rails' # This file was generated by the `rails generate rspec:install` command. Conventionally, all # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. # The generated `.rspec` file contains `--require spec_helper` which will cause From df862e94f0981f453d70ce7cb3aaa459334a2c9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ale=20=E2=88=B4?= Date: Fri, 5 Feb 2021 09:10:07 -0500 Subject: [PATCH 9/9] Merge branch 'rubocop_failed' into rspec_passed_pg_simplecov_rubocop_failed --- Gemfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Gemfile b/Gemfile index 45b080c..6eb713f 100644 --- a/Gemfile +++ b/Gemfile @@ -7,6 +7,7 @@ gem 'simplecov', require: false, group: :test gem 'rails', '~> 6.1.1' # Use sqlite3 as the database for Active Record + # DBS # mysql gem 'pg'