rspec2 Questions

9

Solved

How do I turn off transactional fixtures for only one spec (or Steak scenario) with RSpec 2? I tried some things found on the web without any success. This leads to an undefined method exception. ...
Rupertruperta asked 4/10, 2010 at 5:35

4

Solved

I have a reservation search form that contains the following date_field helper: <%= date_field(:reservation, :arrival_date) %> How do I select a specific date for this date_field tag using...
Vouge asked 18/2, 2014 at 9:56

3

Solved

I'm trying to include some helpers to test with rspec but no luck. What I did: created a support/helpers.rb file under my spec folder. support/helpers.rb module Helpers include ActionView::Hel...
Owen asked 25/2, 2012 at 15:39

3

Solved

I am writing a unit test using rspec. I would like to mock Rails.env.develepment? to return true. How could I achieve this?. I tried this Rails.env.stub(:development?, nil).and_return(true) i...
Bluefish asked 16/1, 2014 at 5:0

6

I'm trying to pass a cookie when doing a GET request, using rspec 2 and rails 3. I've tried the following so far. get "/", {}, {"Cookie" => "uuid=10"} # cookies[:uuid] is nil request.cookies[:...
Cuevas asked 3/7, 2012 at 0:9

2

Solved

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 need the whole backtrace of the error. Is it some...
Closestool asked 12/6, 2017 at 6:19

3

Solved

I am trying to get started in testing ActiveAdmin, in particular I need to test a member_action from one of the ActiveAdmin controllers. Do you guys know any good tutorials on this topic? Thank y...
Basildon asked 30/5, 2012 at 9:37

2

Solved

I'm using ruby 1.9 and I'm trying to do BDD. My first test 'should read in the csv' works, but the second where I require a file object to be mocked doesn't. Here is my model spec: require 'spec_...
Slavism asked 7/3, 2011 at 11:2

7

Solved

In order to ensure that my application is not vulnerable to this exploit, I am trying to create a controller test in RSpec to cover it. In order to do so, I need to be able to post raw JSON, but I ...
Lindblad asked 8/2, 2013 at 15:34

7

Solved

Is there a way to automatically do a rake db:migrate RAILS_ENV=test after each rake db:migrate when in development environment? I have guard and guard-rspec running, and I am really annoyed about ...
Vestment asked 3/8, 2011 at 16:31

8

Solved

I'm having a problem with a spec that visits two forms with the same field ("Email") on both forms. If I don't manually sleep, Capybara seems to be finding the "Email" field fro...
Seeger asked 23/1, 2014 at 16:27

6

Solved

I am trying to stub a method on a helper that is defined in my controller. For example: class ApplicationController < ActionController::Base def current_user @current_user ||= authenticated_u...
Bullivant asked 10/5, 2012 at 16:1

3

Solved

I often want to do context "empty stack" do SOME_CONSTANT = "value" it "should be empty" do # use SOME_CONSTANT end end context "populated stack" do SOME_CONSTANT = "a different value" it "...
Bodkin asked 8/3, 2011 at 8:31

5

Solved

Helper Method # Determine if this is user's first time def first_time? cookies[:first_time].nil? end Attempted Rspec test it "returns true if the cookie is set" do cookies[:first_time] = "...
Grassgreen asked 29/3, 2011 at 16:45

2

Solved

Is there no simple way to do the equivalent of response.should render_template(:foo) in a mailer spec? Here's what I want to do: mail.should render_template(:welcome) Is that so much to ask? A...
Mccullough asked 22/4, 2011 at 23:45

4

I am extending an existing library by creating a child class which extends to the library class. In the child class, I was able to test most of functionality in initialize method, but was not abl...
Verdun asked 6/4, 2013 at 21:39

5

Solved

When I send an object json all fields inside are changed to string, breaking my validation in the controller and i get the following error. Api::V1::BillsController POST #create when logged in F...
Segmentation asked 19/11, 2015 at 15:24

2

Solved

For days now I have been trying to get to the bottom of what seam to be something that should be very easy to do... I am however still very new to the world of rails and ruby and I just cant work t...
Dexterdexterity asked 29/8, 2012 at 4:47

3

Solved

I'm using Rspec to test a rails app. Is there a way to list all the pending examples without running the full test suite?
Disbranch asked 2/11, 2011 at 15:5

2

Solved

I'm running RSpec tests against a website product that exists in several different markets. Each market has subtly different combinations of features, etc. I would like to be able to write tests su...
Sobranje asked 24/3, 2011 at 6:8

6

Solved

After significant troubleshooting, I figured out that I needed to run rake spec once (I can abort with control-c) before I can run rspec directly (e.g. on a subset of our specs). We are running Rai...
Politic asked 6/5, 2011 at 19:29

3

Solved

I have a file with two classes in it. class LogStash::Filters::MyFilter< LogStash::Filters::Base and class LogStash::JavaMysqlConnection JavaMysqlConnection has methods initialize and sele...
Ergosterol asked 1/2, 2017 at 15:2

5

Solved

I have test-unit installed and rspec installed (along with -core, -expectations, -mocks and -rails version 2.6.x). When I run the command rails new foo, it uses test-unit to generate the test stub ...
Rexford asked 18/7, 2011 at 4:25

4

Solved

I've a view helper method which generates a url by looking at request.domain and request.port_string. module ApplicationHelper def root_with_subdomain(subdomain) subdomain += "." unless subdo...
Concelebrate asked 27/10, 2010 at 3:59

3

Solved

I would like to be able to display a test group name (and ancestry) during the before(:all) method: describe "My awesome app" do before(:all) do puts running_example_group.metadata[:full_descrip...
Maclay asked 12/10, 2011 at 16:26

© 2022 - 2024 — McMap. All rights reserved.