Data dodania Pytanie
2017-01-18 17:01 RSpec Rails NoMethodError: undefined method `password=' for User »
I have run the tests and it doesn't seem that the user get created by a Factory Girl. Here's what I got: reports_controller_spec.rb require 'rails_...
(1) odpowiedzi
2017-01-18 13:01 RSpec Stack level too deep (SystemStackError) »
I have three models offer_ticket, event and offer and have three their respective factories below are the models and factories are given i got error s...
(1) odpowiedzi
2017-01-18 08:01 Go to route in helper specs in RSpec does not work »
I have an "Add friend" button in user profile pages (users#show) and I want to test that the button does not show up on your own profile page (current...
(1) odpowiedzi
2017-01-18 07:01 How to verify that i get only one key from JSON response? »
I get a response in JSON and need to make sure that i get only one 'signal' in signal_events. I'm using Ruby with rspec. "signal_events": [ { "id"...
(1) odpowiedzi
2017-01-17 12:01 How to share a variable with many "it" examples in rspec »
I am using let to create a user record using factory girl. However i want to use exactly the same variable across 2 tests in the context as the user_i...
(3) odpowiedzi
2017-01-17 08:01 Rspec POST Test not passing. Expected response to be a <3XX: redirect>, but was a 200 »
This POST create test is not working. It should redirect to reports_path, but it does not work. describe "POST #create" do let(:report) { assigns...
(1) odpowiedzi
2017-01-17 06:01 Rspec Controller test not passing »
My controller and my test file are bellow. controllers/reports_controller.rb: def index @reports = Report.all end specs/controllers/reports_...
(2) odpowiedzi
2017-01-16 22:01 Capybara unable to find link "Delete Comment" »
Here is the view views/comments/_comment.html.erb <div class="comment clearfix"> <div class="comment_content"> <p class="comme...
(1) odpowiedzi
2017-01-16 10:01 Capybara trim down the link and getting ActionController::RoutingError: »
I have a link in my ruby on rails project which redirects the user here: https://blah.com/files/form/anonymous/api/library/142270db-..., but when runn...
(1) odpowiedzi
2017-01-16 07:01 Should I Explicitly Spec my Helpers in Rails »
While rspec automatically creates specs for any helpers created by the Rails generators, I was wondering if other Rails developers find it important/u...
(2) odpowiedzi
2017-01-15 16:01 rspec test fails code in rails controller »
In my application_controller.rb, i have a line of code as follows: def index CaseStatus.order(:application_source).pluck(:application_source).uniq! ...
(1) odpowiedzi
2017-01-14 08:01 how to check whether the check box is checked or not capybara Rspec »
CHECK <div class="checkbox"> <input id="yes_1212" class="check_uncheck" type="checkbox" value="true" name="yes" checked="checked">...
(1) odpowiedzi
2017-01-14 02:01 Chef : issue while running rspec »
I wrote a small rspec test case while will call a recipe which inturn uses encrypted data bags. while running " chef exec rspec", I get an error - ...
(1) odpowiedzi
2017-01-13 18:01 A more readable request spec that changes model count »
I have the following rspec request spec example which passes it "increases count by 1" do attributes = attributes_for(:district) expect { post ad...
(2) odpowiedzi
2017-01-13 18:01 Page blank when js: true »
I'm writing an Rspec test supported by Capybara and Poltergeist. When js: true is enabled for the test the resulting page is blank. HTML content is ju...
(0) odpowiedzi
2017-01-13 11:01 Rails Rspec integer equals string ("1" == 1) »
How, in rspec, do you compare the value of something while ignoring the type? Failure/Error: expect(variable).to eql model.id expected: 1234 ...
(2) odpowiedzi
2017-01-13 10:01 Can I mock the class name of an RSpec double? »
I have an RSpec test file where I have created a double that allows a method and returns a value. In my Ruby application code I have used the code ...
(1) odpowiedzi
2017-01-12 23:01 TDD implementation of a set data structure in Ruby »
I am trying to implement a set data structure in Ruby using rspec. I have one test which does not seem to pass in the below code: def add(element) ...
(2) odpowiedzi
2017-01-12 18:01 Testing a View with Datagrid Form »
While Datagrid works well in my views, I don't understand how to test it with RSpec. More specific: The datagrid_form_for tag throws a RSpec error. ...
(0) odpowiedzi
2017-01-12 16:01 FactoryGirl can't access my models »
Problem When I try to run bundle exec rspec, I always get this error: Failure/Error: before { @user = FactoryGirl.build(:user) } NameError: ...
(1) odpowiedzi
2017-01-12 11:01 Is there any way to write RSpec test cases that would test directory or file presence »
I have working project in Sinatra framework for which I have to write RSpec test cases. Herein we pass an argument to a method which then generates a ...
(0) odpowiedzi
2017-01-11 23:01 Test production specific code with rspec - Sinatra »
I have this code to configure logging for production and test/development environments: class ApplicationController < Sinatra::Base configure :d...
(1) odpowiedzi
2017-01-11 17:01 How do you trigger the evaluation of a mail method using RSpec? »
class MyMailer < BaseMailer def send_login_prompt User.reset_login # ... end end describe MyMailer do context "when sending a login ...
(1) odpowiedzi
2017-01-11 05:01 How to test before_update callback in rails model with Rspec and FactoryGirl? »
I am trying to test the before_update callback of the model bellow. models/option.rb: class Option < ApplicationRecord belongs_to :activity ...
(3) odpowiedzi
2017-01-10 20:01 rspec rails nested_attributes on controller »
I am using Rspec to test a controller that received nested_attributes. A class Option can has_many Suboptions. models/suboption.rb: class Suboption ...
(0) odpowiedzi
2017-01-10 16:01 ActionView::Template::Error "Invalid CSS" thrown in feature spec only »
The following Sass works perfectly in development: main :not(table) img +box-shadow But when I run my specs, as soon as a JavaScript feature ...
(0) odpowiedzi
2017-01-10 13:01 Unable to create a model in Rspec via Post »
I'm trying to create a User in Rspec: require "rails_helper" RSpec.describe UsersController, type: :controller do describe "POST #index" do it...
(1) odpowiedzi
2017-01-09 23:01 BDD - Issue running with No UI »
I'm new to using cucumber and ruby for doing BDD unit tests and would like to get some help regarding an error that is occurring when try to run the t...
(0) odpowiedzi
2017-01-09 04:01 Rspec: controller spec login helper »
I am using rspec to test my controllers. The problem is that I need a login helper method every other controller tests will use in its before(:each) d...
(0) odpowiedzi
2017-01-08 03:01 RSpec/Capybara Selenium Safari issue »
The code below works with when running Chrome and Firefox. I am having issues with Safari using apple's new driver, however. Safari loads up, maximise...
(0) odpowiedzi
2017-01-07 16:01 Generating binary files with Sitespec fails when a Padrino Rack app »
I am working on a project with Sitespec, which is a static site generator using RSpec and uses any Rack app. I chose Padrino as a Rack app for Sitesp...
(0) odpowiedzi
2017-01-07 07:01 Unable to force a click of a hidden element with Capybara »
I have an intermittent failure in my capybara tests caused by a modal not closing quickly enough and so covering the button that is to be clicked. Th...
(2) odpowiedzi
2017-01-07 05:01 Testing that Devise is re-sending confirmation instructions email in a background worker »
I want to send Devise confirmation instructions to users a second time if they haven't confirmed within two days of signing up, however I can't seem t...
(0) odpowiedzi
2017-01-06 22:01 Mock Rails 4 application config custom value »
In Rails::Application, I add a custom configuration using... config.x.cache_config = config_for(:cache) In my tests, I want to see how code using t...
(1) odpowiedzi
2017-01-06 17:01 Why url heplers aren't working in tests? »
spec/rails_helper.rb ENV['RAILS_ENV'] ||= 'test' require File.expand_path('../../config/environment', __FILE__) abort("The Rails environment is runni...
(1) odpowiedzi