# RSpec

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

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

---

## [Newbq: Organizing your stories](https://www.ruby-forum.com/t/newbq-organizing-your-stories/134466)

<div class="topic-metadata">

**Author:** [@timhunter](https://www.ruby-forum.com/u/timhunter)\
**Replies:** 6\
**Last updated:** [April 11, 2008, 2:15pm UTC](https://www.ruby-forum.com/t/newbq-organizing-your-stories/134466 "2008-04-11T14:15:59Z")

</div>

Hi, I’m a little unhappy with how my stories are organised, and am wondering if anyone has found any particular method nicest. I’m working within an admin namespace, and currently have a plain text story file for e…

---

## [Multi-line steps](https://www.ruby-forum.com/t/multi-line-steps/134273)

<div class="topic-metadata">

**Author:** [@Ashley\_M](https://www.ruby-forum.com/u/Ashley_M)\
**Replies:** 20\
**Last updated:** [April 11, 2008, 4:08am UTC](https://www.ruby-forum.com/t/multi-line-steps/134273 "2008-04-11T04:08:09Z")

</div>

Hi I just wondered what the plan was for multi-line steps. Is anyone working on it? I’ve just come across a real use for it (including small text files in the story). Cheers Ashley – http://www.patchspace.co.uk/ …

---

## [Mock\_model](https://www.ruby-forum.com/t/mock-model/134435)

<div class="topic-metadata">

**Author:** [@anthonybaker](https://www.ruby-forum.com/u/anthonybaker)\
**Replies:** 4\
**Last updated:** [April 11, 2008, 12:22am UTC](https://www.ruby-forum.com/t/mock-model/134435 "2008-04-11T00:22:28Z")

</div>

Our company just had an interesting conversation around mock\_model and I want to ask the same question to this audience. When creating mock\_models what is the purpose of passing in the class constant? user = mock\_mod…

---

## [Rspec at github](https://www.ruby-forum.com/t/rspec-at-github/134310)

<div class="topic-metadata">

**Author:** [@crucoba](https://www.ruby-forum.com/u/crucoba)\
**Replies:** 5\
**Last updated:** [April 10, 2008, 9:02pm UTC](https://www.ruby-forum.com/t/rspec-at-github/134310 "2008-04-10T21:02:03Z")

</div>

It’s official: http://tinyurl.com/5npxxb Git some happiness! Cheers, David

---

## [Rspec SQLException problem](https://www.ruby-forum.com/t/rspec-sqlexception-problem/134234)

<div class="topic-metadata">

**Author:** [@win](https://www.ruby-forum.com/u/win)\
**Replies:** 1\
**Last updated:** [April 10, 2008, 4:36am UTC](https://www.ruby-forum.com/t/rspec-sqlexception-problem/134234 "2008-04-10T04:36:22Z")

</div>

hello: I just installed rspec 1.1.3 by doing this: gem install rspec and then in the root of my project, I did this: ruby script/plugin install svn://rubyforge.org/var/svn/rspec/tags/CURRENT/rspec\_on\_rails And now,…

---

## [Command line story runner](https://www.ruby-forum.com/t/command-line-story-runner/133791)

<div class="topic-metadata">

**Author:** [@kyleh](https://www.ruby-forum.com/u/kyleh)\
**Replies:** 6\
**Last updated:** [April 9, 2008, 10:59pm UTC](https://www.ruby-forum.com/t/command-line-story-runner/133791 "2008-04-09T22:59:33Z")

</div>

Hullo all, It sucks to write wrapper .rb files just so stories/all.rb can find and run them. So I am trawling for feedback on a small project I pushed to github a day or two ago; it provides a ‘story’ executable that…

---

## [Specifing methods in a steps\_for block](https://www.ruby-forum.com/t/specifing-methods-in-a-steps-for-block/131811)

<div class="topic-metadata">

**Author:** [@bartz](https://www.ruby-forum.com/u/bartz)\
**Replies:** 22\
**Last updated:** [April 9, 2008, 10:55pm UTC](https://www.ruby-forum.com/t/specifing-methods-in-a-steps-for-block/131811 "2008-04-09T22:55:25Z")

</div>

Hey list, I’m refactoring some much-used functionality into a common\_steps step group. Methods like this are in there: steps\_for :common do Given “a number of existing $types?” do |type| @initial\_item\_count = type.s…

---

## [What is the best way to verify that yield is called?](https://www.ruby-forum.com/t/what-is-the-best-way-to-verify-that-yield-is-called/134235)

<div class="topic-metadata">

**Author:** [@glenatron](https://www.ruby-forum.com/u/glenatron)\
**Replies:** 7\
**Last updated:** [April 9, 2008, 8:11pm UTC](https://www.ruby-forum.com/t/what-is-the-best-way-to-verify-that-yield-is-called/134235 "2008-04-09T20:11:13Z")

</div>

Hello all, What is the best way to verify that a method yields a block that is passed in? Before I added any ‘yield’ to my method I created this spec: it "should yield a message\_delivery object" do create\_messa…

---

## [Testing with has\_many associations](https://www.ruby-forum.com/t/testing-with-has-many-associations/134236)

<div class="topic-metadata">

**Author:** [@andy](https://www.ruby-forum.com/u/andy)\
**Replies:** 4\
**Last updated:** [April 9, 2008, 3:26pm UTC](https://www.ruby-forum.com/t/testing-with-has-many-associations/134236 "2008-04-09T15:26:54Z")

</div>

Hi I’m trying to be good and practice full BDD on my current project, and don’t want to abandon it as I have previously (expediency triumphed unfortunately). So expect me to be making frequent ‘noob’ style posts… My c…

---

## [I can haz buk?](https://www.ruby-forum.com/t/i-can-haz-buk/134226)

<div class="topic-metadata">

**Author:** [@katrash](https://www.ruby-forum.com/u/katrash)\
**Replies:** 3\
**Last updated:** [April 9, 2008, 4:42am UTC](https://www.ruby-forum.com/t/i-can-haz-buk/134226 "2008-04-09T04:42:22Z")

</div>

David, Aslak, Any word on the most eagerly anticipated book ever? /g – George A. BenevolentCode LLC

---

## [How to mock/stub restful\_authenticated and acl2-ized actions](https://www.ruby-forum.com/t/how-to-mock-stub-restful-authenticated-and-acl2-ized-actions/134168)

<div class="topic-metadata">

**Author:** [@giuseb](https://www.ruby-forum.com/u/giuseb)\
**Replies:** 5\
**Last updated:** [April 9, 2008, 4:10am UTC](https://www.ruby-forum.com/t/how-to-mock-stub-restful-authenticated-and-acl2-ized-actions/134168 "2008-04-09T04:10:38Z")

</div>

Dear all, I am wondering how to properly mock/stub out the preliminary steps to actions protected by restful\_authentication and acl\_system2 (role-based authorization to execute actions). Here’s my setup: class User \< …

---

## [Autotest RSpec Not Running on Model Save's?](https://www.ruby-forum.com/t/autotest-rspec-not-running-on-model-saves/133826)

<div class="topic-metadata">

**Author:** [@FischerS\_Daniel](https://www.ruby-forum.com/u/FischerS_Daniel)\
**Replies:** 2\
**Last updated:** [April 9, 2008, 3:21am UTC](https://www.ruby-forum.com/t/autotest-rspec-not-running-on-model-saves/133826 "2008-04-09T03:21:28Z")

</div>

If I save my model while autotest is running, autotest doesn’t run the model’s specs, all I get in my window is /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -S script/spec -O spec/spec.opts How…

---

## [Rspecing this simple controller it is driving me mad](https://www.ruby-forum.com/t/rspecing-this-simple-controller-it-is-driving-me-mad/134004)

<div class="topic-metadata">

**Author:** [@roberto\_belardo](https://www.ruby-forum.com/u/roberto_belardo)\
**Replies:** 6\
**Last updated:** [April 8, 2008, 10:44pm UTC](https://www.ruby-forum.com/t/rspecing-this-simple-controller-it-is-driving-me-mad/134004 "2008-04-08T22:44:38Z")

</div>

Hi all, here i am again with this stupid problem in rspecing this controller action: CommentsController def create @comment = Comment.new(params\[:comment\]) @user = User.find(params\[:user\_id\]) \[16\] @comment.autho…

---

## [Can you add an option to select the ruby interpreter for rake task?](https://www.ruby-forum.com/t/can-you-add-an-option-to-select-the-ruby-interpreter-for-rake-task/134182)

<div class="topic-metadata">

**Author:** [@Chiyuan\_Z](https://www.ruby-forum.com/u/Chiyuan_Z)\
**Replies:** 2\
**Last updated:** [April 8, 2008, 6:38pm UTC](https://www.ruby-forum.com/t/can-you-add-an-option-to-select-the-ruby-interpreter-for-rake-task/134182 "2008-04-08T18:38:33Z")

</div>

Hi all, My problem is that I’ve installed both ruby 1.8 (as ruby) and ruby 1.9 (as ruby1.9) on my system. I use spec/rake/spectask for my Rakefile. But the generated command is ruby -I… blabla it should be “ruby1.9 …

---

## [TextMate bundle not using environment variable to find Ruby library](https://www.ruby-forum.com/t/textmate-bundle-not-using-environment-variable-to-find-ruby-library/134165)

<div class="topic-metadata">

**Author:** [@SoManyFishes](https://www.ruby-forum.com/u/SoManyFishes)\
**Replies:** 0\
**Last updated:** [April 8, 2008, 3:37pm UTC](https://www.ruby-forum.com/t/textmate-bundle-not-using-environment-variable-to-find-ruby-library/134165 "2008-04-08T15:37:25Z")

</div>

Something is going on in my TextMate bundle–it’s calling the wrong lib for Ruby. I have the environment variables set like this: TM\_RSPEC\_HOME /usr/local/lib/ruby/gems/1.8/gems/rspec-1.1.3 TM\_RUBY /usr/local/bin/ru…

---

## [rSpec, Selenium and screenshots](https://www.ruby-forum.com/t/rspec-selenium-and-screenshots/134156)

<div class="topic-metadata">

**Author:** [@bartz](https://www.ruby-forum.com/u/bartz)\
**Replies:** 5\
**Last updated:** [April 8, 2008, 2:09pm UTC](https://www.ruby-forum.com/t/rspec-selenium-and-screenshots/134156 "2008-04-08T14:09:58Z")

</div>

Hey list, I’m currently playing with the selenium acceptance test-thingies, and I want to build something that saves a screenshot when a test fails. However, I have no clue whatsoever where to implement this. I’m thi…

---

## [Rspec controller action list](https://www.ruby-forum.com/t/rspec-controller-action-list/130447)

<div class="topic-metadata">

**Author:** [@namrata](https://www.ruby-forum.com/u/namrata)\
**Replies:** 14\
**Last updated:** [April 8, 2008, 1:36pm UTC](https://www.ruby-forum.com/t/rspec-controller-action-list/130447 "2008-04-08T13:36:21Z")

</div>

This action will list all the articles according to city. Please, can some one guide me through this spec. def list @articles = find\_city.articles.paginate :all, :page =\> params\[:page\] , :order =\> “live\_on DESC”, :…

---

## [Need some help with a simple](https://www.ruby-forum.com/t/need-some-help-with-a-simple/134113)

<div class="topic-metadata">

**Author:** [@sumwutdum](https://www.ruby-forum.com/u/sumwutdum)\
**Replies:** 2\
**Last updated:** [April 7, 2008, 11:54pm UTC](https://www.ruby-forum.com/t/need-some-help-with-a-simple/134113 "2008-04-07T23:54:48Z")

</div>

I can’t figure out why this is failing. It seems to have a hard time assigning the @account. I have spent way too long trying to figure this out. Thanks for any help. NoMethodError in ‘StaffMembersController GET i…

---

## [Why do I have to require\_dependency here?](https://www.ruby-forum.com/t/why-do-i-have-to-require-dependency-here/134101)

<div class="topic-metadata">

**Author:** [@Ashley\_M](https://www.ruby-forum.com/u/Ashley_M)\
**Replies:** 3\
**Last updated:** [April 7, 2008, 10:32pm UTC](https://www.ruby-forum.com/t/why-do-i-have-to-require-dependency-here/134101 "2008-04-07T22:32:26Z")

</div>

Hi This was bugging the hell out of me until I found a fix just. I have been getting reams and reams of errors from reference to one model class in a controller spec. Here’s one of the 57 that go wrong: LoadErr…

---

## [Haml and View tests](https://www.ruby-forum.com/t/haml-and-view-tests/134082)

<div class="topic-metadata">

**Author:** [@chrisolsen](https://www.ruby-forum.com/u/chrisolsen)\
**Replies:** 0\
**Last updated:** [April 7, 2008, 6:17pm UTC](https://www.ruby-forum.com/t/haml-and-view-tests/134082 "2008-04-07T18:17:34Z")

</div>

Does Rspec work nicely with Haml for controller integrated view tests? I am getting the following error: ActionView::TemplateError in ‘Admin::ListingsController index should get a 200 OK’ undefined method \`photo’ for …

---

## [How should i test this code with rspec](https://www.ruby-forum.com/t/how-should-i-test-this-code-with-rspec/134074)

<div class="topic-metadata">

**Author:** [@nathan.wu](https://www.ruby-forum.com/u/nathan.wu)\
**Replies:** 1\
**Last updated:** [April 7, 2008, 5:08pm UTC](https://www.ruby-forum.com/t/how-should-i-test-this-code-with-rspec/134074 "2008-04-07T17:08:48Z")

</div>

ids = Category.find(:all).map(&:id) ids = mock(‘ids’) Category.should\_receive(:find).with(all).and\_return(??) and what’s the difference between mock and mock\_model when should i use mock and mock\_model

---

## [Comparing new models](https://www.ruby-forum.com/t/comparing-new-models/134069)

<div class="topic-metadata">

**Author:** [@Rare](https://www.ruby-forum.com/u/Rare)\
**Replies:** 1\
**Last updated:** [April 7, 2008, 4:52pm UTC](https://www.ruby-forum.com/t/comparing-new-models/134069 "2008-04-07T16:52:14Z")

</div>

Hi all, I am trying to test that a view file in Rails is being sent a new empty model (Product.new) in my rspec test, below is my code. I’ve tried comparing them with ==, ===, equal, eql none work. I just get an erro…

---

## [Using Haml for view tests](https://www.ruby-forum.com/t/using-haml-for-view-tests/134067)

<div class="topic-metadata">

**Author:** [@Joe\_F](https://www.ruby-forum.com/u/Joe_F)\
**Replies:** 1\
**Last updated:** [April 7, 2008, 4:43pm UTC](https://www.ruby-forum.com/t/using-haml-for-view-tests/134067 "2008-04-07T16:43:21Z")

</div>

I’m writing a view test and I render index.html.haml. However, autotest does not pick up changes to this file, but more importantly, when the tests do run I get my Haml source displayed in the “actual” result, instea…

---

## [Netbeans and .story files](https://www.ruby-forum.com/t/netbeans-and-story-files/133420)

<div class="topic-metadata">

**Author:** [@Ashley\_M](https://www.ruby-forum.com/u/Ashley_M)\
**Replies:** 11\
**Last updated:** [April 7, 2008, 4:38pm UTC](https://www.ruby-forum.com/t/netbeans-and-story-files/133420 "2008-04-07T16:38:38Z")

</div>

Hi Is anyone here using NetBeans and story runner? NB doesn’t recognise .story files so I can’t even do simple things like block commenting lines (and the regex replace is temperamental). I tried adding .story to …

---

## [How to loadby by alphabetical order, not mtime](https://www.ruby-forum.com/t/how-to-loadby-by-alphabetical-order-not-mtime/134066)

<div class="topic-metadata">

**Author:** [@aginghipster](https://www.ruby-forum.com/u/aginghipster)\
**Replies:** 1\
**Last updated:** [April 7, 2008, 4:33pm UTC](https://www.ruby-forum.com/t/how-to-loadby-by-alphabetical-order-not-mtime/134066 "2008-04-07T16:33:49Z")

</div>

Hi, I’m writing my requirements in rspec, however, I can not figure out a way to execute all specs according to alphabetical order, not by last modified time. According to the documentation, it seems like the default…

---

## [Is loadby file name order not implemented or not working? - want to run tests in file name order, no](https://www.ruby-forum.com/t/is-loadby-file-name-order-not-implemented-or-not-working-want-to-run-tests-in-file-name-order-no/134065)

<div class="topic-metadata">

**Author:** [@aginghipster](https://www.ruby-forum.com/u/aginghipster)\
**Replies:** 0\
**Last updated:** [April 7, 2008, 4:33pm UTC](https://www.ruby-forum.com/t/is-loadby-file-name-order-not-implemented-or-not-working-want-to-run-tests-in-file-name-order-no/134065 "2008-04-07T16:33:48Z")

</div>

Hi, I’m writing my requirements in rspec, however, I can not figure out a way to execute all specs according to alphabetical order, not by last modified time. According to the documentation, it seems like the default…

---

## [Welcome Pat Maddox](https://www.ruby-forum.com/t/welcome-pat-maddox/133870)

<div class="topic-metadata">

**Author:** [@crucoba](https://www.ruby-forum.com/u/crucoba)\
**Replies:** 10\
**Last updated:** [April 7, 2008, 4:32pm UTC](https://www.ruby-forum.com/t/welcome-pat-maddox/133870 "2008-04-07T16:32:02Z")

</div>

Hi all, I’m pleased to announce that Pat M. is joining the RSpec Development Team. As you may already know, Pat has been contributing great patches and participation on the rspec-users and rspec-devel mailing lists f…

---

## [How can you delete unused view helper files?](https://www.ruby-forum.com/t/how-can-you-delete-unused-view-helper-files/134059)

<div class="topic-metadata">

**Author:** [@chrisolsen](https://www.ruby-forum.com/u/chrisolsen)\
**Replies:** 2\
**Last updated:** [April 7, 2008, 3:51pm UTC](https://www.ruby-forum.com/t/how-can-you-delete-unused-view-helper-files/134059 "2008-04-07T15:51:27Z")

</div>

I would like to delete most of the view helper files from my project. Unfortunately, when I try to run my tests it throws an error saying that one of the files is missing. I find that all the non-required helper files…

---

## [Getting to the session from Stories](https://www.ruby-forum.com/t/getting-to-the-session-from-stories/133987)

<div class="topic-metadata">

**Author:** [@Mikel\_L](https://www.ruby-forum.com/u/Mikel_L)\
**Replies:** 1\
**Last updated:** [April 6, 2008, 5:01am UTC](https://www.ruby-forum.com/t/getting-to-the-session-from-stories/133987 "2008-04-06T05:01:43Z")

</div>

Hey all, In a story I want to say Given “A logged in user” do sesson\[:logged\_in\] = true etc… end But the session method doesn’t have anything to bind to, I get the error ‘… while evaluating nil.session…’ Any idea…

---

## [Newbie : how to require to lib from spec under autotest?](https://www.ruby-forum.com/t/newbie-how-to-require-to-lib-from-spec-under-autotest/133937)

<div class="topic-metadata">

**Author:** [@churp](https://www.ruby-forum.com/u/churp)\
**Replies:** 6\
**Last updated:** [April 5, 2008, 11:54pm UTC](https://www.ruby-forum.com/t/newbie-how-to-require-to-lib-from-spec-under-autotest/133937 "2008-04-05T23:54:00Z")

</div>

Hello all, I have the RSpec sample in ./rspec\_bowling, with… ./rspec\_bowling/lib/bowling.rb ./rspec\_bowling/spec/spec.opts ./rspec\_bowling/spec/bowling\_spec.rb when I autotest, I get this: $autotest loading autote…

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

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