Data dodania Pytanie
2017-06-16 23:06 How to check block is called using rspec »
I want to check whether the block is called in my function using rspec. Below is my code: class SP def speak(options={},&block) puts "speak...
(2) odpowiedzi
2017-06-16 22:06 Rails RSpec, DRY specs: shared example vs. helper method vs. custom matcher »
I have the following test repeated once for each HTTP method/controller action combination within a controller spec: it "requires authentication" do ...
(2) odpowiedzi
2017-06-16 19:06 Pass a ruby &block using rspec »
I want to test the functionality of the method using rspec that receives anonymous block and not raise error. Below is my code: class SP def speak(...
(1) odpowiedzi
2017-06-15 20:06 I need a solution for clean the attachment files uploaded when I test with RSpec »
Hello guys I'm using RSpec for testing and I have some test for upload files using factories. I set up the database cleaner but, when I do a tree on ...
(1) odpowiedzi
2017-06-15 19:06 Delete a Docker image from inside an RSpec script »
TL;DR: I can't delete my Docker image from inside my RSpec script, because RSpec still has a dependent container I'm using RSpec to test my Dockerf...
(0) odpowiedzi
2017-06-15 17:06 RSpec feature specs can't find routes for Rails Engine »
I'm developing a Rails Engine using rails v5.1.0 and rspec-rails 3.5.2. I have a simple feature spec: require "rails_helper" module MyEngineName ...
(1) odpowiedzi
2017-06-14 11:06 Ruby on rails, Validation failed: Countries can't be blank »
it "renders index page" do projects_user = FactoryGirl.create(:projects_user) get :index, id: projects_user.id expect(response).to render_templa...
(1) odpowiedzi
2017-06-14 09:06 rspec - uninitialized constant Rails (NameError) - a new case »
Off course I read this: rspec testing throws Uninitialized constant Rails (NameError) But I am sure that there is nothing wrong with my code. Just ...
(0) odpowiedzi
2017-06-14 09:06 Testfirst.org - Learn ruby course - Rspec issue unresolved »
I would like to do the testfirst.org exercises although can't seem to get to the starting line due to a version issue/lack of knowledge on my part as ...
(1) odpowiedzi
2017-06-13 18:06 RSpec test for update within another action »
I am building an application in Rails 5 that sends user inputs back to a controller called "TestsController." If the params[:answer] matches the "corr...
(2) odpowiedzi
2017-06-13 17:06 `expect_any_instance_of` equivalent for PHPUnit »
I am a rails programmer exploring PHP and PHPUnit. I've been struggling a bit with switching over from RSpec to PHPUnit. More specifically RSpec has...
(1) odpowiedzi
2017-06-13 09:06 Best Practices for RSpec expect raise_error »
I have some code for RSpec. My (or not my) Class can (or not) call specific exception. Ex, Class::Foo::Bar::TimeOutError. I want check it. describe :...
(0) odpowiedzi
2017-06-12 18:06 Why am I getting error "#let or #subject called without a block"? »
I wonder how to pass code to shared examples. I have these specs (snipped) let(:property) { subject.send(type) } context 'when one or both depe...
(0) odpowiedzi
2017-06-12 16:06 RSpec working on Mac but not Windows »
I'm trying to run a very simple RSpec script on Windows, however whenever I use the command rspec <filename>.rb the command prompt just prints a...
(0) odpowiedzi
2017-06-12 08:06 How do I get the whole error backtrace for rspec? »
Currently I am using parallel tests rspec allure 0.8.0 After I run the tests I get the following error: RSpec::Core::MultipleExceptionError I n...
(1) odpowiedzi
2017-06-11 18:06 Receiving error when working with selenium-webdriver. Unable to find mozilla geckodriver »
I am following a tutorial on how to use RSpec with Ruby. We are learning how to work with webdriver, however I am receiving an error when I try to run...
(1) odpowiedzi
2017-06-10 17:06 RSpec Issue with have_css »
I'm using Rails 5.1.1, RSpec 3.5.0 & Capybara 2.7.1. I want to have a test that checks for a navbar on the home page, according to some documents...
(1) odpowiedzi
2017-06-10 17:06 Testing actions wrapped in transaction with rspec »
I am using the hanami framework and the rspec lib to test my code and PG database. When I trying to test one action I get following error: PG::InFail...
(0) odpowiedzi
2017-06-09 07:06 WebMock stub data from Aws CognitoIdentityProvider »
I have the following module in a Rails controller concern: module AwsAuth extend ActiveSupport::Concern require 'aws-sdk' def get_cognito_use...
(1) odpowiedzi
2017-06-08 22:06 Devise confirmable not sending email on test on Rails 5.1 »
ActionMailer::Base.deliveries is an empty array on test env with rspec, so emails are not being sent. visit root_url(subdomain: false) fill_in "claim...
(0) odpowiedzi
2017-06-08 13:06 Is this failing radio button feature test a Capybara syntax issue? »
I have a form with a radio button for a boolean attr prev_cover, displays Yes or No in browser with param values of true or false and saved in db as t...
(2) odpowiedzi
2017-06-08 01:06 Accurately measuring rspec/capybara testing time? »
I'm trying to speed up tests and so far have done things like remove unnecessary database writes (using new instead of create and not using factorygir...
(1) odpowiedzi
2017-06-07 19:06 Rails testing: ensure authorization (Pundit) is enforced in all controllers and actions »
I'm writing RSpec tests for a Rails 4.2 application which uses Pundit for authorization. I'd like to test whether authorization is enforced in all ac...
(2) odpowiedzi
2017-06-07 17:06 FactoryGirl build has_many through associations »
Is it possible to build associations that have a has_many through association in ActiveRecord? Example: I have a user that has team_memberships asso...
(0) odpowiedzi
2017-06-07 12:06 Make Rake task testable with FactoryGirl user »
I have been trying to test a rake task with RSPEC. So far my understanding of the problem is that DB transactions are creating different contexts for ...
(0) odpowiedzi
2017-06-05 22:06 How to convert database calls with mocks/doubles, in Rails and Rspec? »
I am working on a reminder scheduler and used rails scaffold to create the models and views for the reminder. So far I have the controller looks like ...
(0) odpowiedzi
2017-06-05 20:06 ruby module NameError: uninitialized constant error »
I am trying to create a gem, but when trying to load a module in test I get the following error. I used "Configurable Ruby gems: Custom error messages...
(1) odpowiedzi
2017-06-05 19:06 Rspec: execute code in let and return value »
I have a following code for assigning value to variable before execute test: let!(:cash_payment){ cash_payment = PaymentMethod.find_by_id(1) ...
(2) odpowiedzi
2017-06-04 13:06 Capybara can't find a file to attach in an RSpec/Rails test »
I'm using Capybara/RSpec to write a feature test in a Rails 5 app to check the uploading of images on my site. I am getting this error: 1) Photos ...
(1) odpowiedzi
2017-06-04 13:06 Trying to understand why validates_presence_of test fails »
I'm just starting to have a play with Rails (using Rspec and Shoulda Matchers) to build a demo blog. I've literally just started and my first test is...
(1) odpowiedzi
2017-06-04 10:06 ActiveRecord::InvalidForeignKey: Cannot save a valid record »
I am trying to test a model, following details: Factory Girl FactoryGirl.define do factory :admin_selling_config_price, class: 'Admin::Selling::Co...
(0) odpowiedzi
2017-06-03 11:06 Rspec - How can I stub a constant that is defined in config/environment.rb? »
I have defined a constant in config/environment.rb called LOCAL_SETTINGS that I use for configuration and use throughout my app. It's a YAML file stor...
(1) odpowiedzi
2017-06-03 08:06 how do I use curl to test my Rails controller create action.. or can I use rspec? »
Please bear with me as the Rails guide chooses to not even mention the create action in their API section. My goal is to build a RESTFUL API from whic...
(1) odpowiedzi
2017-06-02 21:06 Rspc: How to stub the MandrilApi dynamic template API »
I have tried this But its not working I am using GEM mandrill-api https://bitbucket.org/mailchimp/mandrill-api-ruby/wiki/Home config.before(:all) do...
(0) odpowiedzi
2017-06-02 19:06 How do you test a message expectation within a block in Rspec? »
I'm trying to test message expectation within a block in Rspec: def a_method ALibrary.execute do |batch| batch.execute if a == 1 end end I...
(2) odpowiedzi