ActiveRecord Dependency on Ruby, Rails, Cucumber and RSpec

We are writing a Rails application that uses CouchDB as a data warehouse. We are BDD / TDD'ing with RSpec and Cucumber, which uses WebRat to test a web page.

I am trying to remove ActiveRecord as one of the resources loaded by the rails, but this causes the cucumber tests to fail. I deleted all the links that I can find (lights, environment files, etc.), but it still fails.

Has anyone seen this? The application is working fine, but the test is not working.

change

I deleted the framework in the env file, I also deleted all the code of the transactional device. We use the latest version of rspec and rspec-rails.

+3
source share
1 answer

The first blow to the problem. Actually I need a little more information, but ...

Assuming you did this in config / environment.rb:

  # Skip frameworks you're not going to use. To use Rails without a database
  # you must remove the Active Record framework.
  config.frameworks -= [ :active_record ]

and using rspec-rails 1.2.6, you will get an error, for example, uninitialized constant Spec::Matchers::Change::ActiveRecord which was raised on ticket # 810 . It was fixed for 1.2.7, which was released only two weeks ago.

If this is not your problem, can you post the errors you received, and possibly get more information about your test environment?

+1
source

Source: https://habr.com/ru/post/1712113/


All Articles