Data dodania Pytanie
2017-09-28 16:09 Ruby Undefined method error - Using Beaker »
I'm quite new to all of this. I am trying to test out a puppet module using Beaker. I keep getting this: NoMethodError: undefined method `descri...
(0) odpowiedzi
2017-09-28 15:09 Rspec - uninitialized constant error User »
I have written tests on Rspec for my model User and get error while starting 'rspec spec' NameError: uninitialized constant User my test spec/models...
(0) odpowiedzi
2017-09-27 20:09 Rspec - NoMethodError: undefined method `cookies' for Object »
Try to add rspec tests to my App and have following error: NoMethodError: undefined method `cookies' for # Here is my simple code: get :my_ac...
(1) odpowiedzi
2017-09-27 15:09 Where is spec_helper.rb file located? »
I was trying to run the tests using rspec spec.rb But it is giving me following warning: Deprecation Warnings: Requiring `rspec/autorun` when runni...
(0) odpowiedzi
2017-09-27 12:09 Rspec expect(instance) to receive method not working as expected »
#controller file def update @payment = Payment.find_by(reference_id: params[:reference_id]) if @payment.update(update_params) @payment.do_some...
(2) odpowiedzi
2017-09-26 20:09 Passing local variable as parameter into RSpec shared_examples Always Nil »
I have a spec like this: shared_examples_for 'using the id' do |the_id| it 'should do something with the id' do # do something with the_i...
(1) odpowiedzi
2017-09-26 10:09 How to stub/mock without coupling the test to the code under test with rspec? »
Say there's a worker, whose job is to: find or create a record by a set of critaria; update an attribute of the record. Here's a sample implement...
(1) odpowiedzi
2017-09-26 06:09 Assigns usage in Rspec »
I'd like to ask why i'm always getting nil value when running rspec controller test ? I already read in this site and most of answers because plurals ...
(2) odpowiedzi
2017-09-25 19:09 Soft deletion with paranoia and factory girl »
When I call delete on records in rspec it seems they are permanently deleted. I assume this has something to do with factory girl. Is there a way to t...
(0) odpowiedzi
2017-09-25 12:09 How to ssh to docker image when ran via puppet beaker »
So I've written an Puppet Acceptance test using beaker with this Nodeset HOSTS: ubuntu-12-04: platform: ubuntu-12.04-x64 image: solarkenned...
(0) odpowiedzi
2017-09-24 14:09 Rails Factory Girl create a list with relation one to many »
I have this 2 factories: factory :video do name "Elixir 101 class" description "A class of elixir" descriptor "111111" user end sequence...
(2) odpowiedzi
2017-09-24 07:09 Rspec running test not showing on shell/bash and instead creating a weird lor file »
I have a car_project folder. Inside there are 2 more folders: lib folder with a car.rb file inside spec folder with the car_spec.rb spec_helper.rb ...
(0) odpowiedzi
2017-09-23 16:09 Access instance variable inside rspec around hook »
I have a pretty straightforward rspec hook question- Basically I'd like to do this: before { @stub = double(expires_at: 1.day.from_now) } describe ...
(0) odpowiedzi
2017-09-23 10:09 current_user is not get value during rspec request test? »
I want to get the current_user value in rspec tests but I am not getting I am creating the current user and during byebug I can see the the current_us...
(1) odpowiedzi
2017-09-22 21:09 Rspec - How to skip swagger/docs action in controller? »
I'm trying to run a test of RSpec, but an error message is displayed when I run rspec command in my directory An error occurred while loading ./spec/...
(0) odpowiedzi
2017-09-22 16:09 Rspec no route matches polymorphic »
I am trying to test my polymorphic comments create action but I always get no route matches error in rspec. class CommentsController < Application...
(1) odpowiedzi
2017-09-21 23:09 Rails & RSpec: test DB with preexisting records »
All my previous projects used DatabaseCleaner, so I'm used to starting with an empty DB and creating test data within each test with FactoryGirl. Cu...
(1) odpowiedzi
2017-09-21 13:09 RSpec has_many through #<ActiveRecord::Associations::CollectionProxy> »
I have a has many through relationship model like this: class Physician < ApplicationRecord has_many :appointments has_many :patients, through...
(1) odpowiedzi
2017-09-21 12:09 Can you use RSpec Matchers independently of Rspec Expectations? »
I'm interested in using RSpec and not throwing exceptions. I would rather get true or false. Do I just not use should or expect? Is this an officially...
(0) odpowiedzi
2017-09-20 10:09 Sending a real JSON post request from RSpec »
I would like to have an ability of testing a remote 3d party API for endpoint responses, which is why I would like to write a bunch of local rspec tes...
(1) odpowiedzi
2017-09-20 03:09 How to pass ID in delete :destroy in Rails? »
It is super simple, yet I can't figure out how to make the test pass. I have a friendships controller that I wanted to test (I am building Rails app...
(1) odpowiedzi
2017-09-20 01:09 Rails 5.1: Rspec can't see Capybara features »
I have some feature specs in my project that look roughly like this: # specs/features/canvas_integration.rb require 'spec_helper' feature 'Routes to...
(2) odpowiedzi
2017-09-19 22:09 What's the counterpart of rspecs instance_double in Minitest? »
I'm searching for the "minitest-way" to double expensive objects in a safe manner. I know mocks, stubs and use them, but the problem is that simple d...
(0) odpowiedzi
2017-09-19 20:09 Test if a method takes a block »
How can I verify if Foobar#some_method takes a block. Something simliar to Foobar.new.respond_to?(:some_method) class Foobar def some_method yi...
(1) odpowiedzi
2017-09-19 19:09 How to test adding friends (User model CREATE Friendship) in RSpec? »
I was watching Railscasts on how to add friends here. I built a User and Friendship model. User can add other Friends. Models: #user.rb has_man...
(1) odpowiedzi
2017-09-18 23:09 Rspec include_examples working but it_behaves_like not (with tags) »
I have a set of shared examples like this: shared_examples_for 'a shared behavior' do it 'should pass number 1', :tag1 do expect(1).to eq...
(1) odpowiedzi
2017-09-18 17:09 Adding add_index breaks 'times' iterator »
When I add this to my migration file, it breaks an rspec test: migration: add_index :SurveyResponses, [:ID, :QuestionID, :AnswerID, :LastEditedTimes...
(0) odpowiedzi
2017-09-18 08:09 Activerecord default method is behaving different in rails 4.2.9 from 4.1.9 "autosave_associated_records_for_#{reflection.name}" »
Steps to reproduce I was migrating my rails application from rails 4.1.9 to 4.2.9 .I have override the following method in my model def autosave_ass...
(0) odpowiedzi
2017-09-17 17:09 FactoryGirl ArgumentError: wrong number of arguments (given 1, expected 0) »
I'm running tests for a rails' controller and I'm finding some weird behavior. While in one of the rspec test file for another controller both methods...
(1) odpowiedzi
2017-09-17 15:09 rspec double arbitrary number of and_yields »
Mocking an each with a varying number of iterables. code: class Test def run(file) File.open(file).each do | line | puts line end ...
(0) odpowiedzi
2017-09-17 10:09 Rspec test if edit icon is visible on index page »
I have tried doing the following but test is not able to detect that the edit icon linking to the edit page is visible to the article owner on the ind...
(1) odpowiedzi
2017-09-16 19:09 Rspec follow friends test »
I am testing a feature where a user can follow another user. Friend request will be pending until other user accepts the friend request. I can't fig...
(0) odpowiedzi
2017-09-16 02:09 Rspec stub file valid? »
New to RoR / Rspec, created this method: def create @file = File.new(file_params) if @file.valid? #Model checks for :content_type => ['image...
(1) odpowiedzi
2017-09-15 20:09 Running Nested Tags in Rspec »
I'm trying to architect my tests in such a way so I can run certain context blocks by themselves, but also need to further enforce nested tags in indi...
(1) odpowiedzi
2017-09-15 16:09 RSpec equality matcher failing for serializer test »
I am writing a test for one of my Active Model Serializers to make sure that the JSON output is what I expect. However, I cannot figure out why RSpec ...
(3) odpowiedzi