similar to: RSpec 0.9.2

Displaying 20 results from an estimated 3000 matches similar to: "RSpec 0.9.2"

2007 Apr 11
12
redirection doesn''t get detected well?
I''m doing a redirect in one of my controller actions and somehow I can''t spec it, see this pastie: http://pastie.caboo.se/53120. When following the link from a browser I''m being redirected to the right page. -------------- next part -------------- An HTML attachment was scrubbed... URL:
2007 Jan 05
2
Using RESTful routes in controller tests
Why can''t I use the RESTful route helpers in my specs? In my controller I''m doing a redirect: redirect_to list_path(:id => @item.list_id) Now when I write: controller.should_redirect_to list_path(:id => 2) I''m getting the following error: NoMethodError in ''POST on /lists/2/items should redirect to index on succesful POST'' You have a nil object
2007 May 11
2
spec a replace_html with a partial
I wanted to use ARTS to add RJS in a behaviour driven way to my application, but I''m having some trouble asserting a replace_html with a partial. I''ve created a pastie (http://pastie.caboo.se/60694) which contains the RJS I want to spec, the spec which I already wrote and its failure message. I''m currently using RSpec-0.9.2
2007 Feb 28
12
Specifying that code is called in a block
Not sure if this is possible currently. I have a section of code like this: ActiveRecord::Base.transaction do cow.save! duck.save! dog.save! end (Names changed to protect the innocent.) I''d like to specify that the saves run in a transaction. I can do ActiveRecord::Base.should_receive(:transaction).and_yield But is there any way to specify that the code is
2007 Apr 25
9
Running specs for a plugin - undefined method ''define'' for object
I''m trying to write specs for a plugin I''m developing named audit_fu, and I''m running into a problem which I can''t get past it. I''ve got the same specs setup in the main rails app, and everything works fine there, it''s just running the plugin specs that I''m having a problem with. My setup is: - edge rails - edge rspec (in
2006 Nov 03
10
[PLUGIN] rspec_resource_generator - RESTful scaffold generator with RSpec specifications
rspec_resource_generator ======================== By Pat Maddox Use this generator to generate RESTful scaffolding with RSpec specifications. Syntax is exactly the same as the scaffold_resource generator: ./script/generate rspec_resource ModelName [field:type field:type] When you run this generator, it will create a migration, model, and model spec file. In addition, it gives you a RESTful
2009 Feb 06
6
RecordNotFound bubbling thru to cucumber
Hello, I have a controller action that raises a RecordNotFound exception if you''re not allowed to see something. In my global application controller (application.rb), I catch these and render the 404 template. But when I run cucumber (using webrat), it''s getting the full stacktrace (the step blows up). Any ideas why? I have consider_all_requests_local turned off in my test.rb.
2007 Apr 19
5
Best practice thoughts: Model helpers, mocks
Hello! I''m pretty new to unit testing, and have only been using RSpec for a few weeks. I found that for my controller specs, my setup methods were getting very long building mocks/stubs for all the model objects I needed to work with. I''ve started creating helpers like the following for each of my models. The "min_" methods are short for "minimum", and
2007 Aug 14
4
Stubbing all methods
Mocha''s mock/stub framework has the ability to stub all methods on a mock given. Does RSpec''s mocking framework have this ability? And if not, is there some reason it shouldn''t be implemeneted? Regards, Scott
2006 Dec 03
4
RSpec 0.7.4 released
Hi all, I released RSpec 0.7.4 yesterday, and by now the gems should have rsync''ed to all the mirrors. This release features a complete redesign of the reports generated with --format html. You can see some examples of it here: http://rspec.rubyforge.org/report.html http://rspec.rubyforge.org/tools/failing_examples.html As usual there are many bug fixes - mostly related to spec/rails.
2009 Apr 27
2
[cucumber] Setting a constant in step definition
On Mon, Apr 27, 2009 at 7:00 AM, Andrew Premdas <apremdas at gmail.com> wrote: > Currently I have a very simple constants implementation being loaded as a > Rails initialiser > > module MVOR > ? module Postage > ??? THRESHOLD = BigDecimal.new(''6.99'') > ??? RATE = BigDecimal.new(''30.00'') > ? end > end > > > My scenarios
2007 May 22
5
rails edge
hi, first time trying rspec, and rails edge. Are there any known issues running rspec with rails edge? for one, apparently script/generate scaffold_resource has been renamed just "resource". Do I just search/replace "scaffold_resource" with "resource" in file rspec_resource_generator.rb ? Somethings still missing. before i get "Couldn''t find
2007 Feb 07
5
Mocking ActiveResource
I want to use ActiveResource in my app. Instead of hitting server though, I want it to load from a file when I call find. Any clue how I do that? Pat
2008 Sep 09
12
cucumber - mark a step as pending
I love the way I can throw a call to pending() in the top of an unfinished RSpec example and stop it from failing the build. Is there a similar way to do such a thing with good ole'' cucumber? cheers, Matt ---- http://blog.mattwynne.net http://songkick.com In case you wondered: The opinions expressed in this email are my own and do not necessarily reflect the views of any former,
2008 Mar 20
5
sharing story steps
Hi, How can I have a common set of steps that all my stories share? i.e. My stories often start out looking like this: Given a user Joe Given a user Jordan then: Given("a user $username") do |username| @users ||= {} @user_sessions ||= {} @users[username] = create_user(:username => username) @user_sessions[username] = login_as(@users[username]) end I want to share that
2008 Mar 17
10
RSpec and RCov with JRuby
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 with a simple script and it worked (pretty slow, but it doesn?t matter). But when I add the rcov options to my Rake task, RCov is not invoke properly! Rakefile:
2007 May 10
5
Shared behavior and_raise problem, and site aestetics
Hello, Is anyone else having trouble with the and_raise method on mocks, with respect to shared behaviors? If I do the following instead: foo.should_receive(:bar).and_return { raise } everything seems to work. I have been supplying no arguments to and_raise, by the way. Also, you may want to make the background in the code examples on the home page a little lighter. I am hardly able to
2007 Nov 11
4
Who''s using --format rdoc
I''m doing some housekeeping and just realised that the rdoc formatter produces gibberish: http://rspec.rubyforge.org/rdoc/files/EXAMPLES_rd.html Will anyone protest if I just go ahead and remove it? (I can''t imagine anyone using it, especially with the much better HTML formatter) Aslak
2008 Mar 04
10
Pretty story output for non-Rails project
I''m taking my first fledgling steps driving a new ruby (non-rails) project with BDD. I''ve got a (test) story working. However, when I run the story in TextMate (via command-r), the output is plain text. See: http://skitch.com/georgeanderson/8grg/run-examples How do I get the output to look pretty (formatted)? rspec-1.1.3 OS X 10.5.2 TextMate v1.5.7 (1455) Thanks, /g --
2007 Jun 18
7
Testing for cross site scripting, etc.
Being new to testing and ruby, are there "standard" tests that can be done that test for things like cross site scripting and friends? If not, anyone have ideas on what I might do about testing those sorts of things? I''ll be using rails, also. Mike B. ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging