# RSpec

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

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

---

## [Should have\_tag outside Rails](https://www.ruby-forum.com/t/should-have-tag-outside-rails/132166)

<div class="topic-metadata">

**Author:** [@Ashley\_M](https://www.ruby-forum.com/u/Ashley_M)\
**Replies:** 8\
**Last updated:** [March 18, 2008, 3:08pm UTC](https://www.ruby-forum.com/t/should-have-tag-outside-rails/132166 "2008-03-18T15:08:40Z")

</div>

Hi Google has not helped me here. I’m looking for a way to use the have\_tag assert\_select wrapper outside RSpec on Rails (but in a Rails project) so I can use it to check text strings. Has anyone managed this? Th…

---

## [RSpec and RCov with JRuby](https://www.ruby-forum.com/t/rspec-and-rcov-with-jruby/132151)

<div class="topic-metadata">

**Author:** [@Tobias\_T](https://www.ruby-forum.com/u/Tobias_T)\
**Replies:** 10\
**Last updated:** [March 17, 2008, 10:16pm UTC](https://www.ruby-forum.com/t/rspec-and-rcov-with-jruby/132151 "2008-03-17T22:16:47Z")

</div>

Hi, I am using JRuby (trunk) and wrote a bunch of specifications for my code. Everything works fine so far. Now I am trying to integrate RCov in my test run. I have installed RCov without the C extensions. I tried it…

---

## [Branching scenarios, GivenScenario and database](https://www.ruby-forum.com/t/branching-scenarios-givenscenario-and-database/131983)

<div class="topic-metadata">

**Author:** [@rykkers](https://www.ruby-forum.com/u/rykkers)\
**Replies:** 5\
**Last updated:** [March 17, 2008, 9:14pm UTC](https://www.ruby-forum.com/t/branching-scenarios-givenscenario-and-database/131983 "2008-03-17T21:14:38Z")

</div>

I’m trying to use stories to drive some high-level design. I’ve got some branching scenarios where I want to follow a scenario, to establish a base situation, and then have different scenarios which ‘branch’ out from …

---

## [Shouldn't should return true?](https://www.ruby-forum.com/t/shouldnt-should-return-true/132198)

<div class="topic-metadata">

**Author:** [@nzook](https://www.ruby-forum.com/u/nzook)\
**Replies:** 1\
**Last updated:** [March 17, 2008, 9:00pm UTC](https://www.ruby-forum.com/t/shouldnt-should-return-true/132198 "2008-03-17T21:00:12Z")

</div>

'cause it doesn’t… This is an issue for nested custom matchers, ie: module CRFT class RFT def initialize(args) blah end def matches?(target) “Yeah, baby!” end end def r\_f\_t(args) RFT.new(args) end end modu…

---

## [RSpec'ing model association callbacks](https://www.ruby-forum.com/t/rspecing-model-association-callbacks/132140)

<div class="topic-metadata">

**Author:** [@roberto\_belardo](https://www.ruby-forum.com/u/roberto_belardo)\
**Replies:** 4\
**Last updated:** [March 17, 2008, 12:31pm UTC](https://www.ruby-forum.com/t/rspecing-model-association-callbacks/132140 "2008-03-17T12:31:33Z")

</div>

Hi all, i’m learning rspec and i must admit i really love it. But at the time i started learning it, i already developed my models classes and their callbacks. Now i’m trying to get a 100% coverage of my code but i …

---

## [Lib Specs and config.use\_transactional\_fixtures = true](https://www.ruby-forum.com/t/lib-specs-and-config-use-transactional-fixtures-true/131880)

<div class="topic-metadata">

**Author:** [@codejoy](https://www.ruby-forum.com/u/codejoy)\
**Replies:** 2\
**Last updated:** [March 17, 2008, 5:10am UTC](https://www.ruby-forum.com/t/lib-specs-and-config-use-transactional-fixtures-true/131880 "2008-03-17T05:10:35Z")

</div>

Hi We have specs in our rails project other than model/view/controller … we have interests and lib … using use\_transactional\_fixtures = true seems fine in a spec in the m/ v/c and interests directories but not in lib …

---

## [\[HELP\]No :secret given to the #protect\_from\_forgery call](https://www.ruby-forum.com/t/help-no-secret-given-to-the-protect-from-forgery-call/132042)

<div class="topic-metadata">

**Author:** [@Camilo\_T](https://www.ruby-forum.com/u/Camilo_T)\
**Replies:** 3\
**Last updated:** [March 16, 2008, 3:27pm UTC](https://www.ruby-forum.com/t/help-no-secret-given-to-the-protect-from-forgery-call/132042 "2008-03-16T15:27:43Z")

</div>

I am starting to BDD. When specing the controller I want to test for object creation: it “deberia crear una nueva persona en post create” do Usuario.should\_receive(:create).with({:nombre =\> “camilo”, :clave =\> “secre…

---

## [Corrupt rspec\_on\_rails tar file?](https://www.ruby-forum.com/t/corrupt-rspec-on-rails-tar-file/132064)

<div class="topic-metadata">

**Author:** [@Mikel\_L](https://www.ruby-forum.com/u/Mikel_L)\
**Replies:** 0\
**Last updated:** [March 16, 2008, 8:44am UTC](https://www.ruby-forum.com/t/corrupt-rspec-on-rails-tar-file/132064 "2008-03-16T08:44:41Z")

</div>

I just downloaded rspec\_on\_rails-1.1.3.tgz onto a mac on OSX 10.4 and another computer (Ubuntu 7.10) and I get the same tar errors when I try to decompress: rspec\_on\_rails-1.1.3/spec\_resources/views/view\_spec/implicit…

---

## [Disabling a set of tests?](https://www.ruby-forum.com/t/disabling-a-set-of-tests/131955)

<div class="topic-metadata">

**Author:** [@combray](https://www.ruby-forum.com/u/combray)\
**Replies:** 2\
**Last updated:** [March 15, 2008, 2:23am UTC](https://www.ruby-forum.com/t/disabling-a-set-of-tests/131955 "2008-03-15T02:23:33Z")

</div>

Hi all, Part of the integration test suite involves running against a sandbox on Paypal’s server. Lately that server’s been acting flakely. It doesn’t fail all the time, but enough to confuse people. I made pending…

---

## [Tutes on testing controllers](https://www.ruby-forum.com/t/tutes-on-testing-controllers/131544)

<div class="topic-metadata">

**Author:** [@ol1barn3s](https://www.ruby-forum.com/u/ol1barn3s)\
**Replies:** 10\
**Last updated:** [March 14, 2008, 6:31pm UTC](https://www.ruby-forum.com/t/tutes-on-testing-controllers/131544 "2008-03-14T18:31:52Z")

</div>

hello spec’ers, i’m in the hunt for guides on testing controllers with rspec, would you guys recommend any? thanks Oliver – Oliver Azevedo Barnes removed\_email\_address@domain.invalid +55 11 9768 0193 http://www.…

---

## [Problems with form\_for and partials](https://www.ruby-forum.com/t/problems-with-form-for-and-partials/117807)

<div class="topic-metadata">

**Author:** [@rsl](https://www.ruby-forum.com/u/rsl)\
**Replies:** 14\
**Last updated:** [March 14, 2008, 4:49pm UTC](https://www.ruby-forum.com/t/problems-with-form-for-and-partials/117807 "2008-03-14T16:49:30Z")

</div>

i’m having problem with a form\_for situation where i’m trying to DRY out the repeated parts of my forms and put them in common/form and render the form elements via another partial in controller\_name/\_form. Here’s the…

---

## [Adding before / after blocks to every spec](https://www.ruby-forum.com/t/adding-before-after-blocks-to-every-spec/131942)

<div class="topic-metadata">

**Author:** [@stevetooke](https://www.ruby-forum.com/u/stevetooke)\
**Replies:** 0\
**Last updated:** [March 14, 2008, 4:41pm UTC](https://www.ruby-forum.com/t/adding-before-after-blocks-to-every-spec/131942 "2008-03-14T16:41:52Z")

</div>

Folks, I was wondering if someone would be able to help me out with a quandry. I’m trying to write an rspec plugin module for merb that will run all specs within an ActiveRecord (initially) database transaction - to …

---

## [Multiple should\_receive(:render).with](https://www.ruby-forum.com/t/multiple-should-receive-render-with/131924)

<div class="topic-metadata">

**Author:** [@Alan\_Larkin](https://www.ruby-forum.com/u/Alan_Larkin)\
**Replies:** 2\
**Last updated:** [March 14, 2008, 2:22pm UTC](https://www.ruby-forum.com/t/multiple-should-receive-render-with/131924 "2008-03-14T14:22:22Z")

</div>

I’m trying to specify that a particular view must render two different partials. My spec looks like: describe AClass do it do template.should\_receive(:render).with(:partial =\> ‘foo’, :locals =\> { … }) … end desc…

---

## [Story testing views in isolation](https://www.ruby-forum.com/t/story-testing-views-in-isolation/131535)

<div class="topic-metadata">

**Author:** [@visage](https://www.ruby-forum.com/u/visage)\
**Replies:** 6\
**Last updated:** [March 14, 2008, 12:01pm UTC](https://www.ruby-forum.com/t/story-testing-views-in-isolation/131535 "2008-03-14T12:01:10Z")

</div>

Hi, I’ve been investigating plain text stories, and I had a quick question. How would I go about creating story tests for views in isolation, instead of the full stack? I had hoped to be able to do a straight render…

---

## [Equivalent to before(:all) for StepGroups?](https://www.ruby-forum.com/t/equivalent-to-before-all-for-stepgroups/131856)

<div class="topic-metadata">

**Author:** [@Jay\_McGavren](https://www.ruby-forum.com/u/Jay_McGavren)\
**Replies:** 0\
**Last updated:** [March 13, 2008, 9:45pm UTC](https://www.ruby-forum.com/t/equivalent-to-before-all-for-stepgroups/131856 "2008-03-13T21:45:46Z")

</div>

I have a helper object that I’d like to have available inside each of my story steps, but would like to declare it outside all the steps. (It knows how to create various objects in my library, then stores a string ref…

---

## [Stories (well, integration tests) which aren't plain text](https://www.ruby-forum.com/t/stories-well-integration-tests-which-arent-plain-text/131827)

<div class="topic-metadata">

**Author:** [@rhalff](https://www.ruby-forum.com/u/rhalff)\
**Replies:** 3\
**Last updated:** [March 13, 2008, 5:40pm UTC](https://www.ruby-forum.com/t/stories-well-integration-tests-which-arent-plain-text/131827 "2008-03-13T17:40:02Z")

</div>

Hi, Having just played with getting my first plain text story working, I like how it all fits together. It worked out nicely. However, I don’t feel our project needs to have stories as plain text, in fact it’s a slig…

---

## [Warning: integrate\_views and nested description groups](https://www.ruby-forum.com/t/warning-integrate-views-and-nested-description-groups/131738)

<div class="topic-metadata">

**Author:** [@nzook](https://www.ruby-forum.com/u/nzook)\
**Replies:** 2\
**Last updated:** [March 13, 2008, 1:42pm UTC](https://www.ruby-forum.com/t/warning-integrate-views-and-nested-description-groups/131738 "2008-03-13T13:42:28Z")

</div>

describe MyController do integrate\_views describe “A common base senario” do it “no longer integrates views” do be\_careful end end end integrate\_views affects an attribute in the class formed by the describe fac…

---

## [Re: running a specific describe block](https://www.ruby-forum.com/t/re-running-a-specific-describe-block/131714)

<div class="topic-metadata">

**Author:** [@bloc](https://www.ruby-forum.com/u/bloc)\
**Replies:** 2\
**Last updated:** [March 12, 2008, 10:16pm UTC](https://www.ruby-forum.com/t/re-running-a-specific-describe-block/131714 "2008-03-12T22:16:47Z")

</div>

This doesn’t work for me on 1.1.3 I have something like this: describe Support do describe “attached image” do it “should validate presence of attachment” do # test stuff … end it "should validate that attachmen…

---

## [Testing helper methods in rspec](https://www.ruby-forum.com/t/testing-helper-methods-in-rspec/131696)

<div class="topic-metadata">

**Author:** [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Replies:** 1\
**Last updated:** [March 12, 2008, 6:07pm UTC](https://www.ruby-forum.com/t/testing-helper-methods-in-rspec/131696 "2008-03-12T18:07:14Z")

</div>

This is perhaps a naive question, but what is the recommended manner of testing a helper method in rspec? I have created a simple string manipulation function and I want to write some tests for it. It it were a scri…

---

## [RSpec view test for :partial with :locals?](https://www.ruby-forum.com/t/rspec-view-test-for-partial-with-locals/131648)

<div class="topic-metadata">

**Author:** [@davidstokar](https://www.ruby-forum.com/u/davidstokar)\
**Replies:** 2\
**Last updated:** [March 12, 2008, 2:24pm UTC](https://www.ruby-forum.com/t/rspec-view-test-for-partial-with-locals/131648 "2008-03-12T14:24:53Z")

</div>

I’m currently working on some RSpec view tests and I’m having problems with expect\_render. Most of the expect\_render’s work fine, but in one of my views I have: \<%= render :partial =\> “user\_cloud”, :locals =\> {:user …

---

## [Running a specific describe block](https://www.ruby-forum.com/t/running-a-specific-describe-block/130611)

<div class="topic-metadata">

**Author:** [@bloc](https://www.ruby-forum.com/u/bloc)\
**Replies:** 1\
**Last updated:** [March 12, 2008, 5:27am UTC](https://www.ruby-forum.com/t/running-a-specific-describe-block/130611 "2008-03-12T05:27:05Z")

</div>

I use a lot of nested describe blocks and am wondering if there is a way to run a specific describe block similar to the -e option for running specific examples. Jay \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_…

---

## [\[ANN\] RSpactor 0.0.2 : autorun your spec files](https://www.ruby-forum.com/t/ann-rspactor-0-0-2-autorun-your-spec-files/131622)

<div class="topic-metadata">

**Author:** [@rubyphunk](https://www.ruby-forum.com/u/rubyphunk)\
**Replies:** 0\
**Last updated:** [March 11, 2008, 11:31pm UTC](https://www.ruby-forum.com/t/ann-rspactor-0-0-2-autorun-your-spec-files/131622 "2008-03-11T23:31:33Z")

</div>

Hi all. I want to introduce RSpactor and its “draft” release 0.2.0. RSpactor is a little command line tool to automatically run your changed specs (much like autotest). As you may expect, it concentrates on the use of…

---

## [For a beginner - good rspec examples?](https://www.ruby-forum.com/t/for-a-beginner-good-rspec-examples/131576)

<div class="topic-metadata">

**Author:** [@Daniel\_Kehoe](https://www.ruby-forum.com/u/Daniel_Kehoe)\
**Replies:** 2\
**Last updated:** [March 11, 2008, 11:22pm UTC](https://www.ruby-forum.com/t/for-a-beginner-good-rspec-examples/131576 "2008-03-11T23:22:43Z")

</div>

I’m learning to use rspec and I want to see some good examples. Any recommendations of open source projects that demonstrate the use of rspec? So far I’ve found: the Caboose sample app (http://sample.caboo.se/) t…

---

## [\[Stories\]Changes in the database not taken into account](https://www.ruby-forum.com/t/stories-changes-in-the-database-not-taken-into-account/131578)

<div class="topic-metadata">

**Author:** [@bastien-vaucher](https://www.ruby-forum.com/u/bastien-vaucher)\
**Replies:** 0\
**Last updated:** [March 11, 2008, 3:32pm UTC](https://www.ruby-forum.com/t/stories-changes-in-the-database-not-taken-into-account/131578 "2008-03-11T15:32:47Z")

</div>

I have these scenarios : Story: Filling a profile As a user I want to fill a profile So that I can see my score Scenario: Starting a new profile ...\* And 3 questions ...\* When the user answers a question Then ther…

---

## [View spec on rails questions](https://www.ruby-forum.com/t/view-spec-on-rails-questions/131537)

<div class="topic-metadata">

**Author:** [@johanatan](https://www.ruby-forum.com/u/johanatan)\
**Replies:** 1\
**Last updated:** [March 11, 2008, 2:31pm UTC](https://www.ruby-forum.com/t/view-spec-on-rails-questions/131537 "2008-03-11T14:31:56Z")

</div>

Hi I have a couple of questions how do you test the response inside a content\_for block I see reference to it in the release notes but dont know where to find it (tried http://rspec.info/rdoc-rails/ ) I dont…

---

## [Composed Stories/Scenarios](https://www.ruby-forum.com/t/composed-stories-scenarios/131567)

<div class="topic-metadata">

**Author:** [@rykkers](https://www.ruby-forum.com/u/rykkers)\
**Replies:** 2\
**Last updated:** [March 11, 2008, 2:31pm UTC](https://www.ruby-forum.com/t/composed-stories-scenarios/131567 "2008-03-11T14:31:56Z")

</div>

In using stories, I find myself wanting to build scenarios on top of each other, For example I want something like Scenario: The user logs on Given a And b When c And d Then e And f Scenario: The user changes …

---

## [Session empty after request](https://www.ruby-forum.com/t/session-empty-after-request/131352)

<div class="topic-metadata">

**Author:** [@steve](https://www.ruby-forum.com/u/steve)\
**Replies:** 1\
**Last updated:** [March 9, 2008, 10:12pm UTC](https://www.ruby-forum.com/t/session-empty-after-request/131352 "2008-03-09T22:12:03Z")

</div>

Can anyone tell me what I’m doing wrong here? it ‘should try to set the current user from the session’ do controller.session\[SessionKeys::USER\_ID\] = 1 user = mock\_model(User) User.stub!(:find).and\_return(user) User.…

---

## [Ridding away with do\_request](https://www.ruby-forum.com/t/ridding-away-with-do-request/131371)

<div class="topic-metadata">

**Author:** [@zdennis](https://www.ruby-forum.com/u/zdennis)\
**Replies:** 7\
**Last updated:** [March 9, 2008, 7:48pm UTC](https://www.ruby-forum.com/t/ridding-away-with-do-request/131371 "2008-03-09T19:48:33Z")

</div>

I’m heading out of town, but had a quick thought I wanted to share. Rather then using ambiguous named request helpers in controller specs like “do\_request”, I’ve been using more readable helpers like “post\_create”. F…

---

## [Should\_receive(:foo).with(any\_object)](https://www.ruby-forum.com/t/should-receive-foo-with-any-object/131375)

<div class="topic-metadata">

**Author:** [@Thorben\_SchrSSSSder](https://www.ruby-forum.com/u/Thorben_SchrSSSSder)\
**Replies:** 3\
**Last updated:** [March 9, 2008, 1:43am UTC](https://www.ruby-forum.com/t/should-receive-foo-with-any-object/131375 "2008-03-09T01:43:28Z")

</div>

Hey, I just ran into a situation where I would like to expect a method call with an argument I know and another one, which is a random number. I think mocking up the rand method is somehow ugly so I thought maybe thi…

---

## [BDD Google Mailing list](https://www.ruby-forum.com/t/bdd-google-mailing-list/131356)

<div class="topic-metadata">

**Author:** [@objo](https://www.ruby-forum.com/u/objo)\
**Replies:** 0\
**Last updated:** [March 8, 2008, 6:41pm UTC](https://www.ruby-forum.com/t/bdd-google-mailing-list/131356 "2008-03-08T18:41:19Z")

</div>

Hi everyone, We went ahead a created a BDD mailing list in Google to talk towards BDD and how it can be applied to just software development in general (language agnostic). We try to mediate the usage of language sy…

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

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