Commit 06630132d2da58b3cb00c40a02de8b627c260d09
1 parent
bc21a74d
Exists in
colab
and in
4 other branches
rails_helper.rb or unit tests
Showing
41 changed files
with
163 additions
and
88 deletions
Show diff stats
.rspec
spec/controllers/base_metric_configurations_controller_spec.rb
spec/controllers/compound_metric_configurations_controller_spec.rb
spec/controllers/concerns/metric_configurations_concern_spec.rb
spec/controllers/concerns/ownership_authentication_spec.rb
spec/controllers/home_controller_spec.rb
spec/controllers/metric_configurations_controller_spec.rb
spec/controllers/mezuro_configurations_controller_spec.rb
spec/controllers/mezuro_ranges_controller_spec.rb
spec/controllers/modules_controller_spec.rb
spec/controllers/projects_controller_spec.rb
spec/controllers/reading_groups_controller_spec.rb
spec/controllers/readings_controller_spec.rb
spec/controllers/repositories_controller_spec.rb
spec/controllers/users_controller_spec.rb
spec/helpers/compound_metric_configurations_helper_spec.rb
spec/helpers/metric_configurations_helper_spec.rb
spec/helpers/mezuro_configurations_helper_spec.rb
spec/helpers/mezuro_ranges_helper_spec.rb
spec/helpers/processings_helper_spec.rb
spec/helpers/projects_helper_spec.rb
spec/helpers/reading_groups_helper_spec.rb
spec/helpers/repository_helper_spec.rb
spec/models/metric_configuration_spec.rb
spec/models/mezuro_configuration_ownership_spec.rb
spec/models/mezuro_configuration_spec.rb
spec/models/mezuro_range_spec.rb
spec/models/module_result_spec.rb
spec/models/processing_spec.rb
spec/models/project_ownership_spec.rb
spec/models/project_spec.rb
spec/models/reading_group_ownership_spec.rb
spec/models/reading_group_spec.rb
spec/models/reading_spec.rb
spec/models/repository_spec.rb
spec/models/user_spec.rb
spec/models/validators/beginning_uniqueness_validator_spec.rb
spec/models/validators/code_uniqueness_validator_spec.rb
spec/models/validators/kalibro_uniqueness_validator_spec.rb
... | ... | @@ -0,0 +1,67 @@ |
1 | +#Test coverage report | |
2 | +require 'simplecov' | |
3 | +require 'coveralls' | |
4 | + | |
5 | +SimpleCov.start do | |
6 | + formatter SimpleCov::Formatter::MultiFormatter[ | |
7 | + Coveralls::SimpleCov::Formatter, | |
8 | + SimpleCov::Formatter::HTMLFormatter | |
9 | + ] | |
10 | + coverage_dir 'coverage/rspec' | |
11 | + | |
12 | + add_group "Models", "app/models" | |
13 | + add_group "Controllers", "app/controllers" | |
14 | + add_group "Helpers", "app/helpers" | |
15 | + add_group "Mailers", "app/mailers" | |
16 | + | |
17 | + add_filter "/spec/" | |
18 | + add_filter "/features/" | |
19 | + add_filter "/config/" | |
20 | +end | |
21 | + | |
22 | +# This file is copied to spec/ when you run 'rails generate rspec:install' | |
23 | +ENV["RAILS_ENV"] ||= 'test' | |
24 | +require 'spec_helper' | |
25 | +require File.expand_path("../../config/environment", __FILE__) | |
26 | +require 'rspec/rails' | |
27 | + | |
28 | +# Requires supporting ruby files with custom matchers and macros, etc, in | |
29 | +# spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are | |
30 | +# run as spec files by default. This means that files in spec/support that end | |
31 | +# in _spec.rb will both be required and run as specs, causing the specs to be | |
32 | +# run twice. It is recommended that you do not name files matching this glob to | |
33 | +# end with _spec.rb. You can configure this pattern with with the --pattern | |
34 | +# option on the command line or in ~/.rspec, .rspec or `.rspec-local`. | |
35 | +Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f } | |
36 | + | |
37 | +# Checks for pending migrations before tests are run. | |
38 | +# If you are not using ActiveRecord, you can remove this line. | |
39 | +ActiveRecord::Migration.maintain_test_schema! | |
40 | + | |
41 | +RSpec.configure do |config| | |
42 | + # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures | |
43 | + config.fixture_path = "#{::Rails.root}/spec/fixtures" | |
44 | + | |
45 | + # If you're not using ActiveRecord, or you'd prefer not to run each of your | |
46 | + # examples within a transaction, remove the following line or assign false | |
47 | + # instead of true. | |
48 | + config.use_transactional_fixtures = true | |
49 | + | |
50 | + # RSpec Rails can automatically mix in different behaviours to your tests | |
51 | + # based on their file location, for example enabling you to call `get` and | |
52 | + # `post` in specs under `spec/controllers`. | |
53 | + # | |
54 | + # You can disable this behaviour by removing the line below, and instead | |
55 | + # explicitly tag your specs with their type, e.g.: | |
56 | + # | |
57 | + # RSpec.describe UsersController, :type => :controller do | |
58 | + # # ... | |
59 | + # end | |
60 | + # | |
61 | + # The different available types are documented in the features, such as in | |
62 | + # https://relishapp.com/rspec/rspec-rails/docs | |
63 | + config.infer_spec_type_from_file_location! | |
64 | + | |
65 | + # Devise helpers | |
66 | + config.include Devise::TestHelpers, :type => :controller | |
67 | +end | |
0 | 68 | \ No newline at end of file | ... | ... |
spec/spec_helper.rb
1 | -#Test coverage report | |
2 | -require 'simplecov' | |
3 | -require 'coveralls' | |
4 | - | |
5 | -SimpleCov.start do | |
6 | - formatter SimpleCov::Formatter::MultiFormatter[ | |
7 | - Coveralls::SimpleCov::Formatter, | |
8 | - SimpleCov::Formatter::HTMLFormatter | |
9 | - ] | |
10 | - coverage_dir 'coverage/rspec' | |
11 | - | |
12 | - add_group "Models", "app/models" | |
13 | - add_group "Controllers", "app/controllers" | |
14 | - add_group "Helpers", "app/helpers" | |
15 | - add_group "Mailers", "app/mailers" | |
16 | - | |
17 | - add_filter "/spec/" | |
18 | - add_filter "/features/" | |
19 | - add_filter "/config/" | |
20 | -end | |
21 | - | |
22 | -# This file is copied to spec/ when you run 'rails generate rspec:install' | |
23 | -ENV["RAILS_ENV"] ||= 'test' | |
24 | -require File.expand_path("../../config/environment", __FILE__) | |
25 | -require 'rspec/rails' | |
26 | -require 'rspec/autorun' | |
27 | - | |
28 | -# Requires supporting ruby files with custom matchers and macros, etc, | |
29 | -# in spec/support/ and its subdirectories. | |
30 | -Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f } | |
31 | - | |
1 | +# This file was generated by the `rails generate rspec:install` command. Conventionally, all | |
2 | +# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. | |
3 | +# The generated `.rspec` file contains `--require spec_helper` which will cause this | |
4 | +# file to always be loaded, without a need to explicitly require it in any files. | |
5 | +# | |
6 | +# Given that it is always loaded, you are encouraged to keep this file as | |
7 | +# light-weight as possible. Requiring heavyweight dependencies from this file | |
8 | +# will add to the boot time of your test suite on EVERY test run, even for an | |
9 | +# individual file that may not need all of that loaded. Instead, make a | |
10 | +# separate helper file that requires this one and then use it only in the specs | |
11 | +# that actually need it. | |
12 | +# | |
13 | +# The `.rspec` file also contains a few flags that are not defaults but that | |
14 | +# users commonly want. | |
15 | +# | |
16 | +# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration | |
32 | 17 | RSpec.configure do |config| |
33 | - # ## Mock Framework | |
34 | - # | |
35 | - # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line: | |
36 | - # | |
37 | - config.mock_with :mocha | |
38 | - # config.mock_with :flexmock | |
39 | - # config.mock_with :rr | |
18 | +# The settings below are suggested to provide a good initial experience | |
19 | +# with RSpec, but feel free to customize to your heart's content. | |
40 | 20 | |
41 | - # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures | |
42 | - config.fixture_path = "#{::Rails.root}/spec/fixtures" | |
21 | + # These two settings work together to allow you to limit a spec run | |
22 | + # to individual examples or groups you care about by tagging them with | |
23 | + # `:focus` metadata. When nothing is tagged with `:focus`, all examples | |
24 | + # get run. | |
25 | + config.filter_run :focus | |
26 | + config.run_all_when_everything_filtered = true | |
43 | 27 | |
44 | - # If you're not using ActiveRecord, or you'd prefer not to run each of your | |
45 | - # examples within a transaction, remove the following line or assign false | |
46 | - # instead of true. | |
47 | - config.use_transactional_fixtures = true | |
28 | + # Many RSpec users commonly either run the entire suite or an individual | |
29 | + # file, and it's useful to allow more verbose output when running an | |
30 | + # individual spec file. | |
31 | + if config.files_to_run.one? | |
32 | + # Use the documentation formatter for detailed output, | |
33 | + # unless a formatter has already been configured | |
34 | + # (e.g. via a command-line flag). | |
35 | + config.default_formatter = 'doc' | |
36 | + end | |
48 | 37 | |
49 | - # If true, the base class of anonymous controllers will be inferred | |
50 | - # automatically. This will be the default behavior in future versions of | |
51 | - # rspec-rails. | |
52 | - config.infer_base_class_for_anonymous_controllers = false | |
38 | + # Print the 10 slowest examples and example groups at the | |
39 | + # end of the spec run, to help surface which specs are running | |
40 | + # particularly slow. | |
41 | + config.profile_examples = 10 | |
53 | 42 | |
54 | 43 | # Run specs in random order to surface order dependencies. If you find an |
55 | 44 | # order dependency and want to debug it, you can fix the order by providing |
56 | 45 | # the seed, which is printed after each run. |
57 | 46 | # --seed 1234 |
58 | - config.order = "random" | |
47 | + config.order = :random | |
48 | + | |
49 | + # Seed global randomization in this process using the `--seed` CLI option. | |
50 | + # Setting this allows you to use `--seed` to deterministically reproduce | |
51 | + # test failures related to randomization by passing the same `--seed` value | |
52 | + # as the one that triggered the failure. | |
53 | + Kernel.srand config.seed | |
59 | 54 | |
60 | - config.include Devise::TestHelpers, :type => :controller | |
55 | + # rspec-expectations config goes here. You can use an alternate | |
56 | + # assertion/expectation library such as wrong or the stdlib/minitest | |
57 | + # assertions if you prefer. | |
58 | + config.expect_with :rspec do |expectations| | |
59 | + # Enable only the newer, non-monkey-patching expect syntax. | |
60 | + # For more details, see: | |
61 | + # - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax | |
62 | + expectations.syntax = :expect | |
63 | + end | |
64 | + | |
65 | + # rspec-mocks config goes here. You can use an alternate test double | |
66 | + # library (such as bogus or mocha) by changing the `mock_with` option here. | |
67 | + config.mock_with :mocha | |
61 | 68 | end | ... | ... |