# RSpec

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

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

---

## [Cucumber tables](https://www.ruby-forum.com/t/cucumber-tables/168089)

<div class="topic-metadata">

**Author:** [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Replies:** 11\
**Last updated:** [May 16, 2009, 5:05pm UTC](https://www.ruby-forum.com/t/cucumber-tables/168089 "2009-05-16T17:05:41Z")

</div>

I cannot seem to locate any documentation on how to implement the new table syntax otherwise I would not bother the list with this. I wish to write something like this: And we do have a forex rate for the following cu…

---

## [HowTo Specify A Method is Called Within A Controller's Action](https://www.ruby-forum.com/t/howto-specify-a-method-is-called-within-a-controllers-action/168118)

<div class="topic-metadata">

**Author:** [@biglandowner](https://www.ruby-forum.com/u/biglandowner)\
**Replies:** 2\
**Last updated:** [May 16, 2009, 4:58pm UTC](https://www.ruby-forum.com/t/howto-specify-a-method-is-called-within-a-controllers-action/168118 "2009-05-16T16:58:41Z")

</div>

I am new to RSpec and would appreciate some pointers on how to specify the following for my Rails application… I have a controller called ContextsController and, within this, the usual ‘create’ method. The first line …

---

## [Passing user id to spec | error](https://www.ruby-forum.com/t/passing-user-id-to-spec-error/168084)

<div class="topic-metadata">

**Author:** [@manoah](https://www.ruby-forum.com/u/manoah)\
**Replies:** 3\
**Last updated:** [May 16, 2009, 7:44am UTC](https://www.ruby-forum.com/t/passing-user-id-to-spec-error/168084 "2009-05-16T07:44:55Z")

</div>

\-----Controller -------------- def update @user = User.find\_by\_id( user.id ) if request.post? unless params\[ :user \].nil? if @user.update\_attributes( params\[ :user \] ) redirect\_to :action =\> :show e…

---

## [\[Cucumber\] ANN: Cucumber 0.3.4](https://www.ruby-forum.com/t/cucumber-ann-cucumber-0-3-4/167981)

<div class="topic-metadata">

**Author:** [@aslakhellesoy](https://www.ruby-forum.com/u/aslakhellesoy)\
**Replies:** 4\
**Last updated:** [May 16, 2009, 5:04am UTC](https://www.ruby-forum.com/t/cucumber-ann-cucumber-0-3-4/167981 "2009-05-16T05:04:11Z")

</div>

http://github.com/aslakhellesoy/cucumber/blob/173506c4013a7d733c5b4924e7af3dcc49db2218/History.txt Enjoy!

---

## [Creating an "integration controller" spec](https://www.ruby-forum.com/t/creating-an-integration-controller-spec/168098)

<div class="topic-metadata">

**Author:** [@Forrest\_C](https://www.ruby-forum.com/u/Forrest_C)\
**Replies:** 2\
**Last updated:** [May 15, 2009, 10:11pm UTC](https://www.ruby-forum.com/t/creating-an-integration-controller-spec/168098 "2009-05-15T22:11:49Z")

</div>

Hi All: So I have some longer running controller specs that interact with outside API’s that I want to move into an integration directory. In doing so, it seems I don’t get the (possibly determined by directory?) ma…

---

## [Helpers for examples?](https://www.ruby-forum.com/t/helpers-for-examples/168073)

<div class="topic-metadata">

**Author:** [@helix\_tp](https://www.ruby-forum.com/u/helix_tp)\
**Replies:** 3\
**Last updated:** [May 15, 2009, 7:38pm UTC](https://www.ruby-forum.com/t/helpers-for-examples/168073 "2009-05-15T19:38:47Z")

</div>

Where’s the recommended place to put helper methods & etc for examples? I’ve started putting them in spec/spec\_helper.rb but that’s going to get awfully cluttered. I’m thinking maybe a spec/lib, and add that to inclu…

---

## [How to test update\_attribute with mocha?](https://www.ruby-forum.com/t/how-to-test-update-attribute-with-mocha/167927)

<div class="topic-metadata">

**Author:** [@anmaxp](https://www.ruby-forum.com/u/anmaxp)\
**Replies:** 5\
**Last updated:** [May 15, 2009, 4:56pm UTC](https://www.ruby-forum.com/t/how-to-test-update-attribute-with-mocha/167927 "2009-05-15T16:56:01Z")

</div>

Hey everyone, I’m having sort of an issue here, I’m trying to test the update of the last\_login field upon login, here is my test it “assigns a new last\_login timestamp” do User.expects(:update\_attribute).at\_least\_on…

---

## [Why won't my simple controller spec pass?](https://www.ruby-forum.com/t/why-wont-my-simple-controller-spec-pass/168046)

<div class="topic-metadata">

**Author:** [@lee](https://www.ruby-forum.com/u/lee)\
**Replies:** 1\
**Last updated:** [May 15, 2009, 9:28am UTC](https://www.ruby-forum.com/t/why-wont-my-simple-controller-spec-pass/168046 "2009-05-15T09:28:23Z")

</div>

I have been trying to spec a Rails Controller for the first time, having just completed my first View spec. Having hit a wall trying to spec a controller for my own application, I have tried to get an example in beta …

---

## [\[Cucumber\] ANN: Cucumber 0.3.5](https://www.ruby-forum.com/t/cucumber-ann-cucumber-0-3-5/168044)

<div class="topic-metadata">

**Author:** [@aslakhellesoy](https://www.ruby-forum.com/u/aslakhellesoy)\
**Replies:** 0\
**Last updated:** [May 15, 2009, 8:40am UTC](https://www.ruby-forum.com/t/cucumber-ann-cucumber-0-3-5/168044 "2009-05-15T08:40:56Z")

</div>

http://github.com/aslakhellesoy/cucumber/blob/20021e90c892030c1a1b46e2d19024c3719af0ba/History.txt Thanks Joseph!

---

## [Unable to post to an update action in a controller spec](https://www.ruby-forum.com/t/unable-to-post-to-an-update-action-in-a-controller-spec/167912)

<div class="topic-metadata">

**Author:** [@fipa](https://www.ruby-forum.com/u/fipa)\
**Replies:** 3\
**Last updated:** [May 15, 2009, 2:22am UTC](https://www.ruby-forum.com/t/unable-to-post-to-an-update-action-in-a-controller-spec/167912 "2009-05-15T02:22:28Z")

</div>

Hi, I use restful routes. In one of my views I have a form that looks like: \<%- form\_tag ‘/items/update’, :method =\> :put do -%\> … \<%= submit\_tag “Recalculate” %\> \<%- end -%\> I know I cheated a bit, as I should be …

---

## [Cucumber Tables](https://www.ruby-forum.com/t/cucumber-tables/167879)

<div class="topic-metadata">

**Author:** [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Replies:** 2\
**Last updated:** [May 14, 2009, 10:40pm UTC](https://www.ruby-forum.com/t/cucumber-tables/167879 "2009-05-14T22:40:30Z")

</div>

I am running into this situation: Feature 1 Scenario A … Then we should have currency exchange rates for “USD” on file And we should … Feature 2 Scenario D … Then we should have currency exchange rates for “USD”…

---

## [Problem with RSpec and Cucumber](https://www.ruby-forum.com/t/problem-with-rspec-and-cucumber/167992)

<div class="topic-metadata">

**Author:** [@ASKueken](https://www.ruby-forum.com/u/ASKueken)\
**Replies:** 0\
**Last updated:** [May 14, 2009, 7:25pm UTC](https://www.ruby-forum.com/t/problem-with-rspec-and-cucumber/167992 "2009-05-14T19:25:14Z")

</div>

Hello everybody, I have a problem get cucumber running properly. Runnink jruby -S rake features ends with: /Users/alexander/lib/jruby/bin/jruby -I “/Users/alexander/lib/ jruby-1.3.0RC1/lib/ruby/gems/1.8/gems/cucumber…

---

## [Options Hash explanation?](https://www.ruby-forum.com/t/options-hash-explanation/167809)

<div class="topic-metadata">

**Author:** [@mortench](https://www.ruby-forum.com/u/mortench)\
**Replies:** 5\
**Last updated:** [May 13, 2009, 10:12pm UTC](https://www.ruby-forum.com/t/options-hash-explanation/167809 "2009-05-13T22:12:19Z")

</div>

The new rspec beta book and the rspec site mentions that it is possible to add a hash to “describe” and “it” constructs but very, very litle information about the particulars. What can the options hash be used for and…

---

## [\[RSpec\] implicit receiver for should problem when helper predicate methods are in use](https://www.ruby-forum.com/t/rspec-implicit-receiver-for-should-problem-when-helper-predicate-methods-are-in-use/167445)

<div class="topic-metadata">

**Author:** [@juuser](https://www.ruby-forum.com/u/juuser)\
**Replies:** 12\
**Last updated:** [May 13, 2009, 6:36pm UTC](https://www.ruby-forum.com/t/rspec-implicit-receiver-for-should-problem-when-helper-predicate-methods-are-in-use/167445 "2009-05-13T18:36:18Z")

</div>

I just upgraded RSpec and noticed that some of my specs started to fail and it is caused by the 1.1.2 update where implicit receiver for should is introduced. Here is one sample example group, which works with older v…

---

## [Uninitialized constant Spec::VERSION::REV (NameError)](https://www.ruby-forum.com/t/uninitialized-constant-spec-rev-nameerror/167829)

<div class="topic-metadata">

**Author:** [@sunfish](https://www.ruby-forum.com/u/sunfish)\
**Replies:** 3\
**Last updated:** [May 13, 2009, 3:30am UTC](https://www.ruby-forum.com/t/uninitialized-constant-spec-rev-nameerror/167829 "2009-05-13T03:30:09Z")

</div>

I am a newbie for rspec. I am trying to install and run a “test” test, but i get an error. …/lib/active\_support/dependencies.rb:440:in \`load\_missing\_constant’: uninitialized constant Spec::VERSION::REV (NameError) Ca…

---

## [\[cucumber\] junit formatter](https://www.ruby-forum.com/t/cucumber-junit-formatter/167742)

<div class="topic-metadata">

**Author:** [@JonesS\_Gareth](https://www.ruby-forum.com/u/JonesS_Gareth)\
**Replies:** 4\
**Last updated:** [May 13, 2009, 1:56am UTC](https://www.ruby-forum.com/t/cucumber-junit-formatter/167742 "2009-05-13T01:56:58Z")

</div>

Hi, I’ve knocked together a JUnit xml output formatter for cucumber - we’re using it with Hudson and Ant, so it seemed like a good idea. It’s good enough for our purposes, so I thought we should release it into the w…

---

## [Sharing common Cuke steps](https://www.ruby-forum.com/t/sharing-common-cuke-steps/167475)

<div class="topic-metadata">

**Author:** [@miked](https://www.ruby-forum.com/u/miked)\
**Replies:** 13\
**Last updated:** [May 13, 2009, 1:13am UTC](https://www.ruby-forum.com/t/sharing-common-cuke-steps/167475 "2009-05-13T01:13:38Z")

</div>

Cucumber is awesome and destined to rule the world. As that starts to happen, has there been any thought of a mechanism for the community to build a library of common, generally useful steps that can be used across p…

---

## [How To Drive Out AJAX Functionality in Rails' Views?](https://www.ruby-forum.com/t/how-to-drive-out-ajax-functionality-in-rails-views/167792)

<div class="topic-metadata">

**Author:** [@lee](https://www.ruby-forum.com/u/lee)\
**Replies:** 2\
**Last updated:** [May 12, 2009, 9:00pm UTC](https://www.ruby-forum.com/t/how-to-drive-out-ajax-functionality-in-rails-views/167792 "2009-05-12T21:00:52Z")

</div>

I am new to RSpec and have just started to drive out my first view using a spec. I have used the The RSpec Book (beta) to do the basic stuff like testing for the presence of a field but I am unsure where to start for …

---

## [\[RSpec\] problems with a rails controller spec using AASM](https://www.ruby-forum.com/t/rspec-problems-with-a-rails-controller-spec-using-aasm/167803)

<div class="topic-metadata">

**Author:** [@Andy\_Henson](https://www.ruby-forum.com/u/Andy_Henson)\
**Replies:** 2\
**Last updated:** [May 12, 2009, 7:33pm UTC](https://www.ruby-forum.com/t/rspec-problems-with-a-rails-controller-spec-using-aasm/167803 "2009-05-12T19:33:56Z")

</div>

Hi All, I’m trying to spec out a Rails controller and I’m coming up with a bit of a problem. I’m pretty sure it’s something fairly simple but I can no longer see the wood for the trees. I have a Jobs controller that …

---

## [How To Drive Out AJAX Functionality in a Rails View](https://www.ruby-forum.com/t/how-to-drive-out-ajax-functionality-in-a-rails-view/167785)

<div class="topic-metadata">

**Author:** [@biglandowner](https://www.ruby-forum.com/u/biglandowner)\
**Replies:** 12\
**Last updated:** [May 12, 2009, 6:03pm UTC](https://www.ruby-forum.com/t/how-to-drive-out-ajax-functionality-in-a-rails-view/167785 "2009-05-12T18:03:31Z")

</div>

I am new to RSpec and have just started to drive out my first Rails view using a spec. I have used the The RSpec Book (beta) to do the basic stuff like testing for the presence of a field but I am unsure where to star…

---

## [Cucumber 0.3.3 - Examples:](https://www.ruby-forum.com/t/cucumber-0-3-3-examples/167723)

<div class="topic-metadata">

**Author:** [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Replies:** 3\
**Last updated:** [May 12, 2009, 2:12pm UTC](https://www.ruby-forum.com/t/cucumber-0-3-3-examples/167723 "2009-05-12T14:12:53Z")

</div>

Am I correct when I infer that the “Examples” keyword is now only valid in a Scenario Outline? If so, in what version did this change take place?

---

## [Rspec\_scaffold and mocha](https://www.ruby-forum.com/t/rspec-scaffold-and-mocha/167448)

<div class="topic-metadata">

**Author:** [@jevado](https://www.ruby-forum.com/u/jevado)\
**Replies:** 3\
**Last updated:** [May 12, 2009, 8:32am UTC](https://www.ruby-forum.com/t/rspec-scaffold-and-mocha/167448 "2009-05-12T08:32:10Z")

</div>

Hi all, Sorry if this get’s posted several times but I got a message that my previous post wasn’t allowed because I’m not a member. I think I am now though. The problem I have is fairly simple. I have some plugins wh…

---

## [Question re: stubbing out validations](https://www.ruby-forum.com/t/question-re-stubbing-out-validations/167697)

<div class="topic-metadata">

**Author:** [@barunio](https://www.ruby-forum.com/u/barunio)\
**Replies:** 3\
**Last updated:** [May 12, 2009, 3:15am UTC](https://www.ruby-forum.com/t/question-re-stubbing-out-validations/167697 "2009-05-12T03:15:15Z")

</div>

Suppose a “User” has many “widgets”, and that we have a method in the User class that does something like: def update\_widgets x = … code to do some calculations … if x \> 5 new\_widget = widgets.new new\_widget.save! …

---

## [Test JSON with Cucumber](https://www.ruby-forum.com/t/test-json-with-cucumber/167718)

<div class="topic-metadata">

**Author:** [@kelleysislander](https://www.ruby-forum.com/u/kelleysislander)\
**Replies:** 6\
**Last updated:** [May 12, 2009, 1:42am UTC](https://www.ruby-forum.com/t/test-json-with-cucumber/167718 "2009-05-12T01:42:09Z")

</div>

Hi Folks - I’m hoping someone has come before me in trying to do this. I want to use Cucumber to acceptance-test my JSON output. So far all I can do is validate that the JSON is valid, with this step: Then /^I should…

---

## [Running single spec files -- how?](https://www.ruby-forum.com/t/running-single-spec-files-how/167729)

<div class="topic-metadata">

**Author:** [@court3nay](https://www.ruby-forum.com/u/court3nay)\
**Replies:** 2\
**Last updated:** [May 12, 2009, 1:18am UTC](https://www.ruby-forum.com/t/running-single-spec-files-how/167729 "2009-05-12T01:18:43Z")

</div>

Before upgrading from 1.1.11 to 1.2.4 I used to be able to do this: ruby spec/models/user\_spec.rb Now it looks like you have to do script/spec spec/models/user\_spec.rb Or something like this, which is actually kinda …

---

## [Newbie: Rspec, Webrat, Mechanize, Cucumber](https://www.ruby-forum.com/t/newbie-rspec-webrat-mechanize-cucumber/167436)

<div class="topic-metadata">

**Author:** [@DVG](https://www.ruby-forum.com/u/DVG)\
**Replies:** 1\
**Last updated:** [May 11, 2009, 1:56pm UTC](https://www.ruby-forum.com/t/newbie-rspec-webrat-mechanize-cucumber/167436 "2009-05-11T13:56:58Z")

</div>

Alright, I’m trying to get up to speed with using Rspec, Webrat, Mechanize and Cucumber to test a non rails application. The RSpec Matchers (I think) seem to not be working as expected. When I run my feature, it says …

---

## [RCov and Ruby 1.9.1](https://www.ruby-forum.com/t/rcov-and-ruby-1-9-1/167495)

<div class="topic-metadata">

**Author:** [@tick](https://www.ruby-forum.com/u/tick)\
**Replies:** 1\
**Last updated:** [May 10, 2009, 11:48pm UTC](https://www.ruby-forum.com/t/rcov-and-ruby-1-9-1/167495 "2009-05-10T23:48:48Z")

</div>

Has anyone got RCov working with Ruby 1.9.1? The rcov gem won’t even install, and the spicycode-rcov gem crashes. It would be nice to still benefit from rcovs features. Tick

---

## [\[cucumber\] how to debug cucumber with netbeans?](https://www.ruby-forum.com/t/cucumber-how-to-debug-cucumber-with-netbeans/167500)

<div class="topic-metadata">

**Author:** [@Jean-Michel\_Garnier](https://www.ruby-forum.com/u/Jean-Michel_Garnier)\
**Replies:** 5\
**Last updated:** [May 9, 2009, 9:33pm UTC](https://www.ruby-forum.com/t/cucumber-how-to-debug-cucumber-with-netbeans/167500 "2009-05-09T21:33:03Z")

</div>

3 months ago, I submitted a patch to cucumber so I could run cucumber from a ruby script and use the debugger in netbeans (Lighthouse - Beautifully Simple Issue Tracking) It worked well at the time but I can’t make i…

---

## [\[cucumber\] -n command line option looks in every feature file](https://www.ruby-forum.com/t/cucumber-n-command-line-option-looks-in-every-feature-file/167524)

<div class="topic-metadata">

**Author:** [@marksbrain](https://www.ruby-forum.com/u/marksbrain)\
**Replies:** 2\
**Last updated:** [May 9, 2009, 8:18pm UTC](https://www.ruby-forum.com/t/cucumber-n-command-line-option-looks-in-every-feature-file/167524 "2009-05-09T20:18:39Z")

</div>

Running ‘cucumber -n “asdf” features/challenge.feature’ seems to load every feature file from the Rails root on down. In particular, it loads example features in vendor/gems like Ben’s email\_spec which requires Rails …

---

## [Weird bug in association extensions](https://www.ruby-forum.com/t/weird-bug-in-association-extensions/167558)

<div class="topic-metadata">

**Author:** [@court3nay](https://www.ruby-forum.com/u/court3nay)\
**Replies:** 2\
**Last updated:** [May 9, 2009, 6:58pm UTC](https://www.ruby-forum.com/t/weird-bug-in-association-extensions/167558 "2009-05-09T18:58:55Z")

</div>

Hey all, just upgraded an older app to latest rspec and rails. This code runs fine in console but fails under rspec. class User has\_many :statuses, :extend =\> Status:::AssociationExtension end module Status::Associa…

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

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