Data dodania Pytanie
2017-07-15 22:07 RSpec Controller Destroy Testing »
I'm building a test application that lets user create/delete posts. I'm having a bug in my destroy action that I'm finding difficult to debug. Here's ...
(1) odpowiedzi
2017-07-14 23:07 Rspec test puts ( 2d array) »
I am new to Rspec and I want to create a rspec example for a method which prints a 2d array. Method which prints the array: def print_array arr...
(2) odpowiedzi
2017-07-14 18:07 Load file error on Rspec »
I'm following along with a tutorial on testing with Rspec. Getting a syntax error when trying to run the test. Here's my test code: require 'rails_he...
(2) odpowiedzi
2017-07-14 09:07 Using metaprogramming to write a single spec for multiple workers »
I have written a sidekiq worker spec. So right now we have four worker with almost the same spec. All spec will be testing for some_method and checkin...
(1) odpowiedzi
2017-07-13 22:07 Setting up Cucumber so it only passes or fails on rspec expectations (otherwise scenarios are pending) »
I want to distinguish between tests that make it to their assertion and tests that fail before the assertion and raise an error in the Given or When s...
(0) odpowiedzi
2017-07-13 17:07 RSpec not recognizing deleted association »
In my rails application, a user has many baskets, and a basket belongs to a user. The User class also contains an instance method that removes the use...
(1) odpowiedzi
2017-07-13 10:07 How to write a RSpec using httprb/http gem with timeout »
According to httprb/http gem's wiki, there is a way to enable per operation timeouts to handle Timeout like: HTTP.timeout(:per_operation, :write =&gt...
(1) odpowiedzi
2017-07-12 19:07 Confusion on Capybara "Matchers" »
So I usually see around 3-4 different examples when "asserting" text for instance. The capybara docs even mention more than 1 assert_text('foo') pa...
(1) odpowiedzi
2017-07-12 05:07 Capybara fill_in not entering all the text »
I'm using chromedriver 2.30 with capybara 2.14.4 under rspec 3.6.0 fill_in "total-amount", with: "33" expect(find_by_id("total-amount").value).to hav...
(1) odpowiedzi
2017-07-12 05:07 Can Nightwatch be used to test Rails? »
A contractor for our startup installed the Selenium-based Nightwatch testing framework, since our stack is React-heavy. But he told me that it could e...
(1) odpowiedzi
2017-07-12 05:07 rails factory rspec tests failing because of "only_integer" validation in model »
I have a factory for my model 'price' but all rspec tests start failing when I put the validation for price as only_integer. The error i get when i tr...
(1) odpowiedzi
2017-07-11 19:07 Rspec raise_error do not work with custom errors »
I have a custom error class ApiError: class ApiError < StandardError attr_reader :message, :code, :details, :raw_json def initialize(json) ...
(2) odpowiedzi
2017-07-11 18:07 How to validate presence of an array in Rails with Rspec? »
My specs work fine validating login and in that validation I have access to some_array but in the validation for some_array it fails because I don't h...
(1) odpowiedzi
2017-07-11 01:07 What does including the type in the describe block of a rspec do? »
I don't think the type part is necessary, what does it actually do? RSpec.describe Auction, :type => :model do ...
(1) odpowiedzi
2017-07-10 19:07 RSpec before blocks not being called before contexts or describes »
Given the following code: RSpec.configure do |config| config.before(:all) { puts 'before all' } config.before(:suite) { puts 'before suite'} co...
(1) odpowiedzi
2017-07-10 10:07 How do I get rspec to show me full failure traces »
When I run the following failing test with kitchen verify describe command ('cat example.txt') do its(:stdout) { should contain('param1 50') } ...
(1) odpowiedzi
2017-07-10 09:07 capybara could not find element without js:true »
Why capybara could not find element if i removed js:true(because it very slow) from my test my test require 'spec_helper' Capybara.register_driver :...
(1) odpowiedzi
2017-07-09 20:07 What is the `__identify__` route that Capybara looks for? »
When I disable Webmock or VCR I get the following error in my Rspec tests. Apparently it's looking for an /__identify__ route. WebMock::Net...
(1) odpowiedzi
2017-07-09 19:07 rspec test to submit json data »
I'm trying to make a test to submit JSON data to my API endpoint, however it's not working. After trying various suggestions from blogs and the rspec...
(2) odpowiedzi
2017-07-09 07:07 Rspec stub doesn't work when called inside of a before block »
I have a problem with rspec stubbing. I'm following this doc https://relishapp.com/rspec/rspec-mocks/docs/working-with-legacy-code/any-instance descr...
(1) odpowiedzi
2017-07-08 16:07 Working with mutable values in vcr »
I have a vcr casette like this --- http_interactions: - request: method: post uri: https://control.msg91.com/api/sendotp.php?message=Your%20o...
(1) odpowiedzi
2017-07-08 03:07 [Cucumber]RSpec::Expectations::ExpectationNotMetError »
I am writing some cucumber tests, when I run cucumber features/ all the scenarios pass, but when I run it on autograder, it fails with expected to fin...
(0) odpowiedzi
2017-07-07 21:07 Capybara test failing because element can not be found »
I am writing a RSpec Capybara test for a Rails 5 application. My application is for students learning how to write HTML and CSS. The application creat...
(1) odpowiedzi
2017-07-07 15:07 paralell_rspec with options --exclude-pattern »
Trying to exclude the specs in the /home dir during the parallel run. Tried a few things similar to the following: parallel_rspec myproj -n 4 -o '--...
(2) odpowiedzi
2017-07-07 02:07 Rspec testing No Route Matches ActionController::UrlGenerationError »
I'm trying to wrap my head about Rspec and Controller tests, more specifically a JSON request. In this case, I'm trying to hit the v1_devices_path ro...
(3) odpowiedzi
2017-07-06 21:07 Rails & RSpec: Testing CRUD actions with shared examples »
Testing RESTful actions of multiple Rails controllers with RSpec can generate a lot of code repetition. The following code is my first attempt at usin...
(2) odpowiedzi
2017-07-06 12:07 Webmock is returning nil in body »
I am trying to stub every request to a url and return a json response in the body. I have set up the following stub request, however the body always r...
(0) odpowiedzi
2017-07-06 08:07 Puffing Billy redirect not working with Webmock and Capybara Webkit »
I use an external site to handle my authentication. In my main controller, I do this by redirecting away to the external site which in turn redirects ...
(0) odpowiedzi
2017-07-05 20:07 Mocking an external SSO login in RSpec feature specs with Capybara Webkit »
My application redirects to an external party for Single-Sign On (SSO). Once logged in, that external party redirects that user back to my app's cal...
(1) odpowiedzi
2017-07-05 17:07 Show the complete description of an example »
In RSpec, how can we generate a string from an example, representing the current meta description of the current example? Example: RSpec.describe Ap...
(2) odpowiedzi
2017-07-05 16:07 Testing values of a JSON file with Rspec »
I'm using Packer to create AMIs with baked in services. I know I can test the end product using serverspec, but I have a number of naming and tagging ...
(1) odpowiedzi
2017-07-04 22:07 How to format rspec to show passing on default »
How do I format rspec permanently to show passing test text. Currently I have to type in : $ rspec spec --format documentation every time I run it. ...
(1) odpowiedzi
2017-07-04 16:07 Upon upgrade to chromdriver 2.30, error: cannot parse capability: chromeOptions/cannot parse mobileEmulation/'Apple iPhone 6' must be a valid device »
In our Capybara/Rspec suite written in Ruby, we use a special driver to test touch interactions and mobile screen sizes. This code works in Chromedri...
(2) odpowiedzi
2017-07-04 15:07 Spec looking for specific HTML tag does not work »
I'm working on a rails application and want to test using capybara, so far I had no problem but now that I'm implementing a markdown parsing feature I...
(1) odpowiedzi
2017-07-03 22:07 Upgrading Engine to Rails 5.1 is prepending the mounted path to path/url helpers in my specs »
I'm upgrading an engine to Rails 5.1 and having an issue with path helpers in my tests. The engine's mounted path is being prepended to path helpers. ...
(1) odpowiedzi