Data dodania Pytanie
2017-04-22 17:04 RSpec: How to test whether :new is called on a class double »
I'd like to test whether :new is called on a class when a certain line of code is run. I have the following: class TravelCard def check_in(station)...
(1) odpowiedzi
2017-04-22 15:04 RSpec: How to test init methods »
I want to test whether a certain method is called when I initialize a new instance of a class. In my project, I have the following code: class Jour...
(1) odpowiedzi
2017-04-22 05:04 RSpec how to test an argument data type passed to a method »
I need to test the passed argument type is an integer. Here is my test spec: require 'ball_spin' RSpec.describe BallSpin do describe '#create_ball...
(2) odpowiedzi
2017-04-21 22:04 Rspec nested controller test not passing params into my controller »
I'm having trouble passing my params into a nested route through rspec. I'm using Rails 5 and Rspec 3.5 My spec looks like this: require 'rails_hel...
(1) odpowiedzi
2017-04-21 18:04 Rspec: testing model class method »
I am trying to test the model class method. here's how model looks like class Abc class Dbc < ActiveRecord::Base self.table_name = 'vSomeVie...
(1) odpowiedzi
2017-04-21 12:04 How do I capture server-side errors on Capybara Feature JS Tests using a lazy loader? »
Versions: Rails 5.0.2 rspec 3.5.0 rspec-rails 3.5.1 capybara 2.12.1 (w/ chromedriver/selenium for JS tests) ruby 2.3.3 gitlab-ci Past (and desired...
(1) odpowiedzi
2017-04-20 22:04 Argument validation error in rspec »
I am working on a project which built on ROR framework. Suppose there are two /lib files 1. lib_file1 2. lib_file2 lib_file1 :- doing some task prede...
(0) odpowiedzi
2017-04-20 21:04 RSpec pending groups/tests results in non-zero exit status »
I have a set of rspec groups + examples, with a few groups and examples marked pending using the pending: 'Some notes about why' approach to marking t...
(0) odpowiedzi
2017-04-20 15:04 Simplecov- " # :nocov: " not ignored in coverage metrics »
I've wrapped my ApplicationMailer file inside a # :nocov: block because it's not yet implemented and I don't want it included in code coverage metrics...
(0) odpowiedzi
2017-04-19 20:04 rspec request test sign in without Devise »
I'd like to log in a user in my request test, but couldn't get it work. I'm not using Device. Here's my code spec/support/spec_test_helper.rb m...
(1) odpowiedzi
2017-04-19 12:04 Rspec test view renders another partial »
I have a view: pugin/elements/_list Inside this view it renders a different partial given that conditions are met. I'm looking to test that the view ...
(0) odpowiedzi
2017-04-19 04:04 Capybara InfiniteRedirectError »
I am getting the same behavior whether it's in the browser or running rspec... How can this issue get resolved? I have tried removing the before_fil...
(1) odpowiedzi
2017-04-18 20:04 How to allow HTTP requests to other docker containers with RSpec? »
I have a docker project with a few different moving parts, and I want one container to be able to call the API of another container. However, sending...
(0) odpowiedzi
2017-04-18 18:04 How to save a variable in an rspec expect? »
I have something along the following lines in one of my spec files: expect(my_instance).to receive(:my_function).with(arg: instance_of(String)) I w...
(1) odpowiedzi
2017-04-18 01:04 ActionController::UrlGenerationError with POST #create action in RSpec »
I'm writing an e-commerce site, and I'm running into a problem with one of my tests. My test for the create action looks like this: require 'rails_he...
(2) odpowiedzi
2017-04-17 21:04 Configure test double or allow messages. What's the difference in RSpec? »
I have an rspec test with an instance double like written like this: let(:ledger_instance) do instance_double( Workflow::Ledgers::Activ...
(0) odpowiedzi
2017-04-17 16:04 How to correctly use require? - ruby »
I have this small project I've been working on. In this project, I've been using the rspec to test the classes, so my project folder is structured li...
(1) odpowiedzi
2017-04-17 02:04 How to test message from CanCanCan in Rspec? »
I'm looking for way to test message from CanCanCan gem. def my authorize! :my_words, word, message: I18n.t("messages.login_to_add_new_word") end ...
(1) odpowiedzi
2017-04-16 22:04 ActiveRecord::UnknownAttributeError - a missing attribute in a User model »
I am new to Ruby on Rails, and I am coming across an UnknownAttributeError through my rspec tests. Where and how do you debug this issue? Thanks in ad...
(2) odpowiedzi
2017-04-16 19:04 CanCanCan, Doorkeeper and RSpec »
When I try to write tests in RSpec I get an error CanCan::AuthorizationNotPerformed: This action failed the check_authorization because it does no...
(1) odpowiedzi
2017-04-15 20:04 How to test Controller post :create of JSON api on rails using rspec? »
I have been tearing my hair trying to make the test to pass. I have a JSON API that looks like this: { "data": [ { "id": "b99f8173-0492-4...
(1) odpowiedzi
2017-04-14 19:04 undefined method test for MyModule »
I have following unit test. I am trying to test the exec method in MyModule::Base so i am trying to access it from another class method test. I am not...
(0) odpowiedzi
2017-04-14 16:04 cucumber Scenario Outlines: how to skip step for one scenario »
I have a strange situation where I have two examples. and I have this one step fill the mandatory fields of user form which i only need to execute fo...
(1) odpowiedzi
2017-04-14 15:04 Rspec request specs and Rails 5 »
I'm starting a new project, my first with Rails 5.1.0. I have a pb with my first request spec. describe 'Users', type: :request do it 'are created ...
(1) odpowiedzi
2017-04-14 14:04 how to call class method in rspec »
I have following class method module Abc class Def class << self include Ghi::Lmn def mymethod(*args) puts 'class metho...
(2) odpowiedzi
2017-04-14 09:04 Rails Rspec transaction fixture not working with multithread »
I'm trying to reproduce the racing condition problem with RSpec. I spent a day to searching around and so far I have: in my helper: def create_conc...
(0) odpowiedzi
2017-04-13 21:04 "TypeError: no implicit conversion of Symbol into Integer" In one controller test »
EDIT: I've rewritten the question to reflect some of the suggestions and changes made to the code while trying to solve this problem. I'm trying to w...
(0) odpowiedzi
2017-04-13 20:04 vcr output supressed in tests? »
I have upgraded to Rails 4.2, and with a failing api spec, what previously would have shown a VCR::Errors::UnhandledHTTPRequestError (with detailed in...
(0) odpowiedzi
2017-04-13 17:04 How to expect a message to be send to any instance of a class (twice total) with certain arguments in Rails? »
When refunding an order we need to deactivate the serials attached with that order. In the spec the order has two serials, ergo I must expect two call...
(2) odpowiedzi
2017-04-12 20:04 How can I stop Selenium-Webdriver from closing Firefox and throwing an error when it hits a certificate error with automation through Ruby/Rspec? »
Failure/Error: visit url Selenium::WebDriver::Error::UnknownError: I get the above error whenever visiting a URL that has an expired certificate, t...
(0) odpowiedzi
2017-04-12 19:04 Setting up TestCafe with Rails backend and fixtures data »
I'm currently working on a Rails project that uses RSpec as the testing framework. We have different Rails fixture data that helps us test our UI when...
(1) odpowiedzi
2017-04-12 13:04 RSpec making 1000 posts »
I'm trying to execute a button click 1000 times(simulating 1000 posts) in RSpec. I'm writing a report about the website and I need some sort of perfor...
(0) odpowiedzi
2017-04-11 20:04 Why am I getting ActionController::UrlGenerationError: "No route matches" in my controller spec? »
I have a controller spec looking like this: # config_controller_spec.rb require "spec_helper" describe Api::V4::ConfigController, type: :controller ...
(1) odpowiedzi
2017-04-11 14:04 Rails API Server RSpec test always returns empty JSON »
I have a problem with testing my Controllers. All tests are working fine, the Controllers are basic CRUD, but one #index action always returns an empt...
(1) odpowiedzi
2017-04-11 11:04 Specs pass when run alone, but fail when full suite is run »
I have some specs that pass when run individually. But when run as the whole suite (or as the whole spec file), only the first passes, while the other...
(1) odpowiedzi