# RSpec

**URL:** https://www.ruby-forum.com/c/testing/rspec/25.md?page=23

[Latest](https://www.ruby-forum.com/latest.md) · [Categories](https://www.ruby-forum.com/categories.md) · [Tags](https://www.ruby-forum.com/tags.md)

**Page:** 24

---

## [Problem testing Authlogic UserSession](https://www.ruby-forum.com/t/problem-testing-authlogic-usersession/199159)

<div class="topic-metadata">

**Author:** [@okkezSS](https://www.ruby-forum.com/u/okkezSS)\
**Replies:** 0\
**Last updated:** [November 15, 2010, 11:44pm UTC](https://www.ruby-forum.com/t/problem-testing-authlogic-usersession/199159 "2010-11-15T23:44:57Z")

</div>

I’ve posted this to the Authlogic group but things seem a little quiet, so perhaps someone here can help: 'm testing Authlogic 2.1.6, running under Rails 3.0.1., using rspec 2.1.0 I have the following: user.rb cla…

---

## [RSpec not testing ".sum"](https://www.ruby-forum.com/t/rspec-not-testing-sum/199154)

<div class="topic-metadata">

**Author:** [@okkezSS](https://www.ruby-forum.com/u/okkezSS)\
**Replies:** 2\
**Last updated:** [November 15, 2010, 10:32pm UTC](https://www.ruby-forum.com/t/rspec-not-testing-sum/199154 "2010-11-15T22:32:13Z")

</div>

Hello all, I’m on the final stretch of testing my model, and I’ve realized that one simple line isn’t being tested. I was hoping to get some insight on what I can do to accomplish this. The line that isn’t being cover…

---

## [Rspec not testing my callback](https://www.ruby-forum.com/t/rspec-not-testing-my-callback/199139)

<div class="topic-metadata">

**Author:** [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Replies:** 5\
**Last updated:** [November 15, 2010, 5:57pm UTC](https://www.ruby-forum.com/t/rspec-not-testing-my-callback/199139 "2010-11-15T17:57:45Z")

</div>

Hello everyone, I have a “before\_save” at the top of my model, and it is being used correctly. However, when testing with RSpec/Rcov, my callback method is not being tested. Is there something specific I need to be do…

---

## [Debugging calls with message expectations](https://www.ruby-forum.com/t/debugging-calls-with-message-expectations/199110)

<div class="topic-metadata">

**Author:** [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Replies:** 1\
**Last updated:** [November 15, 2010, 4:49pm UTC](https://www.ruby-forum.com/t/debugging-calls-with-message-expectations/199110 "2010-11-15T16:49:23Z")

</div>

I’d like to know how to debug callers with message expectations. I have a message expectation that should be called only once but for some reason is called 13 times and I’d like to know where it’s called from. I’ve ma…

---

## [How do I include routing path helpers?](https://www.ruby-forum.com/t/how-do-i-include-routing-path-helpers/199034)

<div class="topic-metadata">

**Author:** [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Replies:** 8\
**Last updated:** [November 14, 2010, 9:08am UTC](https://www.ruby-forum.com/t/how-do-i-include-routing-path-helpers/199034 "2010-11-14T09:08:58Z")

</div>

I’m writing some Steak acceptance tests in Rspec2 for my Rails3 app and I can’t access various route helpers(members\_path, new\_member\_path, etc…) in my specs, and can’t figure out how to include them. I’m sure it’s pr…

---

## [Rake cucumber gives "database configuration does not specify adapter" error](https://www.ruby-forum.com/t/rake-cucumber-gives-database-configuration-does-not-specify-adapter-error/199067)

<div class="topic-metadata">

**Author:** [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Replies:** 0\
**Last updated:** [November 13, 2010, 9:36pm UTC](https://www.ruby-forum.com/t/rake-cucumber-gives-database-configuration-does-not-specify-adapter-error/199067 "2010-11-13T21:36:52Z")

</div>

I’m still working on getting the basic Rails 2 configuration for RSpec and Cucumber from the RSpec book up and running. I’ve installed the various gems as follows: $ \[sudo\] gem install rspec-rails --version 1.3.3 $ \[…

---

## [Pending tests fail when I switch to mock\_with :mocha](https://www.ruby-forum.com/t/pending-tests-fail-when-i-switch-to-mock-with-mocha/199020)

<div class="topic-metadata">

**Author:** [@okkezSS](https://www.ruby-forum.com/u/okkezSS)\
**Replies:** 2\
**Last updated:** [November 13, 2010, 5:06pm UTC](https://www.ruby-forum.com/t/pending-tests-fail-when-i-switch-to-mock-with-mocha/199020 "2010-11-13T17:06:13Z")

</div>

First of all, please direct me into how better to search existing threads in this mailing list. Ok to my rspec 2.0.1 mocha 0.9.8 issue: given a controller test before do subject.expects(:authenticate).once end it…

---

## [Possible subject/its bug?](https://www.ruby-forum.com/t/possible-subject-its-bug/199059)

<div class="topic-metadata">

**Author:** [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Replies:** 0\
**Last updated:** [November 13, 2010, 2:50pm UTC](https://www.ruby-forum.com/t/possible-subject-its-bug/199059 "2010-11-13T14:50:08Z")

</div>

Hi I recently did a coding kata and ran into some strange behaviour. The code is here\[1\], the weirdness under the comment “Doesn’t work… RSpec bug?”. Basically, all the subject / its(:sequence) examples seem to work…

---

## [In spec/controller file not taking controller property](https://www.ruby-forum.com/t/in-spec-controller-file-not-taking-controller-property/199017)

<div class="topic-metadata">

**Author:** [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Replies:** 5\
**Last updated:** [November 13, 2010, 8:32am UTC](https://www.ruby-forum.com/t/in-spec-controller-file-not-taking-controller-property/199017 "2010-11-13T08:32:50Z")

</div>

I am working on Rspec for Controller testing.I am initial leve of rspec.I have a problem that in Spec/controller directory rspec file is not taking controller property as (instance varibale,flash notice) My controller…

---

## [In spec/controller file not taking controller property](https://www.ruby-forum.com/t/in-spec-controller-file-not-taking-controller-property/199054)

<div class="topic-metadata">

**Author:** [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Replies:** 0\
**Last updated:** [November 13, 2010, 7:59am UTC](https://www.ruby-forum.com/t/in-spec-controller-file-not-taking-controller-property/199054 "2010-11-13T07:59:22Z")

</div>

My rspec file is not taking controller property. In controller instance variable defined as : @portal\_news=PortalNews.new In rspec file my code is get :create,:portal\_news=\>{:user\_id=\>101} assigns\[:portal\_news\].…

---

## [Rspec 2, Rails 3 and Webrat](https://www.ruby-forum.com/t/rspec-2-rails-3-and-webrat/189996)

<div class="topic-metadata">

**Author:** [@dracko](https://www.ruby-forum.com/u/dracko)\
**Replies:** 12\
**Last updated:** [November 12, 2010, 4:23pm UTC](https://www.ruby-forum.com/t/rspec-2-rails-3-and-webrat/189996 "2010-11-12T16:23:04Z")

</div>

Hi guys, I’m trying to port an application to Rails 3 but can’t get my integration tests to run. I can’t call the Webrat’s method (yields ‘undefined method visit’, for instance). I don’t use Cucumber. Is there any i…

---

## ["rspec can not be found in vendor/gems, vendor/plugins or system gems" error](https://www.ruby-forum.com/t/rspec-can-not-be-found-in-vendor-gems-vendor-plugins-or-system-gems-error/198826)

<div class="topic-metadata">

**Author:** [@okkezSS](https://www.ruby-forum.com/u/okkezSS)\
**Replies:** 12\
**Last updated:** [November 11, 2010, 8:32pm UTC](https://www.ruby-forum.com/t/rspec-can-not-be-found-in-vendor-gems-vendor-plugins-or-system-gems-error/198826 "2010-11-11T20:32:33Z")

</div>

I’m trying to follow the instructions in the beta version of “The RSpec Book” to get “BDD in Rails” going. Here are some relevant details: Rails version: 2.3.5 Local gems: rspec (2.1.0) rspec-core (2.1.0) rspec-exp…

---

## [Rspec-rails - expected helper\_method behaviour in view specs](https://www.ruby-forum.com/t/rspec-rails-expected-helper-method-behaviour-in-view-specs/198918)

<div class="topic-metadata">

**Author:** [@okkezSS](https://www.ruby-forum.com/u/okkezSS)\
**Replies:** 1\
**Last updated:** [November 11, 2010, 9:39am UTC](https://www.ruby-forum.com/t/rspec-rails-expected-helper-method-behaviour-in-view-specs/198918 "2010-11-11T09:39:19Z")

</div>

Heya, Say I had the following app controller : class ApplicationController\<ActionController::Base def logged\_in? true end helper\_method :logged\_in? end Under a rspec-rails1 view-spec, a view template would be abl…

---

## [Autotest not working on Windows with rails3 and rspec2?](https://www.ruby-forum.com/t/autotest-not-working-on-windows-with-rails3-and-rspec2/197918)

<div class="topic-metadata">

**Author:** [@okkezSS](https://www.ruby-forum.com/u/okkezSS)\
**Replies:** 11\
**Last updated:** [November 11, 2010, 1:09am UTC](https://www.ruby-forum.com/t/autotest-not-working-on-windows-with-rails3-and-rspec2/197918 "2010-11-11T01:09:22Z")

</div>

Hello! I’m trying to run autotest under Windows when using Rails 3.0.1 and RSpec 2.0.1. It’s not working so far. This is what happens: C:\\Users\\jarmo\\Desktop\\minu\\projects\\Ruby\\sample\_app\>autotest loading autotest/ra…

---

## [How to specify current directory for specs?](https://www.ruby-forum.com/t/how-to-specify-current-directory-for-specs/198873)

<div class="topic-metadata">

**Author:** [@okkezSS](https://www.ruby-forum.com/u/okkezSS)\
**Replies:** 4\
**Last updated:** [November 10, 2010, 11:00pm UTC](https://www.ruby-forum.com/t/how-to-specify-current-directory-for-specs/198873 "2010-11-10T23:00:15Z")

</div>

Hello, I’d like to know if it’s possible to specify what directory to use as the current directory when executing the specifications. My specs are in spec/ and I have some data in spec/data that I want to read from o…

---

## [Upgrade problems/questions regarding RSpec 1.3.0 to 2.0.1](https://www.ruby-forum.com/t/upgrade-problems-questions-regarding-rspec-1-3-0-to-2-0-1/198651)

<div class="topic-metadata">

**Author:** [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Replies:** 16\
**Last updated:** [November 10, 2010, 10:39pm UTC](https://www.ruby-forum.com/t/upgrade-problems-questions-regarding-rspec-1-3-0-to-2-0-1/198651 "2010-11-10T22:39:30Z")

</div>

Hello! I’m trying to migrate my scripts from RSpec 1.3.0 to 2.0.1 having some issues so far. I don’t like is that “.rspec” has to be in the working directory and cannot be anymore in “spec”. Okay, i can issue “mv s…

---

## [\[Rails\] \`parse!': invalid option: --autotest (OptionParser::InvalidOption)](https://www.ruby-forum.com/t/rails-parse-invalid-option-autotest-optionparser-invalidoption/198915)

<div class="topic-metadata">

**Author:** [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Replies:** 1\
**Last updated:** [November 10, 2010, 5:25pm UTC](https://www.ruby-forum.com/t/rails-parse-invalid-option-autotest-optionparser-invalidoption/198915 "2010-11-10T17:25:10Z")

</div>

Well, here it is. I am learning Rails and rSpec at the same time courtesy of Michael H.'s tutorial. All was going good when this happened. rspec is woking on my other projects so I have no idea what I did wrong. I tr…

---

## [Rspec and autotest integration problem](https://www.ruby-forum.com/t/rspec-and-autotest-integration-problem/198916)

<div class="topic-metadata">

**Author:** [@okkezSS](https://www.ruby-forum.com/u/okkezSS)\
**Replies:** 0\
**Last updated:** [November 10, 2010, 4:53pm UTC](https://www.ruby-forum.com/t/rspec-and-autotest-integration-problem/198916 "2010-11-10T16:53:08Z")

</div>

Hi all, i am new to ruby and rails and i am following the tutorial in http://railstutorial.org/chapters/static-pages#sec:autotest railstutorial.org to setup the rspec and autotest in my Ubuntu 10.04 i have the follo…

---

## [Re: no output from rspec -- fixed](https://www.ruby-forum.com/t/re-no-output-from-rspec-fixed/198888)

<div class="topic-metadata">

**Author:** [@okkezSS](https://www.ruby-forum.com/u/okkezSS)\
**Replies:** 0\
**Last updated:** [November 10, 2010, 3:35am UTC](https://www.ruby-forum.com/t/re-no-output-from-rspec-fixed/198888 "2010-11-10T03:35:02Z")

</div>

Resend from 10/29/2010 due to bounce back. This is in reference to an email sent to the group on On Oct 18, 2010, at 1:24 AM. Short version: The solution was indeed to downgrade to test-unit 1.2.3 gem ‘test-unit’, ‘1…

---

## [How to setup rspec to be included on the PATH](https://www.ruby-forum.com/t/how-to-setup-rspec-to-be-included-on-the-path/198832)

<div class="topic-metadata">

**Author:** [@okkezSS](https://www.ruby-forum.com/u/okkezSS)\
**Replies:** 2\
**Last updated:** [November 9, 2010, 5:29pm UTC](https://www.ruby-forum.com/t/how-to-setup-rspec-to-be-included-on-the-path/198832 "2010-11-09T17:29:44Z")

</div>

I’ve recently installed a copy of rspec (2.0.0) on my Linux distribution (Ubuntu 9.10). All went well. However, when I attempt to access cucumber from the shell, like so $ rspec --help I receive the following: No…

---

## [Uploads with webrat in stories](https://www.ruby-forum.com/t/uploads-with-webrat-in-stories/147240)

<div class="topic-metadata">

**Author:** [@johanatan](https://www.ruby-forum.com/u/johanatan)\
**Replies:** 8\
**Last updated:** [November 9, 2010, 1:35am UTC](https://www.ruby-forum.com/t/uploads-with-webrat-in-stories/147240 "2010-11-09T01:35:09Z")

</div>

I’ve read through the messages on this list, and have file upload specs working in my model and controller tests, using :file =\> ActionController::TestUploadedFile.new(filepath) But its not working in stories using we…

---

## [WillPaginate::Collection not detectible in assigns?](https://www.ruby-forum.com/t/willpaginate-collection-not-detectible-in-assigns/198772)

<div class="topic-metadata">

**Author:** [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Replies:** 5\
**Last updated:** [November 8, 2010, 10:50pm UTC](https://www.ruby-forum.com/t/willpaginate-collection-not-detectible-in-assigns/198772 "2010-11-08T22:50:38Z")

</div>

I am transitioning a Rails 2 app to Rails 3, Rspec 2 and have several controller where I test collect.should be\_an\_instance\_of(WillPaginate::Collection). The spec fails with “expected \[object\] to be an instance of Wil…

---

## [Custom File List for Rails 3 Spec Task](https://www.ruby-forum.com/t/custom-file-list-for-rails-3-spec-task/198753)

<div class="topic-metadata">

**Author:** [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Replies:** 2\
**Last updated:** [November 8, 2010, 7:04am UTC](https://www.ruby-forum.com/t/custom-file-list-for-rails-3-spec-task/198753 "2010-11-08T07:04:53Z")

</div>

I have some javascript specs (using the jspec javascript framework) in my rails 3 project, living in the spec/javascript directory. How can I exclude the ruby files in the jspec project from being run when I run “rak…

---

## [Hooks before a scenario but not the background: possible or bad practice](https://www.ruby-forum.com/t/hooks-before-a-scenario-but-not-the-background-possible-or-bad-practice/198758)

<div class="topic-metadata">

**Author:** [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Replies:** 2\
**Last updated:** [November 7, 2010, 8:10pm UTC](https://www.ruby-forum.com/t/hooks-before-a-scenario-but-not-the-background-possible-or-bad-practice/198758 "2010-11-07T20:10:02Z")

</div>

Hi, I’d like to activate FakeFS for some scenarios, which I tag @fakefs, however it seems Before(‘@fakefs’) runs before the background of the feature - unfortunately this clobbers Grit, and I can’t Grit::Repo.new(…) …

---

## [Rspec-2.1 is released!](https://www.ruby-forum.com/t/rspec-2-1-is-released/198776)

<div class="topic-metadata">

**Author:** [@okkezSS](https://www.ruby-forum.com/u/okkezSS)\
**Replies:** 0\
**Last updated:** [November 7, 2010, 6:38pm UTC](https://www.ruby-forum.com/t/rspec-2-1-is-released/198776 "2010-11-07T18:38:02Z")

</div>

rspec-core-2.1.0 / 2010-11-07 Cucumber features RDoc # will be generated by 2010-11-08 full changelog Enhancments Add skip\_bundler option to rake task to tell rake task to ignore the presence of a Gemfile (jfe…

---

## [How best to intercept one method in the midst of a chain](https://www.ruby-forum.com/t/how-best-to-intercept-one-method-in-the-midst-of-a-chain/198756)

<div class="topic-metadata">

**Author:** [@okkezSS](https://www.ruby-forum.com/u/okkezSS)\
**Replies:** 1\
**Last updated:** [November 7, 2010, 2:12pm UTC](https://www.ruby-forum.com/t/how-best-to-intercept-one-method-in-the-midst-of-a-chain/198756 "2010-11-07T14:12:35Z")

</div>

Hi Group, I’m back to Rspec after some time away, and was a little curious about why the following example does not return the value zero. ​​gist:665226 · GitHub I have tried @repo.status.send{type.to\_sym}.size and g…

---

## [Calling let(:something) from before blocks?](https://www.ruby-forum.com/t/calling-let-something-from-before-blocks/198733)

<div class="topic-metadata">

**Author:** [@okkezSS](https://www.ruby-forum.com/u/okkezSS)\
**Replies:** 0\
**Last updated:** [November 6, 2010, 1:36pm UTC](https://www.ruby-forum.com/t/calling-let-something-from-before-blocks/198733 "2010-11-06T13:36:09Z")

</div>

Hello! I find myself repeating the same let(:something) statements over and over again in different view examples. Therefore, I wonder if it’s possible to define these globally in the spec\_helper.rb file. I came up w…

---

## [Calling let(:something) from before blocks?](https://www.ruby-forum.com/t/calling-let-something-from-before-blocks/198711)

<div class="topic-metadata">

**Author:** [@okkezSS](https://www.ruby-forum.com/u/okkezSS)\
**Replies:** 1\
**Last updated:** [November 6, 2010, 12:10am UTC](https://www.ruby-forum.com/t/calling-let-something-from-before-blocks/198711 "2010-11-06T00:10:06Z")

</div>

Hello! I find myself repeating the same let(:something) statements over and over again in different view examples. Therefore, I wonder if it’s possible to define these globally in the spec\_helper.rb file. I came up w…

---

## [Apparent regression in rspec 2 on ruby 1.9: constant resolution fails in describes in nested modules](https://www.ruby-forum.com/t/apparent-regression-in-rspec-2-on-ruby-1-9-constant-resolution-fails-in-describes-in-nested-modules/198674)

<div class="topic-metadata">

**Author:** [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Replies:** 2\
**Last updated:** [November 5, 2010, 3:47pm UTC](https://www.ruby-forum.com/t/apparent-regression-in-rspec-2-on-ruby-1-9-constant-resolution-fails-in-describes-in-nested-modules/198674 "2010-11-05T15:47:44Z")

</div>

Hi, I’ve converted a couple of my smaller libraries’ spec suites to rspec 2 with no trouble. (I’m enjoying the new version – thanks to all involved.) I’m trying to convert one a larger suite now and I’ve run into t…

---

## [Autotest not even starting](https://www.ruby-forum.com/t/autotest-not-even-starting/198683)

<div class="topic-metadata">

**Author:** [@okkezSS](https://www.ruby-forum.com/u/okkezSS)\
**Replies:** 0\
**Last updated:** [November 5, 2010, 9:40am UTC](https://www.ruby-forum.com/t/autotest-not-even-starting/198683 "2010-11-05T09:40:44Z")

</div>

Hi \*, I’m trying to implement the Warden middleware, but apparently warden is making autotest crash. Here is the backtrace: Specs and features run as normal. This is what is in strategies.rb: gist:663795 · GitHub S…

[Previous page](https://www.ruby-forum.com/c/testing/rspec/25.md?page=22)

[Next page](https://www.ruby-forum.com/c/testing/rspec/25.md?page=24)
