Data dodania Pytanie
2017-03-06 16:03 Rspec capybara webkit cant find button tag »
I have the following test require "rails_helper" RSpec.feature "Menu", :type => :feature do let!(:articles) { create_list(:article, 10) } let...
(2) odpowiedzi
2017-03-06 01:03 Capybara/Poltergeist and Braintree testing »
I am running into errors testing my Braintree sandbox payments using Rspec, Capybara, and Poltergeist in a feature test. I have it set up to do exactl...
(1) odpowiedzi
2017-03-05 19:03 the right way to change the associated object in rspec »
I recently started to test with rspec, so I can strongly be mistaken, correct me if there is a better way I create two related models let(:user) {Fa...
(1) odpowiedzi
2017-03-04 14:03 Rspec: differences between {} and () in expect »
I want to use Rspec for testing if a request thrown RecordNotFound exception or not. I don't know what is the real differences between those two line ...
(0) odpowiedzi
2017-03-04 13:03 Selenium webdriver unable to find Mozilla geckodriver »
gem selenium-webdriver 3.2.2 FF 51.0.1 (64-bit) OS Ubuntu 16.04 I do not run tests, getting the error. Selenium::WebDriver::Error::WebDriverError:...
(0) odpowiedzi
2017-03-04 05:03 How to rspec test a Puppet class when a parameter needs a resource reference »
This may be a simple matter of mocking a resource, but... class myclass ( String stringParam, Integer intParam, File fileParam ) { # do some ...
(1) odpowiedzi
2017-03-03 12:03 RSpec testing a request that depends on a module method that returns a random number »
I have the following module in a Rails api: module SpeedCalculator def self.adjustment Random.rand(0..0.3) end def self.calculate_adjustm...
(1) odpowiedzi
2017-03-03 11:03 When testing a rake task, why does rspec receive this method twice when it is only called once? »
I'm attempting to test a rake task, and getting a very strange result. expected: 1 time with arguments: received: 2 times with arguments: The code...
(1) odpowiedzi
2017-03-03 10:03 Rails 5 + Rspec + API Testcase inside MODEL or Request »
Rails 5 + Rspec + API Testcase inside MODEL or Request Code: require "rails_helper" RSpec.describe "req", :type => :request do it "creates a ap...
(1) odpowiedzi
2017-03-02 13:03 Rspec test belongs_to with shoulda_matchers »
I have this code in my model. belongs_to :user, -> { includes :user_profile } I went through shoulda doc i did not found any way to test that pr...
(1) odpowiedzi
2017-03-02 10:03 Rails, RSpec: How to test, that a specific mailer action gets triggered »
I need to ensure that running an importer results in sending out an email. This is what I got so far: describe '#import' do it 'triggers the corre...
(2) odpowiedzi
2017-03-02 01:03 Database empty in new Thread / Process testing with Rspec + Factory Girl »
Following this blog post, http://blog.arkency.com/2015/09/testing-race-conditions/ I am trying to test concurrency. But in my specs, I am not able to...
(1) odpowiedzi
2017-03-01 17:03 RSpec Feature Test Active Record Not-Unique Error »
I want to thank you for your help in advance! I have just started to learn testing with RSpec, FactoryGirl & Capybara. My feature tests are failin...
(1) odpowiedzi
2017-03-01 15:03 RSpec --only-failures wrong output »
When I run RSpec it gives the following output: $ rspec .F Failures: 1) A cup of coffee with milk costs $1.25 Failure/Error: expect(coffee.price...
(2) odpowiedzi
2017-03-01 11:03 Cache a result set for a class method? »
I have a pretty db-intensive class method in one of my models: class Page < ApplicationRecord def self.collection_tree pages = [] walk_t...
(1) odpowiedzi
2017-03-01 05:03 Factory Girl: How to create record with has_one_through relationship? »
I have the following relationships as follows class LoanApplication < ActiveRecord::Base has_one :case_status, :dependent => :destroy has_...
(0) odpowiedzi
2017-02-28 22:02 Var is not accessible outside background block on feature test »
I'm having the following feature test RSpec.feature 'Show post', :type => :feature do background do post = create(:post) user = create(...
(1) odpowiedzi
2017-02-28 03:02 How to purposely delay an AJAX response while testing with Capybara? »
I have a React component that mimics the "link preview" feature that most modern social media sites have. You type in a link and it fetches the image,...
(1) odpowiedzi
2017-02-28 02:02 Count links on a page using RSpec »
Let's say I'm testing the action index of the controller StaticPages. On the controller tests, I need to count the number of links to about_path on th...
(2) odpowiedzi
2017-02-27 21:02 In Rspec, how to test that a Mailer raises an error? »
Given a simple Rails mailer that raises an exception, how do I write a rspec spec that confirms that the exception is raised? # status_mailer.rb .....
(1) odpowiedzi
2017-02-27 08:02 Conflicts with json (>= 1.7.7, ~> 1.7) (Gem::ConflictError) »
When I run cucumber Scenarios on my machine I got an error: "Unable to activate activesupport-4.2.6, because json-2.0.3 conflicts with json (>= 1....
(0) odpowiedzi
2017-02-27 05:02 Why is my rspec test sending a get request to javascripts/sessions.js? »
I have a very messy Rails app that I built some time ago that I am currently extending. This has involved a number of major changes to Ruby Version (1...
(1) odpowiedzi
2017-02-26 21:02 capybara not wait ajax request »
I get the following error in rspec + capybara + poltergeist: given!(:user_owner) { create(:user) } given!(:second_user) { create(:user) } given!(:que...
(1) odpowiedzi
2017-02-26 13:02 Rails not processing JSON params in get request »
When you post JSON as parameters, Rails normally does all the parsing for you if you specify Content-type: application/json in the header. Is this t...
(2) odpowiedzi
2017-02-26 01:02 Assert the return value of a method in Ruby (Chef Recipe) using Rspec »
I am very new to Rspec and was trying to test a Ruby script (Its a Chef recipe) with the following skeleton. def foo1 # do stuff list_of_names ...
(1) odpowiedzi
2017-02-25 15:02 Is it possible to fill_in a number field wo/ labels with Capybara? »
I have a number field, that takes a :product_quantity with a button after it saying "Add to Cart". My test works without adjusting the number_field bu...
(2) odpowiedzi
2017-02-24 20:02 JSON containing quotes is not parsed correctly by JSON.load in my spec test »
I have this RSpec code: require 'rails_helper' require 'integrations/youtube' RSpec.describe YoutubeIntegration do let(:empty_playlist) { <...
(2) odpowiedzi
2017-02-24 18:02 Testing JQuery Upload in Capybara: Files are not attaching »
I am currently building a rails app that uses the jquery-upload plugin to allows users to upload files to do things such as set their user avatar. If...
(1) odpowiedzi
2017-02-24 14:02 Test failing - one class method to call another ("expected: 1 time with arguments, received 0 times") »
My problem: I'm trying to stub a class method that returns an instance of that class, but I'm getting the following error for the test entitled "cre...
(1) odpowiedzi
2017-02-23 23:02 Error when writing RSpec Test Capybara::ElementNotFound: Unable to find field »
I am writing RSpec Tests for a view and getting the following error when trying to fill in a text field. 1) coordinators/new.html.erb populate page ...
(1) odpowiedzi
2017-02-23 16:02 Controller spec: expect(controller).to receive(:create) prevents the #create action from being executed »
I have the following action: def create binding.pry @finding.save respond_with @project, @finding end When running the following test... it ...
(1) odpowiedzi
2017-02-23 15:02 Serverspec doesn't check package version correctly »
I have a problem with serverspec. I'm trying to check installed package version on ubuntu. I use this code: describe 'java packages' do it 'packag...
(1) odpowiedzi
2017-02-22 17:02 FactoryGirl.create does not work while upgrading mongoid version from 5 to 6. Below is the issue I run into while running rspec test »
This is the place where is create a test table: factory :reward_scheme, class: RewardsModels::RewardScheme do uid { ExpectedData::COS...
(0) odpowiedzi
2017-02-22 12:02 Testing Conditions with validate_uniqueness_of »
Class Person: class Person < ActiveRecord::Base validates_uniqueness_of :user_name, scope: :account_id end For the Person Class, I ca...
(1) odpowiedzi
2017-02-22 01:02 Having trouble with specs for a Ruby mixin module »
I don't have a great experience with mixin modules. Then, please forgive me if my question seems to be a bit naïve. I am creating a few modules to i...
(2) odpowiedzi