# RSpec

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

[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:** 39

---

## [Rails 3, Rspec 2 - flash notice](https://www.ruby-forum.com/t/rails-3-rspec-2-flash-notice/187694)

<div class="topic-metadata">

**Author:** [@cautaro](https://www.ruby-forum.com/u/cautaro)\
**Replies:** 6\
**Last updated:** [April 28, 2010, 7:17am UTC](https://www.ruby-forum.com/t/rails-3-rspec-2-flash-notice/187694 "2010-04-28T07:17:08Z")

</div>

Hello, I also tried testing for the flash notice being set, but it’s not working. it “sets a flash\[:notice\] message” do post :create flash\[:notice\].should == “The message was saved successfully.” end this is the l…

---

## [(LoadError) no such file to load when using rspec 2.0.0.beta.7, rails 	3.0.0.beta3 and ruby 1.9.2 wi](https://www.ruby-forum.com/t/loaderror-no-such-file-to-load-when-using-rspec-2-0-0-beta-7-rails-3-0-0-beta3-and-ruby-1-9-2-wi/187698)

<div class="topic-metadata">

**Author:** [@dazuma](https://www.ruby-forum.com/u/dazuma)\
**Replies:** 1\
**Last updated:** [April 28, 2010, 12:45am UTC](https://www.ruby-forum.com/t/loaderror-no-such-file-to-load-when-using-rspec-2-0-0-beta-7-rails-3-0-0-beta3-and-ruby-1-9-2-wi/187698 "2010-04-28T00:45:58Z")

</div>

I am trying to run a test for a controller with the “spec” command like this: spec spec/controllers/account\_controller\_spec.rb and this is the result: damselem@logicmail$ spec spec/controllers/accounts\_controller\_spec…

---

## [Controller\_name in rspec-rails2?](https://www.ruby-forum.com/t/controller-name-in-rspec-rails2/187696)

<div class="topic-metadata">

**Author:** [@steve](https://www.ruby-forum.com/u/steve)\
**Replies:** 1\
**Last updated:** [April 28, 2010, 12:40am UTC](https://www.ruby-forum.com/t/controller-name-in-rspec-rails2/187696 "2010-04-28T00:40:07Z")

</div>

I have some specs that use controller\_name because of namespaced temporary controllers in my specs. In rspec-rails2 I’m told that controller\_name is not a valid method. Is there a workaround for this? Thanks, Steve

---

## [Cucumber vs, RSpec](https://www.ruby-forum.com/t/cucumber-vs-rspec/187267)

<div class="topic-metadata">

**Author:** [@Ed\_Howland](https://www.ruby-forum.com/u/Ed_Howland)\
**Replies:** 17\
**Last updated:** [April 28, 2010, 12:37am UTC](https://www.ruby-forum.com/t/cucumber-vs-rspec/187267 "2010-04-28T00:37:46Z")

</div>

Please forgive the x-post. I just got back from the Great Lakes Ruby Bash. They had several good presentations, two specific to BDD and Cucumber. I also talked to several CEOs and devs afterwards, and the overall take…

---

## [Rspec 2 and Rails 3 - missing template](https://www.ruby-forum.com/t/rspec-2-and-rails-3-missing-template/187692)

<div class="topic-metadata">

**Author:** [@cautaro](https://www.ruby-forum.com/u/cautaro)\
**Replies:** 6\
**Last updated:** [April 27, 2010, 11:57pm UTC](https://www.ruby-forum.com/t/rspec-2-and-rails-3-missing-template/187692 "2010-04-27T23:57:58Z")

</div>

Hello, I am following the example in the Rspec book, starting page 372, where a controller’s create message is spec’d. it “creates a new message” do Message.should\_receive(:new).with(“text” =\> “a quick br…

---

## [Using RSpec to test Rake tests](https://www.ruby-forum.com/t/using-rspec-to-test-rake-tests/187622)

<div class="topic-metadata">

**Author:** [@johnf](https://www.ruby-forum.com/u/johnf)\
**Replies:** 3\
**Last updated:** [April 27, 2010, 4:01pm UTC](https://www.ruby-forum.com/t/using-rspec-to-test-rake-tests/187622 "2010-04-27T16:01:21Z")

</div>

hi guys, I’m trying to be diligent about checking my rake tasks with RSpec tests, but in the process of feeling my way around I seem to have hit a wall. I’ve got a really simple RSpec test that looks like this: ./tes…

---

## [Problems testing destroy method in rspec2](https://www.ruby-forum.com/t/problems-testing-destroy-method-in-rspec2/185723)

<div class="topic-metadata">

**Author:** [@Mauricio\_Aniche](https://www.ruby-forum.com/u/Mauricio_Aniche)\
**Replies:** 5\
**Last updated:** [April 27, 2010, 3:14am UTC](https://www.ruby-forum.com/t/problems-testing-destroy-method-in-rspec2/185723 "2010-04-27T03:14:29Z")

</div>

Hi, I am trying to test the destroy method in my rails 3 controller, but I always get an “no route matches {}” error. But the route do exist, as I can see by running rake routes. I have something like this: delete …

---

## [File creation](https://www.ruby-forum.com/t/file-creation/187396)

<div class="topic-metadata">

**Author:** [@ben\_rooney](https://www.ruby-forum.com/u/ben_rooney)\
**Replies:** 1\
**Last updated:** [April 26, 2010, 3:34am UTC](https://www.ruby-forum.com/t/file-creation/187396 "2010-04-26T03:34:53Z")

</div>

I have a model that generates the authorization\_rules.rb for declarative\_auth. I am not sure how I can go about testing the model - apart from anything I don’t want my test to over-write the file - so, er, I am not qu…

---

## [Controller tests fail to parse route based on resource](https://www.ruby-forum.com/t/controller-tests-fail-to-parse-route-based-on-resource/187565)

<div class="topic-metadata">

**Author:** [@mhfs](https://www.ruby-forum.com/u/mhfs)\
**Replies:** 2\
**Last updated:** [April 26, 2010, 2:17am UTC](https://www.ruby-forum.com/t/controller-tests-fail-to-parse-route-based-on-resource/187565 "2010-04-26T02:17:02Z")

</div>

Hello list, I have a controller example that looks like this: it 'Should update (PUT /users/:id)' do @attributes = @user.attributes @attributes\[:firstname\] = "Another one" lambda { put user\_url(@user),@attrib…

---

## [A MockExpectationError problem](https://www.ruby-forum.com/t/a-mockexpectationerror-problem/187539)

<div class="topic-metadata">

**Author:** [@cghost](https://www.ruby-forum.com/u/cghost)\
**Replies:** 6\
**Last updated:** [April 26, 2010, 2:14am UTC](https://www.ruby-forum.com/t/a-mockexpectationerror-problem/187539 "2010-04-26T02:14:42Z")

</div>

Hi everyone, I have a test for importing vcards, and I was finding that each time it was being run, it was generating new photos and since it was using the test database, it was actually overwriting real photos that …

---

## [Controller\_name in rspec-rails2?](https://www.ruby-forum.com/t/controller-name-in-rspec-rails2/187521)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 0\
**Last updated:** [April 24, 2010, 8:08pm UTC](https://www.ruby-forum.com/t/controller-name-in-rspec-rails2/187521 "2010-04-24T20:08:34Z")

</div>

I’m trying to use some temporary spec only namespaced controllers with rspec-rails2 and rails3 and my specs fail saying no method for ‘controller\_name’. The same specs work perfectly fine with rails2 and rspec-rails. …

---

## [Cucumber + capybara: checking list items](https://www.ruby-forum.com/t/cucumber-capybara-checking-list-items/187495)

<div class="topic-metadata">

**Author:** [@wickie](https://www.ruby-forum.com/u/wickie)\
**Replies:** 0\
**Last updated:** [April 24, 2010, 1:10am UTC](https://www.ruby-forum.com/t/cucumber-capybara-checking-list-items/187495 "2010-04-24T01:10:48Z")

</div>

I’m unsure how to check a few things related to lists of items. In this specific case, I have a articles with title and abstract. When there are no articles, I’d like to ensure that there is a list on the page, but th…

---

## [Rack::Test + cookies + rspec](https://www.ruby-forum.com/t/rack-test-cookies-rspec/187067)

<div class="topic-metadata">

**Author:** [@Nicholas\_W](https://www.ruby-forum.com/u/Nicholas_W)\
**Replies:** 6\
**Last updated:** [April 23, 2010, 9:15am UTC](https://www.ruby-forum.com/t/rack-test-cookies-rspec/187067 "2010-04-23T09:15:44Z")

</div>

Hi \*, I need to test cookie creation with rspec and using Rack::Test, but for some reason I’m not able to pair the real app that creates a cookie with the rspec tests. The spec is like this: it “should authenticate …

---

## [Running: 'rake spec' mixes ApplicationHelper into my ActiveRecord model instances](https://www.ruby-forum.com/t/running-rake-spec-mixes-applicationhelper-into-my-activerecord-model-instances/187420)

<div class="topic-metadata">

**Author:** [@stepheneb](https://www.ruby-forum.com/u/stepheneb)\
**Replies:** 1\
**Last updated:** [April 23, 2010, 7:39am UTC](https://www.ruby-forum.com/t/running-rake-spec-mixes-applicationhelper-into-my-activerecord-model-instances/187420 "2010-04-23T07:39:27Z")

</div>

When I run the a controllers spec test on it’s own I get just what I expect. But when I run the same tests with: rake spec I get some strange errors because ApplicationHelper ends up getting mixed into my ActiveRecor…

---

## [Rspec2 - set example as pending?](https://www.ruby-forum.com/t/rspec2-set-example-as-pending/187428)

<div class="topic-metadata">

**Author:** [@jdunneuk](https://www.ruby-forum.com/u/jdunneuk)\
**Replies:** 3\
**Last updated:** [April 23, 2010, 12:30am UTC](https://www.ruby-forum.com/t/rspec2-set-example-as-pending/187428 "2010-04-23T00:30:23Z")

</div>

I’m trying to mark an example as pending w/rspec2 & rails3, but I’m getting: Failure/Error: pending undefined local variable or method \`pending’ for #\<Rspec::Core::ExampleGroup::Nested\_1:0x10a737c50 @\_\_memoized={}\> I…

---

## [Spec-ing delayed\_jobs in the future](https://www.ruby-forum.com/t/spec-ing-delayed-jobs-in-the-future/187418)

<div class="topic-metadata">

**Author:** [@hatless](https://www.ruby-forum.com/u/hatless)\
**Replies:** 0\
**Last updated:** [April 22, 2010, 8:38pm UTC](https://www.ruby-forum.com/t/spec-ing-delayed-jobs-in-the-future/187418 "2010-04-22T20:38:31Z")

</div>

I’ve been looking into rspec-ing delayed\_jobs lately, and I found a few resources on testing jobs that execute right away. But I couldn’t find any that delt with testing a job that is delayed a week in the future, for …

---

## [Request and cookies (rspec2)](https://www.ruby-forum.com/t/request-and-cookies-rspec2/187365)

<div class="topic-metadata">

**Author:** [@seb](https://www.ruby-forum.com/u/seb)\
**Replies:** 0\
**Last updated:** [April 22, 2010, 6:47am UTC](https://www.ruby-forum.com/t/request-and-cookies-rspec2/187365 "2010-04-22T06:47:05Z")

</div>

Hi How do I setg/get cookie value in rspec2? Thanks

---

## [How to --debug rspec2 w/rails3?](https://www.ruby-forum.com/t/how-to-debug-rspec2-w-rails3/187348)

<div class="topic-metadata">

**Author:** [@jdunneuk](https://www.ruby-forum.com/u/jdunneuk)\
**Replies:** 2\
**Last updated:** [April 22, 2010, 1:57am UTC](https://www.ruby-forum.com/t/how-to-debug-rspec2-w-rails3/187348 "2010-04-22T01:57:19Z")

</div>

I’m diving into rails3 and rspec2. Things are a bit rough… New application using RVM w/ruby 1.8.7 p249, Rails (3.0.0.beta3), RSpec (2.0.0.beta.7), ruby-debug (0.10.3), ruby-debug-base (0.10.3) I created a .rspec file…

---

## [Anyone used RSpec to write specs for rake tasks?](https://www.ruby-forum.com/t/anyone-used-rspec-to-write-specs-for-rake-tasks/187198)

<div class="topic-metadata">

**Author:** [@rykkers](https://www.ruby-forum.com/u/rykkers)\
**Replies:** 3\
**Last updated:** [April 20, 2010, 10:16pm UTC](https://www.ruby-forum.com/t/anyone-used-rspec-to-write-specs-for-rake-tasks/187198 "2010-04-20T22:16:20Z")

</div>

I released a new gem this past weekend which adds a new rake task for Jeweler to generate a release announcement. I was lazy and didn’t write any specs, mostly because I couldn’t quickly come up with a reasonably way …

---

## [Speccing the creation of a singleton resource](https://www.ruby-forum.com/t/speccing-the-creation-of-a-singleton-resource/187242)

<div class="topic-metadata">

**Author:** [@nickh](https://www.ruby-forum.com/u/nickh)\
**Replies:** 0\
**Last updated:** [April 20, 2010, 2:37pm UTC](https://www.ruby-forum.com/t/speccing-the-creation-of-a-singleton-resource/187242 "2010-04-20T14:37:16Z")

</div>

Hey guys. I’m writing a Rails gem that’s used by controllers. The gem creates a singleton resource at run-time, along the lines of: controller\_name = …dynamically generated… ActionController::Routing::Routes.draw do |…

---

## [Mocking question](https://www.ruby-forum.com/t/mocking-question/187149)

<div class="topic-metadata">

**Author:** [@Mark\_Nijhof](https://www.ruby-forum.com/u/Mark_Nijhof)\
**Replies:** 1\
**Last updated:** [April 18, 2010, 6:20pm UTC](https://www.ruby-forum.com/t/mocking-question/187149 "2010-04-18T18:20:18Z")

</div>

Hi, I am working on creating something that will monitor some files and do something when they are changed. I am using FSSM for the actual monitoring. Now I want to verify that it gets initialized with the correct pa…

---

## [Writing rails plugins](https://www.ruby-forum.com/t/writing-rails-plugins/187068)

<div class="topic-metadata">

**Author:** [@Nicholas\_W](https://www.ruby-forum.com/u/Nicholas_W)\
**Replies:** 1\
**Last updated:** [April 16, 2010, 9:36pm UTC](https://www.ruby-forum.com/t/writing-rails-plugins/187068 "2010-04-16T21:36:56Z")

</div>

Hi \*, I’m trying to write a plugin to integrate my SSO server into my rails app. I’m finding the whole process quite difficult, I’m still blocked at configuring rspec, and the lack of documentation is not helping. I…

---

## [Spec templates](https://www.ruby-forum.com/t/spec-templates/187023)

<div class="topic-metadata">

**Author:** [@pkoebbe](https://www.ruby-forum.com/u/pkoebbe)\
**Replies:** 2\
**Last updated:** [April 16, 2010, 5:16pm UTC](https://www.ruby-forum.com/t/spec-templates/187023 "2010-04-16T17:16:57Z")

</div>

David et al, Has anyone ever toyed with the idea of templates for specs? I have a relative consistent way of specing models, controllers, etc, and invariably, I have to delete the stock code that the rspec generator …

---

## [Skipping Slow Specs](https://www.ruby-forum.com/t/skipping-slow-specs/187073)

<div class="topic-metadata">

**Author:** [@Douglas\_Campos](https://www.ruby-forum.com/u/Douglas_Campos)\
**Replies:** 1\
**Last updated:** [April 16, 2010, 4:41pm UTC](https://www.ruby-forum.com/t/skipping-slow-specs/187073 "2010-04-16T16:41:47Z")

</div>

Hi! I have a slow spec. Before anyone shouts, it’s an service integration test, that needs the server available. As I don’t have this server near every time, is there an easy way to skip this spec during rake spec / …

---

## [Raise\_error suggestion](https://www.ruby-forum.com/t/raise-error-suggestion/186952)

<div class="topic-metadata">

**Author:** [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Replies:** 3\
**Last updated:** [April 15, 2010, 10:47pm UTC](https://www.ruby-forum.com/t/raise-error-suggestion/186952 "2010-04-15T22:47:58Z")

</div>

I remember reading a post where somebody mentioned something like "sometimes after a refactoring, a test block like lambda { ... }.should raise\_error catches a NoMethodError in error, thus is actually failing, but th…

---

## [State of autospec/test and Rails 3](https://www.ruby-forum.com/t/state-of-autospec-test-and-rails-3/186932)

<div class="topic-metadata">

**Author:** [@Mikel\_L](https://www.ruby-forum.com/u/Mikel_L)\
**Replies:** 2\
**Last updated:** [April 15, 2010, 5:46am UTC](https://www.ruby-forum.com/t/state-of-autospec-test-and-rails-3/186932 "2010-04-15T05:46:21Z")

</div>

Hi all, David, before I begin, thanks for your hard work :slight\_smile: I saw a thread or a blog post, I think it was on your site David, that Autotest is not working with Rails at the moment, circa beta4. Has that s…

---

## [Test spies](https://www.ruby-forum.com/t/test-spies/186806)

<div class="topic-metadata">

**Author:** [@mgreenly](https://www.ruby-forum.com/u/mgreenly)\
**Replies:** 3\
**Last updated:** [April 13, 2010, 4:42pm UTC](https://www.ruby-forum.com/t/test-spies/186806 "2010-04-13T16:42:13Z")

</div>

I’m curious what the current state of test spies in rspec is? What is everyone using for this? not a mock? rr? rspec-spies? I see that spies were going to be added to rspec 1.3.0, but pulled because of a bug (Ligh…

---

## [Colour support in RSpec 1.3 with Spork](https://www.ruby-forum.com/t/colour-support-in-rspec-1-3-with-spork/186851)

<div class="topic-metadata">

**Author:** [@Ashley\_M](https://www.ruby-forum.com/u/Ashley_M)\
**Replies:** 0\
**Last updated:** [April 13, 2010, 12:33pm UTC](https://www.ruby-forum.com/t/colour-support-in-rspec-1-3-with-spork/186851 "2010-04-13T12:33:25Z")

</div>

Hi I can’t find any reference to this being a known issue or not. I’m having to work on a Rails 2.3 project for a bit, so I’m back with RSpec 1.3. I’ve got Spork working and I’m running it with this command: ruby -…

---

## [Autospec exiting without results](https://www.ruby-forum.com/t/autospec-exiting-without-results/183320)

<div class="topic-metadata">

**Author:** [@ddancer](https://www.ruby-forum.com/u/ddancer)\
**Replies:** 5\
**Last updated:** [April 10, 2010, 11:24pm UTC](https://www.ruby-forum.com/t/autospec-exiting-without-results/183320 "2010-04-10T23:24:15Z")

</div>

Hi, trying to get autospec working on a new Mac (snow lep) but when running autospec on cmd it just exists with no result or output of any kind rake spec runs all tests as expected I’ve followed the Rspec wiki and l…

---

## [Autospec doesn't run any files](https://www.ruby-forum.com/t/autospec-doesnt-run-any-files/186663)

<div class="topic-metadata">

**Author:** [@Adman65](https://www.ruby-forum.com/u/Adman65)\
**Replies:** 0\
**Last updated:** [April 10, 2010, 11:16pm UTC](https://www.ruby-forum.com/t/autospec-doesnt-run-any-files/186663 "2010-04-10T23:16:02Z")

</div>

I’m trying to use autospec and when I run it i see this: Mini:crm adam$ autospec (Not running features. To run features in autotest, set AUTOFEATURE=true.) (Not running features. To run features in autotest, set A…

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

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