I’m using Rails 6 with RSpec 3.10. I have the following directory structure spec/models/my_object_spec.rb spec/models/module_name/product_spec.rb I run
I'm upgrading a large, commercial (proprietary) Rails 6 application to Rails 7. We never used Webpacker, and are instead going directly from bundled gems for th
For my user controller, while running the test cases I am facing render issue. It is redirecting to http://test.host/sign_in instead of rendering new. Controlle
I am having a problem while running bundle exec rspec spec/services/abc_service_spec.rb --format documentation The output of it, is not in the same order as th
I am trying to write some rspec tests and I want to mock a static method from a module. The setup is like this: module MyModule def self.my_method 'end' en
I'm unable to replicate this locally, but for some reason I am getting the following error when running tests in CircleCi: <Double Mylogger> was originall
I am trying to run my code and I get the following error: Failure/Error: Bookmark.new(id: res[0]['id'], title: res[0]['title'], url: res[0]['url']) IndexError:
I have a test that uses VCR like this: describe 'Do something with an api', feature: true, js: true, vcr: true do end I want to set this vcr recording to the op
I've been writing tests with instance_doubles to stand in for message chains when I need more granularity in the midst of the chain. But, I'm wondering if I'm d
I have a model that is used by multiple libs, each of these libs is using it with different approaches. For the moment I made a factory file, which contains mul
I have a "Copy Link" button in my frontend UI. When clicked, the URL inside an input box is copied to the user's clipboard with this JS: const copyTextarea = d
I am trying to get a good output for a custom matcher I wrote: RSpec::Matchers.define :scope_limited_to do |expected| match do |actual| @actual = actual.l
I want to test a specific namespace of rake tasks and I am getting an error from rubocop. desc 'This namespace is test' namespace :test_namespace do task tes
I have a method but doesn't have a parameter, for example def goodbye puts "" puts "Thank you, #{name} for using our service." puts "Good luck with
I'm trying this gem called FactoryBotRails. For some reason, when I try it on one of my models unit tests, the following error is thrown. Failure/Error: my_
I am updating an older app's Ruby and Rails versions and attempting to get all of the feature tests passing. Most of them were failing due to still relying on c
I am using rails 6.1.4 (Ubuntu 20.04) and am running tests with rspec, factorybot, and capybara. I also got database_cleaner where I'm using :truncation to star
I want to test controller's action and flash messages presence with rspec. action: def create user = Users::User.find_by_email(params[:email]) if user
I am facing a wired issue, factoryBot is creating a record in Db, but when capybara try to access it, there is no record in HTML. I tried debugging with "byebu
I'm using RSpec to test controller behavior in rails. One of the expectations I have is the following scenario: User attempts to access a protected (requires l