Data dodania Pytanie
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
2016-12-15 20:12 ExecJS failing with CoffeeScript not defined »
This has been killing me all day. I have a Rails app that I'm upgrading from 3.2 to 4.0.13 that works fine in development. In testing in Rails 4, I ge...
(1) odpowiedzi
2016-12-15 11:12 Poltergeist/PhantomJS crashing in Gitlab CI »
Background: My testing suite did not handle any JS functionality until recently. I started out only on my machine with a selenium-webdriver javascrip...
(1) odpowiedzi
2016-12-15 08:12 Rspec: How do I make my passing tests fail? »
I have a client object in a ruby gem that needs to work with a web service. I am testing to verify that it can be properly initialised and throws an e...
(2) odpowiedzi
2016-12-14 19:12 Factory Girl associations creates new factory model instead of associate to existing one »
error message: Failure/Error: let(:rubric_in_grenoble){ create(:rubric_in_grenoble) } ActiveRecord::RecordInvalid: Validation failed: N...
(1) odpowiedzi
2016-12-14 19:12 redirect_to :action => :index in Rspec »
I tried to google for the exact solution for my problem but didn't found any appropriate result, so I'm asking for the solution here. Here is the imp...
(1) odpowiedzi
2016-12-14 12:12 Rails FactoryGirl - Create specific factories in order to meet fk dependancies »
Factories are defined in multiple files under /factories/ or in the factories.rb file spec/factories/*.rb spec/factories.rb The model customer test...
(2) odpowiedzi
2016-12-14 09:12 rspec + capybara: expect(page) and page.within() cannot see loaded page? »
I'm using rspec 3.4.3 and capybara 2.7 in a feature-spec. when I run this test: visit course_path( @course ) expect(page).to have_content('short_t...
(0) odpowiedzi
2016-12-13 17:12 RSpec - how to rescue and retry the test? »
We have intermittently failing tests due to Net::ReadTimeout errors. We have yet to figure out a permanent fix. For right now we want to try rescuin...
(1) odpowiedzi
2016-12-13 16:12 RSpec - testing instance variables within a controller »
I have a new action which creates a circle and assigns the current parent as its administrator: def new return redirect_to(root_path) unless parent...
(2) odpowiedzi
2016-12-13 14:12 rspec , undefined method `id' for nil:NilClass »
feature "comment" do given(:user) do build(:user) end background do user1=create(:user) user1.id=1 login_as(user1) end scenario ...
(1) odpowiedzi
2016-12-12 23:12 Rails 5.0 rspec problems installing »
My Gemfile has the following: source 'https://rubygems.org' ruby '2.3.1' gem 'rails', '>= 5.0.0.rc2', '< 5.1' ... more gems group :developme...
(0) odpowiedzi
2016-12-12 02:12 capybaraWebKit is unable to visit webpages when running RSpec tests when :js => true »
On previous RSpec integration tests where :js => false (i.e., JavaScript was turned off), my tests were running just fine. However, for RSpec tests wh...
(1) odpowiedzi
2016-12-12 00:12 How to access an object's instance variables while stubbing? »
I'm writing some tests for a web application and one of the controllers calls resolve on a Scope object, which returns a slightly modified scope. In t...
(1) odpowiedzi
2016-12-11 09:12 Capybara resets devise session after each request »
Code example: login_as(user, scope: :user) visit user_edit_path #this is authorized # some expectations visit user_comments_path #this is not author...
(0) odpowiedzi
2016-12-09 22:12 Testing controller new action in Rspec »
I'm trying to test my controller's new actin with Rspec but getting the following error: Failure/Error: expect(assigns(:category)).to be_a_new(Catego...
(0) odpowiedzi
2016-12-09 19:12 Capybara holds only one authorized request, all others return 401 »
My problem is that capybara holds only one authorized request (doesn't matter was it authorization through the login form or through the helper login_...
(1) odpowiedzi
2016-12-09 16:12 How to test controller without hitting the database? »
I have a controller: class InvoicesController < ApplicationController def edit @invoice = Invoice.includes(:client, :document_status).find(p...
(1) odpowiedzi
2016-12-09 07:12 Working with date time string »
DESCRIPTION I need to get input as a string date that can be complete date-time format with timezone, it could be just date, it could be just time in...
(1) odpowiedzi
2016-12-08 21:12 Find all the tags in Rspec before running the tests »
I am using rspec(3.5) to run my tests and building a CLI with it. Currently considering rake. In my CLI, I would like it to be able to find all of the...
(1) odpowiedzi
2016-12-08 12:12 Proper way to test dynamic class methods in RSpec »
My code uses metaprogramming and has dynamic methods. I'm trying to figure out the best way to test them in RSpec3. Below is an example to be tested: ...
(0) odpowiedzi
2016-12-08 04:12 Capybara rspec script not executing in describe blocks »
I am new to Ruby in general. I am trying to learn capybara with selenium to do testing for our company website. My code was working before I put the...
(1) odpowiedzi
2016-12-07 22:12 RSpec tests failing with undefined method `validate_uniqueness_of' »
With Rails 5 and RSpec 3.5, I'm getting the following error. 1) User Failure/Error: it { should validate_uniqueness_of(:auth_token)} NoM...
(1) odpowiedzi
2016-12-07 20:12 "[Class_Name] must exist" rails 5 rspec testing associations »
In my rails application, I have Service, Request, and ServiceRequest models. The associations are such that servicerequests belong_to both Service a...
(1) odpowiedzi
2016-12-07 04:12 How to test that ActiveJob is enqueued? »
I have a create action that calls an ActiveJob if the record is successfully saved. def create @object = Object.new(importer_params) respond_to ...
(1) odpowiedzi
2016-12-07 01:12 I need help to write the rspec test in rails »
I have a items_controller.rb def get_serialized_copy_of_item @item= Item.find_by_id(params[:id]) if @item.nil? head :no_content ...
(2) odpowiedzi