Data dodania Pytanie
2017-02-02 07:02 Using Sinatra with Rspec for test JSON »
I am new to Rspec and Sinatra and wanted to ask how one would go about testing the following. I think I configured Sinatra for work with Rspec all cor...
(1) odpowiedzi
2017-02-01 16:02 Ruby rspec Mocking a class »
I have a file with two classes in it. class LogStash::Filters::MyFilter< LogStash::Filters::Base and class LogStash::JavaMysqlConnection Java...
(2) odpowiedzi
2017-02-01 12:02 Rails feature specs: external Google font API is called, but I don't know where »
When I run my Rails feature specs without internet connection, tests fail with the following reason: 3) Creating user textarea fullscreen feature o...
(2) odpowiedzi
2017-02-01 00:02 rspec: Put request define url source »
I have the following test: it "should generate invoice on reconnect finish after cycle_date" do params = { :id => @reconnect.id, :state =&...
(2) odpowiedzi
2017-01-31 15:01 Rails RSpec Controller Test »
I'm trying to test that a Subscription was actually created as part of my Company#create controller method: require 'rails_helper' RSpec.describe Co...
(3) odpowiedzi
2017-01-31 12:01 How to test a model instance method which makes a call to an external API »
I am having trouble understanding what to test in the case below and how to do it. I have the following instance method on Address model validate :a...
(2) odpowiedzi
2017-01-31 07:01 Factories not loading with single test but loads with all tests »
I am following the rails api book but building the code in an engine. The test is at spec/controllers/concerns/handicap/authenticable_spec.rb and look...
(1) odpowiedzi
2017-01-30 15:01 Devise User testing with RSpec »
I've integrated Devise with my RoR app and am now trying to test my Controllers, specifically the one that routes me to my root_url. I've used this H...
(1) odpowiedzi
2017-01-30 14:01 Ruby on Rails with RSpec and shoulda-matcher validate_inclusion_of giving NoMethodError »
I'm still fairly new to Ruby on Rails and all its associated gems etc. so please bare with me and ask me to provide more info if it's needed. I'm hav...
(2) odpowiedzi
2017-01-30 03:01 Calling a method of a foreign object from a parameter (Ruby) »
Everyone, I'm working on an assignment for a class I'm taking at university this year and we're supposed to make an implementation of a graph in Ruby...
(0) odpowiedzi
2017-01-29 14:01 How can I configure VCR to use cassette names that match the request? »
I am using rspec/capybara/VCR to record tapes. Currently my tapes are automatically named to include a simplified version of the hierarchy of the test...
(0) odpowiedzi
2017-01-29 06:01 Capybara have_content() not showing as expected »
Ok, I'm at my wits end. I have a feature spec and it's not passing. The deleting_posts_spec.rb is not finding the text "Post was successfully destroy...
(1) odpowiedzi
2017-01-29 03:01 ruby rails rspec 3 rake tasks with highline stubs »
I have been trying to use the following spec based on this so post Rspec Rake Task: How to parse a parameter? to cover this process... Current Spec....
(1) odpowiedzi
2017-01-28 17:01 how to clean database before running the each spec file? »
I want to clear my test database before running the each spec files. I am already using rspec with factory girl. Thanks, Hare ...
(2) odpowiedzi
2017-01-27 20:01 RSpec/Capybara: Not detecting »
I'm running feature test in my rails app with Rspec and capybara. I'm filling out a form, which includes the following code: <%= f.collection_sel...
(1) odpowiedzi
2017-01-27 15:01 rspec: expect method call on instance of EXACT class (not subclasses) »
I have code which calls two slightly different things. One which instantiates Foo explicitly, and another which uses a gem which instantiates Foo int...
(1) odpowiedzi
2017-01-27 12:01 I'm Testing features and need to call a method from ApplicationController, how can I do that? »
I'm Testing features and need to call a method from ApplicationController, How to call a method gta_data in the test? def gtm_data(data_hash = nil) ...
(1) odpowiedzi
2017-01-26 17:01 Testing if association exists in rspec »
I'm new to using rspec, so hopefully I'm explaining this correctly. I want to make sure my object is created and afterwards make sure that a related ...
(3) odpowiedzi
2017-01-26 03:01 Rails 4 rspec test fails before code is run »
EDIT: My initial assumption was incorrect. It seemed like my test was hitting its assertions before it even finished running all of its code blocks, b...
(3) odpowiedzi
2017-01-25 21:01 In ruby, how to pass a class variable into a mixed-in module's dynamically created class method? »
SO... I have a module... module Foo class_methods do def bar(*fields) fields.each do |field| define_method("set_#{field}=") do |...
(1) odpowiedzi
2017-01-25 18:01 RAILS: db count is always 0 in spec »
Here is a simple case of spec in Rails 4.2: it "returns redirect to Save & Copy" do user_access = FactoryGirl.create(:user_access, :actio...
(0) odpowiedzi
2017-01-25 01:01 Do I need to have the browser driver listening each time I execute selenium-webdriver tests locally? »
Do I need to have the browser driver listening each time I execute selenium-webdriver tests locally? e.g. Do I need to double click on "geckodriver" ...
(1) odpowiedzi
2017-01-24 19:01 Is there a way to run a nested before filter first in RSpec? »
describe 'Feature' do before do setup end describe 'Success' do before do setup_for_success end specify 'It works' do ...
(1) odpowiedzi
2017-01-24 13:01 RSpec before in a helper »
Is it possible to do something like this? module MyHelper before (:each) do allow(Class).to receive(:method).and_return(true) end end Then ...
(3) odpowiedzi
2017-01-24 11:01 Testing a belongs_to relationship in Rails with rspec »
I have a model called Page that has many Paragraphs. This all works but I thought it was about time I had some tests. For reasons, I need a count of a...
(1) odpowiedzi
2017-01-23 21:01 Rspec controller test failing with Apostrophe Character? »
Right now I have unit tests that are failing using the "Faker" Company Name. it seems like the expect(response.body).to match(@thing.name) is whats g...
(1) odpowiedzi
2017-01-23 16:01 Test if a method is called inside a module method »
I have the following in my module: module SimilarityMachine ... def answers_similarity(answer_1, answer_2) if answer_1.compilation_error? &am...
(1) odpowiedzi
2017-01-23 05:01 RSPEC Calling Methods Error »
Here's the method that's giving the error/falure: def draw?(board) if full?(board) == true && won?(board) == false return true ...
(1) odpowiedzi
2017-01-22 18:01 Using Rspec in one file like test/unit »
When I have time I like to take on a challenge at codewars. Until now I used test/unit to do my unit testing but I would like to use Rspec now without...
(2) odpowiedzi
2017-01-22 14:01 Rspec prevent method from being called »
I am testing a controller method for creating new orders (e-commerce-like app). If user is present in the system, he should be redirected to new_user_...
(1) odpowiedzi
2017-01-22 06:01 HABTM Association with FactoryGirl »
Have looked through and tried most examples and still cannot create a working HABTM. No matter how the CaseTrack and CaseTrackValue factories are cons...
(1) odpowiedzi
2017-01-21 01:01 What is the Grails equivalent of Rspec's let? »
Coming from Rails, I am having a hard time with unit tests in Grails. What is the equivalent of the following in in Grails? let(:some_variable) { Som...
(1) odpowiedzi
2017-01-20 20:01 How to test this code with RSpec 3.5? »
I nedd to test this code. Its inside of a application_helper in my rails app. def greet now = Time.now today = Date.today.to_time morning ...
(1) odpowiedzi
2017-01-20 14:01 how to test partial with instance variables »
so i need to test a partial. the partial is rendered by specific action, its something like messages box in facebook. my test looks like this: descri...
(1) odpowiedzi
2017-01-20 12:01 Rails view specs: referenced partials of inherited controllers aren't found »
I have the following controllers: ReportsController # Abstract ReportTemplatesController < ReportsController ReportDocumentsController < Report...
(1) odpowiedzi