Data dodania Pytanie
2017-01-11 23:01 Test production specific code with rspec - Sinatra »
I have this code to configure logging for production and test/development environments: class ApplicationController < Sinatra::Base configure :d...
(1) odpowiedzi
2017-01-11 17:01 How do you trigger the evaluation of a mail method using RSpec? »
class MyMailer < BaseMailer def send_login_prompt User.reset_login # ... end end describe MyMailer do context "when sending a login ...
(1) odpowiedzi
2017-01-11 05:01 How to test before_update callback in rails model with Rspec and FactoryGirl? »
I am trying to test the before_update callback of the model bellow. models/option.rb: class Option < ApplicationRecord belongs_to :activity ...
(3) odpowiedzi
2017-01-10 20:01 rspec rails nested_attributes on controller »
I am using Rspec to test a controller that received nested_attributes. A class Option can has_many Suboptions. models/suboption.rb: class Suboption ...
(0) odpowiedzi
2017-01-10 16:01 ActionView::Template::Error "Invalid CSS" thrown in feature spec only »
The following Sass works perfectly in development: main :not(table) img +box-shadow But when I run my specs, as soon as a JavaScript feature ...
(0) odpowiedzi
2017-01-10 13:01 Unable to create a model in Rspec via Post »
I'm trying to create a User in Rspec: require "rails_helper" RSpec.describe UsersController, type: :controller do describe "POST #index" do it...
(1) odpowiedzi
2017-01-09 23:01 BDD - Issue running with No UI »
I'm new to using cucumber and ruby for doing BDD unit tests and would like to get some help regarding an error that is occurring when try to run the t...
(0) odpowiedzi
2017-01-09 04:01 Rspec: controller spec login helper »
I am using rspec to test my controllers. The problem is that I need a login helper method every other controller tests will use in its before(:each) d...
(0) odpowiedzi
2017-01-08 03:01 RSpec/Capybara Selenium Safari issue »
The code below works with when running Chrome and Firefox. I am having issues with Safari using apple's new driver, however. Safari loads up, maximise...
(0) odpowiedzi
2017-01-07 16:01 Generating binary files with Sitespec fails when a Padrino Rack app »
I am working on a project with Sitespec, which is a static site generator using RSpec and uses any Rack app. I chose Padrino as a Rack app for Sitesp...
(0) odpowiedzi
2017-01-07 07:01 Unable to force a click of a hidden element with Capybara »
I have an intermittent failure in my capybara tests caused by a modal not closing quickly enough and so covering the button that is to be clicked. Th...
(2) odpowiedzi
2017-01-07 05:01 Testing that Devise is re-sending confirmation instructions email in a background worker »
I want to send Devise confirmation instructions to users a second time if they haven't confirmed within two days of signing up, however I can't seem t...
(0) odpowiedzi
2017-01-06 22:01 Mock Rails 4 application config custom value »
In Rails::Application, I add a custom configuration using... config.x.cache_config = config_for(:cache) In my tests, I want to see how code using t...
(1) odpowiedzi
2017-01-06 17:01 Why url heplers aren't working in tests? »
spec/rails_helper.rb ENV['RAILS_ENV'] ||= 'test' require File.expand_path('../../config/environment', __FILE__) abort("The Rails environment is runni...
(1) odpowiedzi
2017-01-06 15:01 How to raise ActiveResource ResourceInvalid exception? »
I want to raise an Active Resource exception manually from RSpec and I am trying to doing something like this- ActiveResource::ResourceInvalid.new(42...
(2) odpowiedzi
2017-01-05 17:01 How to read a file one line at a time, on function call »
I am reading a massive file of JSON objects like this: File.open('massive.json') do |file| file.lazy.each_slice(BATCH_SIZE) do |lines| lines.ea...
(0) odpowiedzi
2017-01-05 14:01 Run basic rspec file »
I'm new to Ruby and RSpec. I want to create very simple RSpec test: # test_spec.rb require 'spec_helper' describe TestController do puts(Time...
(2) odpowiedzi
2017-01-05 06:01 Why am I getting this error when I try to install RSpec? »
I have used RSpec before and this is the first time I get this error when I try to run: rails generate rspec:install It results in this error: /Us...
(2) odpowiedzi
2017-01-04 23:01 undefined method `provider' for nil:NilClass, RSpec, OmniAuth »
I'm trying to test an authenticated controller with RSpec and OmniAuth. I've followed the integration testing guide on their wiki. When I run the test...
(1) odpowiedzi
2017-01-04 21:01 Logging into application with RSpec »
I am trying to test a controller that has authenticated routes. I'm using OmniAuth with Google OAuth2.0. I followed this guide on the OmniAuth wiki to...
(1) odpowiedzi
2017-01-04 11:01 Rails and RSpec: Testing controllers with the same name in different namespace (module) »
I have rails 4.1.16 API application that is tested using RSpec 3.4.0, and I experience problems with testing classes called the same name in a differe...
(1) odpowiedzi
2017-01-03 14:01 Rspec error in registrations action of devise »
I implement point system. And when User creates , User has some points. My registrations_controller_spec.rb is below. require 'rails_helper'...
(1) odpowiedzi
2017-01-03 06:01 Rspec Error, create action in all models »
My spec/controllers/undertakings_controller_spec.rb is below. require 'rails_helper' RSpec.describe UndertakingsController, type: :controller...
(1) odpowiedzi
2017-01-03 03:01 Ruby Recursive Depth Search with Rspec »
I'm currently running into a problem understanding and implementing DFS with my current challenge. #find method is suppose to take a root and data (c...
(1) odpowiedzi
2017-01-02 21:01 How to correctly send query parameters in RSpec with wrap parameters on? »
I'm building a REST api with Rails 4.2.6. I recently discovered the use of wrap parameters, and set those to JSON, to simplify the requests that my cl...
(0) odpowiedzi
2017-01-02 20:01 Can't find server errors on failed rspec test, capybara seleniumwebdriver »
I'd like rspec to click a link on a modal, but when the modal opens in the test, it's blank. Where do I find errors on why it's blank? I've gone ...
(0) odpowiedzi
2017-01-02 20:01 Rails::Generator is not creating factory in spec folder »
I am trying to generate a new factory inside a module and I basically required require 'rails/generators' and I am calling the command below. Noti...
(1) odpowiedzi
2017-01-02 12:01 ActiveJob spec doesn't work with ActionController::Parameters »
My test: describe TasksCsvsController do describe '#index' do let(:params) { {'clients' => {'id' => ['1', '2', '3']}} } before do ...
(0) odpowiedzi
2017-01-01 20:01 rspec applicationcontroller unknownformat respond to js »
I'm new to web design, using rails 5, and otherwise the most current version of everything: link in a modal div <div class="col-md-1" id="action...
(0) odpowiedzi
2017-01-01 07:01 Is it possible indented and colored print like a description of example in RSpec? »
I want to stdout a message with indented and colored like a description of example in RSpec. But, I think there is no ways. My thoughts: Using prin...
(0) odpowiedzi
2016-12-31 11:12 Rspec error in session devise with point system »
I implemented point system. User.point increases by 2 when he does login. My devise session controller is below. class Users::SessionsController ...
(1) odpowiedzi
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