Data dodania Pytanie
2018-01-16 21:01 RSpec Stubbing Java Static Method ArgumentError »
I am attempting to stub a Java static method in my specs for my JRuby class which imports some Java libraries. I get the following error for the metho...
(0) odpowiedzi
2018-01-16 20:01 Handling a method from outside of a mixin module in ruby and rspec »
I have a class that looks like this: module ReusableBitlyLinks def shorten_url url, *args ShortenedUrl.shorten_url_with_bitly( url, email.user ...
(2) odpowiedzi
2018-01-16 17:01 Invoke a function on a ruby module »
Here's my folder structure: root - app - helpers - application_helper.rb - test - helpers - application_helper_test.rb Here...
(1) odpowiedzi
2018-01-15 12:01 Unable to run tests against Safari 11 remotely (ssh, CI) »
I'm having troubles running Ruby/RSpec tests against Safari 11 when I'm trying to run tests via ssh manually or via Jenkins (where machine where Safar...
(1) odpowiedzi
2018-01-15 03:01 How to test Payola with RSpec and Factory_Bot? (User creation) »
I've been trying to build a factory for my user model all day, and I can't seem to get past the ActiveRecord::AssociationTypeMismatch when attempting ...
(1) odpowiedzi
2018-01-14 14:01 Students - Courses. How to allow to set days of class in initialize method of class Course? Method parameters. Ruby »
I am currently working on a Student - Courses program. Everything was going well until I found myself struggling to understand who to allow my initia...
(1) odpowiedzi
2018-01-14 05:01 Rails 5 Rspec set session variable »
I have a request test spec which tests a POST request. In my PaymentController (which handles the POST request), i have before_action :require_user...
(0) odpowiedzi
2018-01-14 03:01 Is there a way to simulate a failed POST request without passing params? »
I'd like to create a test where a POST request fails. My first thought was to either pass nil or an empty hash context 'when unsuccessfully created' ...
(0) odpowiedzi
2018-01-13 17:01 Ruby on Rails Coursera Class Bug in Tests »
I'm currently taking Coursera's free Ruby on Rails Introduction class. I'm working on the third assignment which contains creating a People class wher...
(2) odpowiedzi
2018-01-13 13:01 Ensure label belongs to its checkbox »
I have a checkbox and a label for it. Now I want to ensure that the checkbox belongs to its label, like checkbox1 -> label1. How to do it on capybara?...
(1) odpowiedzi
2018-01-13 01:01 Within block not executed inside match_unless_raises and custom matcher »
I was trying to extract some of my code into a custom matcher: matcher :have_nav_headers do |headers| match_unless_raises do |page| headers.e...
(1) odpowiedzi
2018-01-12 14:01 Sum of two idx equal to zero. Repeated Index »
I am writing the code for a method that returns the sum of its pair of indexes that added result in Zero. I have everything pretty much figured out bu...
(4) odpowiedzi
2018-01-12 08:01 Factory for database view in factory_girl »
I am using Rails 5.0.2 with factory_girl_rails and RSpec. I have 3 associative models like this: /app/models/ticket.rb class Ticket < ActiveReco...
(1) odpowiedzi
2018-01-12 06:01 Passing hash arguments from command line in Rspec »
Need something, which can be work as below to keep rspec DRY: rspec spec/features/users_spec.rb:12 -fd tab: 'Home' Using, ruby 1.9.3 rspec 2.6.4 R...
(1) odpowiedzi
2018-01-11 17:01 RSpec test controller action create not affect test database »
I have controller Categories which have action create: def create @category = Category.new(category_params) respond_to do |format| if @...
(1) odpowiedzi
2018-01-11 14:01 Rspec expect view file by name »
I would like to know if Rspec has any expect to check the render view file by name. This is my situation: I have a method with if and else conditions...
(1) odpowiedzi
2018-01-10 12:01 How do i check the valid association and the related model existence »
I am following this pattern it { is_expected.to respond_to(:cars) } for checking the association Now accidentally in the model, let's assume I have...
(2) odpowiedzi
2018-01-10 12:01 How to override class initialize method and use FactoryBot? »
I'm using FactoryBot with Rspec on rails. I have a SpecificKeyword ruby class where I extend the inittialize method: def initialize(args) super(a...
(1) odpowiedzi
2018-01-10 03:01 How do I set an _id value in FactoryBot that isn't a foreign key? »
I'm using FactoryBot (formerly FactoryGirl) to create some factory data for my tests. I have a model that looks like this via the schema (stripped dow...
(1) odpowiedzi
2018-01-09 16:01 RSpec FactoryBot.lint fails on a sequenced factory name »
Versions: Rails 5.2.0.beta2 ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-darwin17] rSpec 3.7.0 Database cleaner and FactoryBot.lint running ...
(1) odpowiedzi
2018-01-09 06:01 Disabled checkbox with Capybara »
How can I verify with Capybara that a checkbox is disabled? I have tried few options but nothing seems to work. Last attempt was expect(page).to hav...
(1) odpowiedzi
2018-01-09 05:01 RSpec, JavaScript event test do not match »
I am working on a rails project and i have a test like below slim file a href="#" title="メールアドレスのルール説明" id="my_balloon" ...
(0) odpowiedzi
2018-01-08 20:01 Using RSpec to loop through multiple spec groups »
I'm somewhat new to this so bear with. I'm trying to execute several groups of tests independently via RSpec::Core # Example spec_groups = [['spec',...
(0) odpowiedzi
2018-01-08 19:01 Queuing to avoid race condition »
The scenario I'm facing is as follows: Each user can click a button and enter a queue, called "waiting room". Once there are n users in this queue, t...
(0) odpowiedzi
2018-01-08 08:01 NameError: uninitialized constant ControllerName after adding routing namespace »
I'm using rspec-rails (3.7.1) with rails (5.1.4) All the tests run successfully, but after adding namespace to routes.rb file, I got this error: An ...
(1) odpowiedzi
2018-01-07 14:01 rspec webmock to_raise error not raising error »
I have the following code snippet and test class Service def self.status(base_uri = 'localhost', basic_auth = {}) base_uri = "#{ base_uri }/sta...
(1) odpowiedzi
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