Data dodania Pytanie
2016-12-31 09:12 How to use different parameter values in an RSpec mock/stub? »
My program downloads a zip file from the web then parses it. The relevant parsing-related code is: Zip::File.open("real_file.zip") do |zip_file| # ...
(1) odpowiedzi
2016-12-31 05:12 rails 5 rspec 3.5 stub_request regex where url params exists and does not exist »
I need to stub a request with 2 variations, and these are the example urls from Amazon... https://mws.amazonservices.jp/Orders/2013-09-01 ?AWSAcces...
(1) odpowiedzi
2016-12-30 16:12 How do I get RSpec and Cucumber tests to run in an app using both Mongoid and ActiveRecord? »
My team's project is a Rails 4.2 app using Mongoid 4. A new feature we are adding requires us to read data from a Postgres DB and use those records in...
(0) odpowiedzi
2016-12-30 09:12 Measure speed of RSpec tests »
Slow running tests are unwanted for obvious problems. But by default RSpec gives no indication about speed of individuals tests and gives only summary...
(1) odpowiedzi
2016-12-30 08:12 Writing a Rspec test for an error condition finished with exit »
I am writing a command line interface to a Ruby gem and I have this method exit_error, which acts as an exit error point to all validations performed ...
(1) odpowiedzi
2016-12-29 05:12 Rspec passes class method but fails instance method »
I'm trying to write a failing Rspec test. The actual test is associated with much longer code, but I narrowed down the problem to the class method it'...
(1) odpowiedzi
2016-12-28 18:12 Rails Validtions and error messages w/ Capybara »
I am using Capybara for TDD w/ RSpe. My code executes fine, however, I am confused about a concept regarding error messages and Capybara: In my spec ...
(1) odpowiedzi
2016-12-28 15:12 How to test a url which doesn't exist in Rspec? »
I want to validate that my url in my web application returns 404 Not found. I know it doesn't exist, but I need to confirm that via tests by Rspec. Ho...
(2) odpowiedzi
2016-12-28 02:12 Is Rspec controller test usually too long? »
My spec/controllers/decidings_controller_spec.rb is below. RSpec.describe DecidingsController, type: :controller do describe '#create' do befor...
(1) odpowiedzi
2016-12-27 14:12 Rspec and Capybara , what is the difference between visit and get »
My spec/controllers/undertakings_controller_spec.rb is below. RSpec.describe UndertakingsController, type: :controller do describe 'redirect wi...
(1) odpowiedzi
2016-12-27 01:12 Why be_persisted? doesn't perceive database changes? on rails »
Learning how to create foreign keys at the database, I had these two models: class Bar < ApplicationRecord has_many :foos end # and class Foo &l...
(1) odpowiedzi
2016-12-26 11:12 Rspec test error in devise session #create »
I implemented point system. User.point increases by 2 when he does login. My devise session controller is below. class Users::SessionsControlle...
(2) odpowiedzi
2016-12-24 20:12 Rails 5 - Factory Girl callbacks with attributes_for »
I'm with the following problem. How can I use the attributes_for of the Factory Girl to call a callback after it? My code: FactoryGirl.define do f...
(0) odpowiedzi
2016-12-24 05:12 Rails 5 Function testing (Rspec/Devise conflict?) NoMethodError: undefined method admin? for #<User »
I'm working through a Rails course trying to function test my app. I'm running into an issue that seems to indicate that Rspec isn't using the helper...
(1) odpowiedzi
2016-12-23 21:12 Rails 5 - Errors with FactoryGirl »
I'm with the following problem. I'm using Factory Girl Rails with variables like this: FactoryGirl.define do conta_destino_matriz = FactoryGirl.cr...
(1) odpowiedzi
2016-12-23 13:12 How to test pdf content generated by prawn-table »
pdf-inspector provides some useful methods for testing PDFs generated by Prawn. While testing strings is straightforward, I need a way to test that ta...
(0) odpowiedzi
2016-12-23 06:12 Is it possible to use a skeleton example as a pending in RSpec? »
I want to use a skeleton(empty) example as a pending. Normally, it is treated as succeeded(Green), but this occurs misunderstandings, like this. desc...
(1) odpowiedzi
2016-12-22 19:12 How to write RSpec test code for this code? »
I am learning RSpec testing. Now I want to write about given below code's rspec , but I can't. module FrontendHelper def scholarship_style_change(...
(2) odpowiedzi
2016-12-22 13:12 Can't test controller render due to ActiveRecord::StatementInvalid:error »
Ok, I have this controller code: def create @foo = Foo.new(user: User.new(user_params)) if @foo.save redirect_to foos_path else ...
(2) odpowiedzi
2016-12-22 04:12 How to use shoulda-matcher to test uniqueness of one foreign key scoped to the other? »
I know that this question exists, but the answers didn't help me. Working with the Participant Model, which belongs_to :game belongs_to :team The ...
(0) odpowiedzi
2016-12-21 17:12 Unable to get "true condition" on a found element in a select list and select it »
I'm using Watir 6 with Rspec and i'm having trouble accessing a select list and selecting one of the options. The URL is: https://www.fundingcircle....
(1) odpowiedzi
2016-12-21 16:12 RSpec - How to compound matchers raise_error and output.to_stdout? »
I've got a Thor based ruby CLI project to which I'm trying to add unit testing. It started as a pet project and is now rather large and important inte...
(0) odpowiedzi
2016-12-21 11:12 rspec doesn't run first test case »
The block #update doesn't run. Why? How to change it to run all of them. #anything works fine. describe UsersController, type: :controller do login...
(1) odpowiedzi
2016-12-20 21:12 Is there a method to get the current subdomain in Capybara/Selenium/Rspec? »
I'm testing Capybara and i need to know my current subdomain, for exemple if I'm in the url "http://mysubdomain.192.168.0.25.xip.io:3001/" i want to g...
(1) odpowiedzi
2016-12-20 17:12 How to get the reason (error) of TC failure on fly using Ruby + Rspec »
I am trying to do some specific logic in "after (:each)" declarations for failed TCs. How to catch the fact and the reason of TC failure using Ruby an...
(0) odpowiedzi
2016-12-20 12:12 Rails: how do I test a helper method that executes a mysql query »
I'm having a method in a helper, that determines whether a user has a specific flag (enabled), based on tags and a code, stored in a cookie. def user...
(1) odpowiedzi
2016-12-19 15:12 How to retrieve the value of RSpec::Expectations::ExpectationTarget: @target? »
I have a ruby method that returns a hash. My Rspec for this method looks like this: require "java" require "rubygems" require 'rspec' require 'spec_h...
(1) odpowiedzi
2016-12-19 12:12 ruby rspec in `block (2 levels) in <top (required)>' »
I have problems with error message ./spec/models/lib/parsers/s_reality_cz/matcher_spec.rb:12:in `block (2 levels) in ' in every rspec test. What I'm d...
(1) odpowiedzi
2016-12-19 08:12 Undefined method `belong_to' for RSpec, Rails »
I'm getting an error as follows when running rspec tests. Failure/Error: it { should belong_to :user } NoMethodError: undefined method `...
(1) odpowiedzi
2016-12-17 12:12 Testing interaction requests sequences »
There best practices is do not use @instance variables and use let(:object). But how to write test of call sequences where each step require previous ...
(1) odpowiedzi
2016-12-17 11:12 configuring controller tests with rails engines »
I'm trying to use the rails-controller-testing gem for an engine, but can't figure out how to change ::Rails::Controller::Testing constant not to get ...
(0) odpowiedzi
2016-12-17 09:12 Webmock Unregistered request blows up my test »
In my spec_helper, I have webmock setup like so: WebMock.disable_net_connect!(allow_localhost: true) RSpec.configure do |config| config.before(:ea...
(1) odpowiedzi
2016-12-16 15:12 Errors are shown when I am trying to run mobile automation TC using Appium + Capybara + Rspec + Ruby »
I am trying to adjust environment for mobile TC running using Appium + Capybara + Rspec + Ruby. I've created two files: 1) The first file is capybara...
(0) odpowiedzi
2016-12-16 14:12 Factory girl object with has many through and presence validation »
I have a model named Beats which consists of fields like name, status, group, owner. I am writing tests using R Spec and mocking using Factory Girl, I...
(0) odpowiedzi
2016-12-16 08:12 ActiveJob could not find record in `test` environment »
This issue only exists in test environment. Everything runs fine in development environment. I am facing a strange issue after recently upgrading to ...
(2) odpowiedzi