Skip to main content
Filter by
Sorted by
Tagged with
2 votes
1 answer
63 views

I have a Thor class that has a getter method defined like this: # Playgrounds CLI skeleton class. # Commands are added from commands folder class CLI < Thor def self.exit_on_failure? true ...
BadIdeaException's user avatar
1 vote
1 answer
87 views

Finished in 0.0137 seconds (files took 0.0769 seconds to load) 5 examples, 1 failure Failed examples: rspec ./spec/basic_math_spec.rb:10 # Basic-Math Subtract numbers Error: Process completed with ...
cluster1's user avatar
  • 6,128
1 vote
1 answer
64 views

I have several tables in my application which are associated with a user. In order to run my integration tests the application first needs to log in the test user. config.before(:each, :type => ...
JesseWelch92's user avatar
0 votes
1 answer
26 views

I've seen a lot of questions about errors concerning action_mailer.default_url_options and default_url_options[:host] during system tests. Below I share a good solution I found.
broiling-clamshell's user avatar
1 vote
0 answers
45 views

So i have a "Delete" link that brings up a html confirm modal. In my rspec system test though, it keeps erroring out with both errror messages Capybara::ModalNotFound and Selenium::WebDriver:...
ChasingTimmy's user avatar
0 votes
1 answer
46 views

I have a Rails controller I'm trying to write a new method for, and I'm running into an issue writing the tests for it. I've simplified the methods and tests repeatedly just trying to get something to ...
Dennis Christman's user avatar
1 vote
0 answers
98 views

I'm having an issue running my RSpec suite. The suite is "old," and everything worked fine until a few days ago when system specs started to fail without an apparent reason. All the failures ...
Sig's user avatar
  • 6,150
0 votes
1 answer
50 views

I have a Rails 6.1 controller that sets: # File: app/controllers/foo_controller.rb rescue_from Exception, with: :error_handler My Rspec 6.1 test (is a "request" type) is like: # File: spec/...
aarkerio's user avatar
  • 2,404
0 votes
1 answer
181 views

I have the following Ruby class I want to test: class Logger # ... def process X.process rescue StandardError => e ::Rails.logger.error('Progname') { 'Could not produce the audit log'...
Aymeric's user avatar
  • 906
1 vote
2 answers
96 views

I have this Rails 6.1 model: class BankAccount < ApplicationRecord belongs_to :donor before_validation -> { puts #AccAuth: #{account_authorization}" } validates :...
aarkerio's user avatar
  • 2,404
-1 votes
1 answer
93 views

Currently, we are using the stripe-ruby-mock gem in our application for testing Stripe APIs Integration, along with Stripe version '2015-04-07'. As we proceed with the Stripe upgrade and aim to ...
Pankaj Bagdare's user avatar
1 vote
0 answers
61 views

I just updated my app to rails 8 with the newest version of Devise and hotwire turbo. When running tests with Capybara/Rspec I'm seeing certain form submissions fail with a 500 error from inside of ...
dthegnome's user avatar
  • 133
1 vote
1 answer
132 views

I have an ActiveRecord table with a column called name. I need this field to be present and unique. So I have the following specs it { should validate_presence_of(:name) } it { should ...
mrateb's user avatar
  • 2,519
0 votes
1 answer
167 views

When running my tests in a Rails application, I see the following deprecation warning multiple times: DEPRECATION WARNING: Bolding log text with a positional boolean is deprecated and will be removed ...
Samuel Da Costa's user avatar
1 vote
1 answer
76 views

I have the following method: def clone(branch: nil, depth: nil) ... end For a particular test case, I want to test that the method is called without the branch argument. In Ruby 2.x the following ...
Sergio's user avatar
  • 271
0 votes
0 answers
87 views

Let's say there's a method report defined on ErrorReporter module. In my RSpec test suite I'd like to somehow globally stub this method so that test fails if it's not explicitly expected to receive ...
vetements's user avatar
-1 votes
2 answers
470 views

I am trying to install factory_bot_rails to use with rspec. I am working my way through Everyday Rails Testing with RSpec A practical approach to test-driven development, by Aaron Sumner, http://...
Jennifer James's user avatar
1 vote
0 answers
72 views

I'm working on a Rails API with GraphQL, and I'm having issues with testing a mutation using RSpec. When I use the /graphiql route and provide the required headers manually, everything works perfectly....
José Sávio's user avatar
0 votes
0 answers
51 views

I'm trying to write an RSpec system spec to test working functionality through a responsive web layout that could emulate how one would use things in a mobile. How do I get the window size to have a ...
boddhisattva's user avatar
  • 7,450
0 votes
1 answer
127 views

I'm using rails 6.1 with ruby 2.6.5 and I’m creating tests for an Active Admin new page, The best way I found to test this new page was by using the gems Capybara, Webdrivers, and Selenium-Webdrivers. ...
Rodrigo Almeida's user avatar
1 vote
0 answers
74 views

class Foo def fizz(user) puts user end end let(:user){create(:user)} it do expect(Foo).to receive(:fizz).with(user) end I run this test in RSpec of Rails app. Test fails with below ...
nrmn0006's user avatar
1 vote
0 answers
21 views

I'm running into trouble with my test. Here it is. It performs a number of inserts into a C database db. The problem is that my test doesn't seem to actually do the number of inserts. If I specify the ...
Eugene's user avatar
  • 11
1 vote
3 answers
103 views

When to_json is called on an object in Rails, the datetime objects are converted to the ISO 8601 standard automatically which is an excellent tool for sending data back to a client. [43] pry(main)> ...
Arslan Ali's user avatar
  • 17.9k
0 votes
1 answer
96 views

Ruby: 3.4.0-preview1 rspec: 3.13.0 .rspec --warning spec_helper.rb $LOAD_PATH.unshift File.expand_path('../lib', __dir__) require 'rspec/its' RSpec.configure do |config| config....
0lli.rocks's user avatar
  • 1,072
0 votes
1 answer
82 views

I have installed this gem to validate and test active storage: gem 'active_storage_validations' # Asset Model class Asset < ApplicationRecord has_one_attached :portrait validates( :...
Chiara Ani's user avatar
  • 1,135

1
2 3 4 5
366