Data dodania Pytanie
2018-01-07 11:01 Rails RSpec testing a node class »
I am trying to to write a test for a Node class which keeps failing, here is my class: class Node < ApplicationRecord belongs_to :parent, :c...
(1) odpowiedzi
2018-01-06 18:01 Bundle: Missing Digest for Metadata.gz »
i'm getting the following error when using bundler to install a the current rspec version. The gem rspec-core-3.7.1 can't be installed because the s...
(1) odpowiedzi
2018-01-06 17:01 Convert temperature Ruby »
I am a Ruby beginner currently working on learning how to work with RSpec. I am also working on a temperature converter and I have gotten it to pass t...
(2) odpowiedzi
2018-01-06 13:01 RSpec navigator in Atom »
How to deal with long RSpec files in Atom? Is there any good Ruby / RSpec navigation plugin? I've found the "Ruby navigator" plugin, but it hasn't bee...
(0) odpowiedzi
2018-01-05 20:01 Rails 4: PG::InFailedSqlTransaction when testing a rake task with RSpec »
I am currently trying to test a rake task with RSpec. My Rails version is 4.2.4 and rspec-rails version is 3.3.2. I've have the following in rails_he...
(1) odpowiedzi
2018-01-05 18:01 problems for Category Policy Spec with pundit gem »
so I do the association of the categories and posts through categorizations. And i'm trying to restrict the access with pundit gem and testing with RS...
(1) odpowiedzi
2018-01-05 17:01 Reload a model itself during test »
I use mongoid and I have an ContactField model and an Contact model. In my Contact model, I do: Admin::ContactField.all.each do |field| field field.f...
(0) odpowiedzi
2018-01-04 12:01 Rspec and environment configuration file »
How can I force Rspec to get config from config/settings/test.yml ? I use gem "config" Inside Rspec folder i have rails_helper.rb file with: ENV['R...
(0) odpowiedzi
2018-01-03 21:01 Issue with spies in Rspec »
Having trouble figuring out why: it "shifts/unshifts without O(n) copying" do arr = RingBuffer.new allow(arr.send(:store)).to receive(:[]=).and_...
(1) odpowiedzi
2018-01-03 06:01 How to setup RSpec to test features last and only if all other tests pass »
Like a lot of non-greenfeild projects, I arrived at my new job to find that most tests are performed using feature specs and not controller/model spec...
(1) odpowiedzi
2018-01-03 00:01 Bundler can't find rspec executable »
When I try to run my tests in my Rails 5.1 app, I'm getting an error that the executable can't be found: $ bundle exec rspec bundler: failed to load ...
(1) odpowiedzi
2018-01-02 23:01 Getting uninitialized constant Faker::String when attempting to set up rspec test in Rails »
I have a UrlContent model and I am trying to write an rspec test for an API call to the index page for Json. However, whenever I run rspec, it gives m...
(2) odpowiedzi
2018-01-02 00:01 Testing Sinatra API endpoint with RSpec »
I have a simple Sinatra with an endpoint "/status" which returns a JSON that looks like this: curl http://localhost {"stats":{"hostname":"Home","cpu...
(1) odpowiedzi
2018-01-01 17:01 rspec-sidekiq have_enqueued_sidekiq_job undefined method at »
expect(MyWorker).to have_enqueued_sidekiq_job().at(Time.now) causing me to get this error undefined method at for #RSpec::Matchers::BuiltIn::Has:0x...
(1) odpowiedzi
2017-12-31 00:12 Rails Controller Spec can't find route »
When I access my page (controller action) from a browser, the page renders fine. When I try to access the page from the controller specs, it fails. ...
(2) odpowiedzi
2017-12-30 07:12 How to add auth token to each http RSpec test header »
I'm having trouble trying to authenticate a request spec. How would I pass a valid auth token in the header of each http request? Is my approach below...
(1) odpowiedzi
2017-12-29 19:12 Can I detect if an element (button) is "clickable" in my rspecs? »
Context: In my rspec (using Ruby and Capybara) I click on a link to test an action in my app: adding a branch to my app. A modal window opens, where...
(1) odpowiedzi
2017-12-29 05:12 Capybara Webkit doesn't seem to submit the form quickly enough »
I'm using Capybara to test a basic form - when the user fills it out and submits it should create a new User record it "creates a new user" do visi...
(1) odpowiedzi
2017-12-29 03:12 mail_form gem rspec "undefined method `email' for" »
how can I write a test mail_form gem? Вut the test gives an error. How to associate a OrderForm and MailForm? I have : model: class OrderForm < M...
(1) odpowiedzi
2017-12-28 09:12 Shoulda matchers - delegate_method not working »
I have a simple delegator class class Service::Fs::Account < DelegateClass(Bank::Account) extend SingleForwardable def initialize(args={}) ...
(1) odpowiedzi
2017-12-27 06:12 How to avoid using the expect_any_instance_of hammer? »
I've got a few tests like this: it 'should invite user again' do admin_user = create(:invited_admin_user) expect_any_instance_of(AdminUser).t...
(2) odpowiedzi
2017-12-27 00:12 why is rspec running different numbers of tests? »
I realize this is a very broad question but I've seen our tests run 800 or 1,500 individual tests and pass both times. What could be causing rspec to ...
(1) odpowiedzi
2017-12-26 16:12 Is there a way to know why factory bot was unable to save record? »
Is there a way to know why a factory failed to save a record? I try to create a record with factory bot and I get an error message: ActiveRecord::Re...
(1) odpowiedzi
2017-12-26 12:12 Unable to pass the following rspec »
class Admins::Setting < ActiveRecord::Base serialize :config scope :default_ip, -> () { where(title: 'default-route-ip'.freeze).first } ...
(1) odpowiedzi
2017-12-25 00:12 how to embed a screenshot in html report for every scene that passes in rspec »
When I do the automated tests the capybara generates an html with the report of the tests that passed or nao.com the cucumber of the to embed the phot...
(0) odpowiedzi
2017-12-24 16:12 Rspec failure - make user name case sensitive »
first question for me here. I am a new Ruby/Rails developer and I set up some rails tests for creating a user ie name, email, password, and a passwor...
(0) odpowiedzi
2017-12-24 03:12 undefined instance method for Factory Girl class when using spring prelaoder »
I have a class defined inside my Factory girl definition as follows factory :user, class: User do trait :successful do after(:build) do |u| u....
(0) odpowiedzi
2017-12-24 00:12 Rails Cucumber Testing AJAX using Capybara »
I am using Rspec, Capybara, and Cucumber to test a feature of my site. Essentially, I have a fashion e-commerce site. I have the shop page which displ...
(2) odpowiedzi
2017-12-22 21:12 Rails Rspec/Factory Bot isn't invoking model before_save callbacks »
I have a user model with a number of before_save callbacks - for example, one that strips leading and trailing whitespace: app/models/user.rb: def s...
(1) odpowiedzi
2017-12-22 20:12 Using RSpec to test an action class that instantiates a service class »
I'm using an action/service based architecture where a service class hosts HTTP calls and action classes sanitize/package data and call the service cl...
(0) odpowiedzi
2017-12-22 13:12 How to stub in RSpec? »
I can't figure out why stub can't create in this source. I'm trying to test the logic inside if statement. if user.nil? || company.nil? is the conditi...
(1) odpowiedzi
2017-12-21 10:12 How to overwrite ruby method's local variable while writing rspec test cases? »
Existing Ruby Code: def book_details book_count = Book.count while (book_count > 1) # Do something end end I want to write rspec test ...
(3) odpowiedzi
2017-12-21 01:12 Before validation method breaking spec with 'undefined method downcase' »
In my User model I have a before_validation method called normalize_params that uses downcase. class User < ApplicationRecord before_validation ...
(2) odpowiedzi
2017-12-20 23:12 In RSpec, how to test with an instance variable in the initialize method? »
I have a class with the following initialized method to cache all users from the database: class Student < People def initialize super ...
(0) odpowiedzi
2017-12-20 21:12 Failure/Error: Post#create testing with Rspec »
I'm new to Rspec and testing in general I have this code in stores_controller_spec.rb file require 'rails_helper' RSpec.describe StoresController, t...
(1) odpowiedzi