Data dodania Pytanie
2017-02-21 20:02 Using RSpec in Spacemacs with Spring »
When I try to run an RSpec test in Spacemacs, I get the following output: RSpec Compilation started at Tue Feb 21 14:14:30 spring rspec --options &l...
(0) odpowiedzi
2017-02-21 20:02 Devise Rspec expected the response to have a success status code (2xx) but it was 302 »
I have a user which I'm creating with FactoryGirl which needs to have a company in order to login successfully to my root_url. I'm not having any luc...
(1) odpowiedzi
2017-02-21 17:02 Devise Rspec undefined method `env' for nil:NilClass »
I've scoured SO and no one else's results seem to work for me: I have a ControllerHelper method for my Spec based off what was suggested for Devise: ...
(1) odpowiedzi
2017-02-20 19:02 rails test rspec capybara have_css no matches »
I am struggling with a simple test require "rails_helper" RSpec.feature "Home page", :type => :feature do scenario "When a user visit it" do v...
(1) odpowiedzi
2017-02-20 13:02 RSpec: Multiple asserts for a controller spec »
Let me explain the issue... I was testing a Rails controller with RSpec and I have one scenario with about 8 asserts.. I don't like to have an "it" ...
(1) odpowiedzi
2017-02-20 12:02 How to sign users in and out for testing with Rspec + Devise + FactoryGirl »
I'm new to Rspec, but I've managed to put together a working (at least in my tests so far) setup that lets me test various behavior in logged in/logge...
(1) odpowiedzi
2017-02-19 20:02 Feature test error - uninitialized constant FFaker::File »
This is my feature spec test for creating a new post require 'rails_helper' require 'ffaker' RSpec.feature 'Creating posts', :type => :feature do...
(1) odpowiedzi
2017-02-19 12:02 How to do request spec for JWT authenticate app using RSpec »
I have a Rails 5 API only app and using knock to do JWT authenticate. After complete the model and model spec, I start to do the request spec. But I...
(2) odpowiedzi
2017-02-19 05:02 Capybara throwing random Capybara::Poltergeist::DeadClient: errors »
When running feature tests that use Capybara together, either as running the whole suite or by just running 2 spec files together via rspec I'm gettin...
(0) odpowiedzi
2017-02-18 15:02 Rspec results are different when running one and all specs »
Here's the source code https://github.com/tenzan/eshop When I run a specific spec by rspec spec/features/application_controller_spec.rb, test passes....
(1) odpowiedzi
2017-02-18 14:02 rspec capybara tests only showing "data:," in chrome then failing with EOFError »
Our rspec feature specs that use capybara and chromedriver run fine locally on my mac or in my vagrant Ubuntu environment. Until recently they also wo...
(1) odpowiedzi
2017-02-18 07:02 trying to get feedback when debugging with ruby »
I am building a function to build an manipulate a linked list in ruby. right now I am working on the delete method and trying to include puts statemen...
(0) odpowiedzi
2017-02-17 18:02 Rspec: Using factories in other factories »
I'm writing a cost for a create method that will add a comment to a post. The comment belongs to a user and a post. And a post belongs to a user. Wh...
(1) odpowiedzi
2017-02-17 10:02 RSpec test fails with NoMethodError »
I have a model domain.rb class Domain < ActiveRecord::Base belongs_to :user has_many :ranks, dependent: :destroy validates_uniqueness_of :n...
(1) odpowiedzi
2017-02-17 06:02 How do I avoid test duplication? »
This code appears in two of my specs: it 'does not add the reply' do expect { subject }.not_to change { replies.length } end it 'does not publish ...
(1) odpowiedzi
2017-02-16 23:02 Ruby case equality operator is backwards for RSpec's expect »
I'm running a bunch of data-driven specs, and the expected data is in different classes (because I have to use Regexps sometimes, because the output s...
(2) odpowiedzi
2017-02-16 20:02 Rspec: Could not parse for environment rp_env »
I am new to rspec-puppet, and i am beginning with test writing: I wrote this code: describe 'rcjenkins' do let(:facts) do { :osfamily =&...
(1) odpowiedzi
2017-02-16 00:02 How do I use expect to test for less than »
Relish suggests the following... expect(actual).to be < expected However if I try... x.rand(10) expect(x).to be < 11 full spec Then(/...
(2) odpowiedzi
2017-02-15 16:02 How to validate regular expression (custom validator) using shoulda-matchers? »
I have a custom email validator (see below), class EmailValidator < ActiveModel::EachValidator def validate_each(record, attribute, value) u...
(0) odpowiedzi
2017-02-15 06:02 Having 2 foreign keys from one table in the same table rails »
I am trying to implement comment replying feature to my project, however i am not very sure with the method i m using. My basic idea is to keep all th...
(1) odpowiedzi
2017-02-15 02:02 Trying to remove a node from a linked list & not understanding the error message »
I am trying to build a program that will build and manipulate a doubly linked list in Ruby. So far I have been able to satisfy the test that tell me ...
(1) odpowiedzi
2017-02-14 18:02 Rspec check the template after a redirect »
Here is my create action for users: def create @user = User.new(user_params) if @user.save respond_to do |format| ...
(2) odpowiedzi
2017-02-14 16:02 Testing Materialized View in Rspec »
Using the Scenic gem I've built an activerecord model backed by a materialized view class MatviewSales < ActiveRecord::Base self.table_name = 'm...
(0) odpowiedzi
2017-02-14 00:02 Trying to add to the end of a linked list in ruby »
I am working on a homework assignment where I need to make a linked list in ruby. In particular at this juncture I am having a hard time setting a ne...
(1) odpowiedzi
2017-02-11 14:02 RSpec: Force error within negated custom matcher »
I have a custom matcher, that has an expect within: RSpec::Matchers.define :have_access_to do |action| match do |user| allow(controller).to rec...
(1) odpowiedzi
2017-02-11 14:02 ::Rails::Engine - No route found »
I'm using ruby 2.4 and rails 5. I'm trying to write my first gem and setup an engine to mount some basic controller logic. I have the following as...
(0) odpowiedzi
2017-02-10 21:02 Rails 3 to 4 migration uniqueness validation issues »
Context We are migrating from Rails 3.2.12 to 4.0.2 and Ruby 1.9.3 to 2.1.8. We have a lot of test coverage to accomplish the migration in the form ...
(0) odpowiedzi
2017-02-10 09:02 What is the best approach to test JSON API using RSpec request spec »
I find it troubling to test JSON API using RSpec request spec (see code below), because I have to create the required parameter every time (valid_attr...
(1) odpowiedzi
2017-02-10 03:02 How do I write an RSpec test that confirms Password Reset Token has been Saved to the DB? »
I'm writing a test for my Rails 5 API to confirm a password_reset_token is generated whenever a user requests a password reset. I have a short passw...
(1) odpowiedzi
2017-02-09 23:02 Use RSpec to test for DeserializationError »
I have a job that is enqueued. Sometimes, the record associated with that job is destroyed before the job is ran. To resolve any ActiveJob::Deseriali...
(0) odpowiedzi
2017-02-09 14:02 Http testing my ruby based API »
I'm trying to test my ruby API, but I m facing some difficulties to send the right data format. I can easily create a desired data format from rspec c...
(1) odpowiedzi
2017-02-09 11:02 Rails: How to write model spec for this method? »
I've just started to take on my first model spec task at work. After writing a lot of feature specs, I find it hard to get into the different perspect...
(1) odpowiedzi
2017-02-09 09:02 RSpec/Capybara does not commit to DB within test »
I'm quite desperate since moving our test suite from Minitest to RSpec. All the controller and model tests run fine so far, but since trying to port (...
(1) odpowiedzi
2017-02-08 23:02 Build up help for TDD/BDD with RSpec »
For about 2 weeks ago i've started learning Ruby, i've made an WebParser / Page WordCounter using 'open-uri' and 'nokogiri'. So i just run up the term...
(1) odpowiedzi
2017-02-08 17:02 RSpec cannot find route for nested resource »
I'm dealing with a seemingly strange issue while trying to run unit tests on a nested resources controller. Here's my setup: routes.rb: Rails.applic...
(1) odpowiedzi