Data dodania Pytanie
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
2017-02-08 13:02 RSpec strange behaviour: doesn't see controller action »
I have hierarchy of my Controllers Backend::ProductsController < Backend::ModelController < Backend::BackendController < ApplicationControll...
(0) odpowiedzi
2017-02-07 01:02 Adding wicked_pdf gem causes rspec view spec to fail with NoMethodError »
I've got a weird situation and I'm not sure how to even start debugging it. Would love any advice or direction that someone can provide. I've got 64...
(0) odpowiedzi
2017-02-07 01:02 Ruby dynamically assign numbered variables »
I cant find a similar question, but I'm sure it's out there somewhere so please point me in the direction if it is. I'm writing an rspec test and want...
(1) odpowiedzi
2017-02-06 22:02 Is there a reliable Command Line or Powershell step format to run RSpec tests on TeamCity? »
We are experimenting with using RSPec for our UI tests and noted that while attempting to integrate these with TeamCity we end up with environment rel...
(1) odpowiedzi
2017-02-06 12:02 Rspec model callback »
I have this model that my senior dev wrote: class Thing < ActiveRecord::Base after_commit on: :create do SomeMobule.some_method(self) end ...
(1) odpowiedzi
2017-02-06 10:02 How to unit test a class that depends heavily on other classes? »
My understanding is that unit testing should test classes in isolation, focusing on granular behavior and substituting objects of other classes usin...
(3) odpowiedzi
2017-02-05 06:02 Error in Installing RSpec in Rails application - Windows »
While I am trying to install RSpec in my rails application Included rails-rspec 3.5 in gem file While Executing rails generate rspec:install Gettin...
(0) odpowiedzi
2017-02-05 01:02 ruby rails simplecov test coverage not reporting on rake task spec »
I have been battling why simplecov is not reported this rake task as covered when my specs work correctly via pry tests. Can anyone point me in the r...
(1) odpowiedzi
2017-02-04 10:02 How do I pass variable from let to shared example? »
I have a test like this: describe 'event creation' do let(:user) { create :user } ... it_behaves_like 'also creates public_activity record', us...
(1) odpowiedzi