Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Related errors below. == Test WrongScopeError Error: ``` Failures: 1) Posts API (Custom Controller) GET /posts returns a list of posts Failure/Error: raise WrongScopeError, "`#{name}` is not available from within an example (e.g. an " \ "`it` block) or from constructs that run in the scope of an " \ "example (e.g. `before`, `let`, etc). It is only available " \ "on an example group (e.g. a `describe` or `context` block)." `name` is not available from within an example (e.g. an `it` block) or from constructs that run in the scope of an example (e.g. `before`, `let`, etc). It is only available on an example group (e.g. a `describe` or `context` block). # /Users/alexkitchens/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/example_group.rb:742:in `method_missing' # /Users/alexkitchens/fun/journey/dependencies/rails/actionpack/lib/action_dispatch/testing/assertions/routing.rb:188:in `method_missing' # /Users/alexkitchens/fun/journey/dependencies/rails/actionpack/lib/action_dispatch/testing/integration.rb:422:in `method_missing' # /Users/alexkitchens/fun/journey/dependencies/rails/activerecord/lib/active_record/test_fixtures.rb:101:in `run_in_transaction?' # /Users/alexkitchens/fun/journey/dependencies/rails/activerecord/lib/active_record/test_fixtures.rb:115:in `setup_fixtures' # /Users/alexkitchens/fun/journey/dependencies/rails/activerecord/lib/active_record/test_fixtures.rb:8:in `before_setup' # /Users/alexkitchens/fun/journey/dependencies/rails/actionpack/lib/action_dispatch/testing/integration.rb:331:in `before_setup' # /Users/alexkitchens/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/rspec-rails-3.8.2/lib/rspec/rails/adapters.rb:126:in `block (2 levels) in <module:MinitestLifecycleAdapter>' # /Users/alexkitchens/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/example.rb:447:in `instance_exec' # /Users/alexkitchens/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/example.rb:447:in `instance_exec' # /Users/alexkitchens/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/rspec-core-3.8.0/lib/rspec/core/hooks.rb:373:in `execute_with' # # Showing full backtrace because every line was filtered out. # See docs for RSpec::Configuration#backtrace_exclusion_patterns and # RSpec::Configuration#backtrace_inclusion_patterns for more information. ``` Bisect led to d4367eb72601f6e5bba3206443e9d141e9753af8 Issue opened here: rails/rails#37783 Fix in Rspec Rails here: rspec/rspec-rails#2215 The fix is not in a full release yet, so I've pinned to the latest beta release. ``` commit d4367eb72601f6e5bba3206443e9d141e9753af8 Author: Edouard CHIN <[email protected]> Date: Thu Nov 21 18:39:54 2019 +0100 Modify ActiveRecord::TestFixtures to not rely on AS::TestCase: - ### Problem If one wants to use ActiveRecord::TestFixtures it is mandatory for the test suite to inherit from `ActiveSupport::TestCase`. TestFixtures makes use of specific method from AS::TestCase (`file_fixture_path` and `method_name`). ### Solution This PR fixes that by not making use of method_name and file_fixture_path. ``` == Time Issue Error: ``` Failure/Error: require File.expand_path('../../config/environment', __FILE__) NoMethodError: undefined method `hour' for 1:Integer Run options: include {:locations=>{"./spec/requests/api/posts_spec.rb"=>[10]}} ``` Bisect led to commit 12959dee0f19a8e050dd1236b031c2c690729905 Issue open at rails/rails#37391
- Loading branch information