Re: [rspec-users] Testing Rails Associations

2007-07-06 Thread David Chelimsky
On 7/3/07, Daniel N [EMAIL PROTECTED] wrote: Hi, I'm very new to rspec, so if this is not the right forum please let me know. I'm starting to spec my models first in an existing rails app, porting from a mix of Test::Unit, and simply_bdd amongst others. I'm at the point where I want to

Re: [rspec-users] mocking methods in the controller.

2007-07-06 Thread David Chelimsky
On 7/5/07, Daniel N [EMAIL PROTECTED] wrote: Hi, I'm very new to rspec so please be patient with me. I've tried to take some of my tests out of the controller specs to check for things that are rendered. This has not worked so well, since my views have the controller method current_user

Re: [rspec-users] mocking methods in the controller.

2007-07-06 Thread David Chelimsky
On 7/6/07, Daniel N [EMAIL PROTECTED] wrote: On 7/6/07, Daniel N [EMAIL PROTECTED] wrote: On 7/6/07, David Chelimsky [EMAIL PROTECTED] wrote: On 7/5/07, Daniel N [EMAIL PROTECTED] wrote: Hi, I'm very new to rspec so please be patient with me. I've tried to take some

Re: [rspec-users] Mocking User.find( :all, :limit = 10 )

2007-07-09 Thread David Chelimsky
On 7/9/07, Josh Knowles [EMAIL PROTECTED] wrote: On 7/9/07, Johan Sørensen [EMAIL PROTECTED] wrote: Is there a way in RSpec to check for a specific hash key (or evaluating other things along those lines) in the parameter expectation using the should_receive(:find).with(...)

Re: [rspec-users] they synonym for it?

2007-07-11 Thread David Chelimsky
On 7/11/07, Ashley Moran [EMAIL PROTECTED] wrote: On 11 Jul 2007, at 15:00, Pedro Del Gallego wrote: Thats my biggest problem with rspec, (I'm a non english speaker working in a German/English environment) It would be great a guide or a tips list to make our specs more readebles,

Re: [rspec-users] they synonym for it?

2007-07-13 Thread David Chelimsky
On 7/13/07, Ashley Moran [EMAIL PROTECTED] wrote: On 12 Jul 2007, at 17:20, Anthony Carlos wrote: If you guys don't mind, I'm going to create a sample web page with this concept on it, stealing from Ashley and David's writings. If people like it, perhaps we can get it included in the

Re: [rspec-users] Specing Layouts

2007-07-14 Thread David Chelimsky
On 7/14/07, Daniel N [EMAIL PROTECTED] wrote: Hi, I've just started to try and spec my application.html.erb layout as one of the view specs but it totally barfs. I'm guessing that it's due to the yield statements in the layout. Any clues as to how to proceed? Backtrace please? Could be

Re: [rspec-users] Mocking Rails association collections

2007-07-18 Thread David Chelimsky
On 7/18/07, Paul [EMAIL PROTECTED] wrote: Rails model association collections allow you to do nifty things like: article.comments.find(:all, :conditions = {:created_at 1.day.ago}) Has anyone found a good way to mock this up? I'm currently doing this: @comment1 = mock_model(Comment)

Re: [rspec-users] Rails - Mock going out of scope?

2007-07-18 Thread David Chelimsky
On 7/18/07, Mikel Lindsaar [EMAIL PROTECTED] wrote: Hello list, I think I have a rails related RSpec problem with a mock going out of scope on a recursive call to a model. The code is at: http://pastie.textmate.org/79821 if you want to see it highlighted. I have pasted it below as well.

Re: [rspec-users] Rails - Mock going out of scope?

2007-07-18 Thread David Chelimsky
# + code from the original pastie end There are some other associations, but they are all belongs_to or has_many, so I haven't bothered to put all the tables in here and have removed the appropriate foreign keys from the nodes table. Regards Mikel On 7/19/07, David Chelimsky [EMAIL

Re: [rspec-users] File.stub!

2007-07-27 Thread David Chelimsky
On 7/27/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, I've answered my own question. I changed before :all do; to just before do (which is the same as before :each do) and everything works fine. I'm not overly concerned that stubbing has to occur prior to each example method, but why is

Re: [rspec-users] autotest doesn't notice file changes

2007-07-27 Thread David Chelimsky
On 7/27/07, Ingo Weiss [EMAIL PROTECTED] wrote: Hi all, I am trying to use autotest with rspec and rais, and it seems to work fine when I run autotest -rails initially, but then autotest fails to recognize file changes and run tests continuously. Did I skip a step? Here is my setup: rails

Re: [rspec-users] Rspec on rails with out database?

2007-07-27 Thread David Chelimsky
On 7/24/07, Eric Pugh [EMAIL PROTECTED] wrote: Hi all, I am trying to use rspec_on_rails in a Rails app that doesn't have a database. so far I have just been faking it out by dumping in a sqlite3 database just to make Rails happy. Try deleting config/database.yml (or renaming it to

Re: [rspec-users] Rspec on rails with out database?

2007-07-27 Thread David Chelimsky
On 7/27/07, David Chelimsky [EMAIL PROTECTED] wrote: On 7/24/07, Eric Pugh [EMAIL PROTECTED] wrote: Hi all, I am trying to use rspec_on_rails in a Rails app that doesn't have a database. so far I have just been faking it out by dumping in a sqlite3 database just to make Rails happy

Re: [rspec-users] Isolating rails model specs from their implementation

2007-07-29 Thread David Chelimsky
On 7/29/07, Russell Tracey [EMAIL PROTECTED] wrote: On 29/07/07, David Chelimsky [EMAIL PROTECTED] wrote: On 7/29/07, Russell Tracey [EMAIL PROTECTED] wrote: I'm currently taking a Rails project management app I built when learning Rails and adding specs to it. During the course

Re: [rspec-users] View-Driven-Development by Behavior-Driven-Development and RSpec

2007-07-30 Thread David Chelimsky
On 7/30/07, Daniel N [EMAIL PROTECTED] wrote: On 7/30/07, David Chelimsky [EMAIL PROTECTED] wrote: On 7/30/07, Mikel Lindsaar [EMAIL PROTECTED] wrote: I find myself doing the same thing... the, open the model and type in the it shoulds... I ws thinking along the same line

Re: [rspec-users] View-Driven-Development by Behavior-Driven-Development and RSpec

2007-07-30 Thread David Chelimsky
On 7/30/07, Daniel N [EMAIL PROTECTED] wrote: On 7/30/07, David Chelimsky [EMAIL PROTECTED] wrote: On 7/30/07, Daniel N [EMAIL PROTECTED] wrote: On 7/30/07, David Chelimsky [EMAIL PROTECTED] wrote: On 7/30/07, Daniel N [EMAIL PROTECTED] wrote: On 7/30/07, David Chelimsky [EMAIL

Re: [rspec-users] Stubbing Observers in rails?

2007-07-30 Thread David Chelimsky
On 7/30/07, Doug Cole [EMAIL PROTECTED] wrote: In most of my tests I'd like to be able to stub out the observers for my models, but I'm not sure the best way to do this. I doesn't look like there is a way to stub all instance methods, and I don't seem to be able to stub early enough to stub

Re: [rspec-users] helper spec not finding rails core helpers

2007-07-31 Thread David Chelimsky
On 7/30/07, linojon [EMAIL PROTECTED] wrote: Hi, My helper specs were going ok until I added a call to a rails DateHelper method in one of my helpers http://api.rubyonrails.com/classes/ActionView/Helpers/ DateHelper.html#M000574 The helper runs fine from my view templates, just dies in the

Re: [rspec-users] helper spec not finding rails core helpers

2007-07-31 Thread David Chelimsky
On 7/31/07, David Chelimsky [EMAIL PROTECTED] wrote: On 7/30/07, linojon [EMAIL PROTECTED] wrote: Hi, My helper specs were going ok until I added a call to a rails DateHelper method in one of my helpers http://api.rubyonrails.com/classes/ActionView/Helpers/ DateHelper.html#M000574

Re: [rspec-users] Stubbing Observers in rails?

2007-07-31 Thread David Chelimsky
On 7/31/07, Doug Cole [EMAIL PROTECTED] wrote: If I'm not mistaken those stub them out always - I'd like to be able to stub them out for most tests, but I would like to have them around when I want to write tests for the observers themselves! I imagine this is a fairly common use case for

Re: [rspec-users] upgrading from CURRENT to trunk

2007-07-31 Thread David Chelimsky
On 7/31/07, Jonathan Linowes [EMAIL PROTECTED] wrote: I've been on CURRENT I tried to switch to trunk but its not completing. How do I install the trunk version? (for rails) (I apologize in advance for being clueless) Here's my steps: First, I brought everything I have up to date:

Re: [rspec-users] upgrading from CURRENT to trunk

2007-07-31 Thread David Chelimsky
On 7/31/07, Robby Russell [EMAIL PROTECTED] wrote: David Chelimsky wrote: On 7/31/07, Jonathan Linowes [EMAIL PROTECTED] wrote: I've been on CURRENT I tried to switch to trunk but its not completing. How do I install the trunk version? (for rails) (I apologize in advance for being

Re: [rspec-users] Unimplemented Spec idea

2007-07-31 Thread David Chelimsky
On 7/31/07, Daniel N [EMAIL PROTECTED] wrote: On 8/1/07, Scott Taylor [EMAIL PROTECTED] wrote: I absolutely love the unimplemented spec idea, and tend to use it a lot. But occasionally it gets in my way, when I rush to write a spec, and then want to change it to a non-implemented spec.

Re: [rspec-users] installing trunk (was: upgrading from CURRENT to trunk)

2007-07-31 Thread David Chelimsky
On 7/31/07, Jonathan Linowes [EMAIL PROTECTED] wrote: Hi, I must be missing something obvious. $ rm -rf vendor/plugins/rspec $ script/plugin install svn://rubyforge.org/var/svn/rspec/trunk rspec Exported revision 2188. Plugin not found:

Re: [rspec-users] :render expects possible?

2007-08-01 Thread David Chelimsky
On 8/1/07, Edward Ocampo-Gooding [EMAIL PROTECTED] wrote: Hi, Is it possible to do the following in a controller spec? @controller.should_receive(:render).with(:layout = false) I've been trying this kind of thing and it looks like RSpec is messing with the render calls, and requires you

Re: [rspec-users] :render expects possible?

2007-08-01 Thread David Chelimsky
On 8/2/07, Edward Ocampo-Gooding [EMAIL PROTECTED] wrote: David Chelimsky wrote: On 8/1/07, Edward Ocampo-Gooding [EMAIL PROTECTED] wrote: Hi, Is it possible to do the following in a controller spec? @controller.should_receive(:render).with(:layout = false) I've been trying

Re: [rspec-users] Best practice integration testing

2007-08-02 Thread David Chelimsky
On 8/2/07, Hussein Morsy [EMAIL PROTECTED] wrote: We're working on getting the rbehave story runner merged into rspec and able to integrate w/ rails, but that's probably a couple of months away from reality. nice to hear :-) Right now I just use rails integration testing and

Re: [rspec-users] got/expects causes mental layering violation

2007-08-02 Thread David Chelimsky
On 8/2/07, Jay Levitt [EMAIL PROTECTED] wrote: I was, for the first time, spec'ing a class that redefined ==. And my spec was incorrect, so == was returning false. The result was something like: class C def ==(other) false end end .. C.new.should == other... expected

Re: [rspec-users] Do the :attributes and :content matchers work

2007-08-02 Thread David Chelimsky
On 8/2/07, sinclair bain [EMAIL PROTECTED] wrote: [Rails plugin 1.0.5] Hi, I am looking for some guidance. When working on a partial which looks like this div class=bug style=width: 100%; / I have some examples which should fail - I think - but do not: it ' should fail'

Re: [rspec-users] reusable specs - almost there

2007-08-05 Thread David Chelimsky
On 8/4/07, David Green [EMAIL PROTECTED] wrote: I have a lot of controllers with virtually identical functionality for most actions. I've been using shared behaviours to DRY things up a bit, but I still have to create separate behaviours for each context before I can use the shared behaviours

Re: [rspec-users] pending w/ no string

2007-08-06 Thread David Chelimsky
On 8/6/07, Scott Taylor [EMAIL PROTECTED] wrote: Is there some reason that pending() *MUST* take an argument? There was no discussion of this when the feature was contributed. Thinking about it now, to allow for no arg would require good default messages - one for when there is a block and one

Re: [rspec-users] pending w/ no string

2007-08-06 Thread David Chelimsky
On 8/6/07, Scott Taylor [EMAIL PROTECTED] wrote: On Aug 6, 2007, at 7:19 AM, David Chelimsky wrote: On 8/6/07, Scott Taylor [EMAIL PROTECTED] wrote: Is there some reason that pending() *MUST* take an argument? There was no discussion of this when the feature was contributed

Re: [rspec-users] Problems with array mock

2007-08-06 Thread David Chelimsky
On 8/6/07, aslak hellesoy [EMAIL PROTECTED] wrote: @curr_odontogram.photos.should_receive(:[]).with(1).and_return(@photo) Aslak D'oh! Of course - that should do it. ___ rspec-users mailing list rspec-users@rubyforge.org

Re: [rspec-users] used the described Class in a shared behavior

2007-08-06 Thread David Chelimsky
On 8/6/07, David Chelimsky [EMAIL PROTECTED] wrote: On 8/6/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Is it possible to access the described class in a shared behavior? I'm trying to do something like this: describe Siberian feline, :shared = true do described_class_instance_as

Re: [rspec-users] Rspec controller test

2007-08-07 Thread David Chelimsky
On 8/7/07, Shaker [EMAIL PROTECTED] wrote: Great Hi to everybody! I am currently working on a project which tests the controllers using rspec. I came across some methods in the controller which do not generate any actions at all. However, they still need testing! Some of these methods do

Re: [rspec-users] Problems with raising errors on a mocked object

2007-08-07 Thread David Chelimsky
On 8/7/07, Eivind Uggedal [EMAIL PROTECTED] wrote: I'm trying to mock a object to raise a certain error. By doing so I get a ArgumentError on ActiveRecord's save! method: http://pastie.caboo.se/85628 I've tried to debug it but just can't seem to find what I'm doing wrong. Any help is

Re: [rspec-users] Failed to pass arguments to controller method

2007-08-07 Thread David Chelimsky
On 8/7/07, Shaker [EMAIL PROTECTED] wrote: Good morning to everyone: So weird!! I got a method called apply_settings(arg1, arg2) in the controller to be tested. In the controller spec, I of course called the method. In the controller: def apply_settings(arg1, arg2) #where arg1

Re: [rspec-users] Problems with raising errors on a mocked object

2007-08-08 Thread David Chelimsky
, the solution to this problem is: @user.should_receive(:save!).and_raise(ActiveRecord::RecordInvalid.new(@user)) I guess the root of the problem is poor docs - I'm updating the rdoc now and it will be published with the next release. Cheers, David Eivind On 8/8/07, David Chelimsky [EMAIL PROTECTED

Re: [rspec-users] Problems with RESTfully generated helpers

2007-08-08 Thread David Chelimsky
On 8/8/07, Lance Carlson [EMAIL PROTECTED] wrote: I am using helper the RESTfully generated helper methods in my views. My routes are nested so the helpers appear to need arguments passed to them, but it works without arguments. Say for example I have pages and comments. If I do

Re: [rspec-users] Problems with RESTfully generated helpers

2007-08-08 Thread David Chelimsky
) @artist = mock_model(Artist) assigns[:label] = @label assigns[:artist] = @artist end def render_edit render :template = 'artists/edit' end it should render the edit artist form do render_edit end end On 8/8/07, David Chelimsky [EMAIL PROTECTED

Re: [rspec-users] Problems with RESTfully generated helpers

2007-08-08 Thread David Chelimsky
in this thread, but in the browser. Using edge rails, edge rspec. -L On 8/8/07, David Chelimsky [EMAIL PROTECTED] wrote: On 8/8/07, Lance Carlson [EMAIL PROTECTED] wrote: I just passed label_artist_path(@label.id, @artist.id) into the view and it worked.. but I really don't want to have

Re: [rspec-users] using RSpec's trunk in non-rails projects w/ Autotest

2007-08-08 Thread David Chelimsky
On 8/8/07, Scott Taylor [EMAIL PROTECTED] wrote: I was working on the same issue David was (to fix autotest to work for RSpec's trunk), only to find that David had modified it. Sorry - I saw the RFE and was taking a look at solutions and it was too easy to not just do. I have refactored the

Re: [rspec-users] using RSpec's trunk in non-rails projects w/ Autotest

2007-08-08 Thread David Chelimsky
On 8/8/07, Scott Taylor [EMAIL PROTECTED] wrote: On Aug 8, 2007, at 4:30 PM, David Chelimsky wrote: On 8/8/07, Scott Taylor [EMAIL PROTECTED] wrote: I was working on the same issue David was (to fix autotest to work for RSpec's trunk), only to find that David had modified it. Sorry

Re: [rspec-users] Can't seem to spec a ActiveRecord::RecordInvalid exception properly...

2007-08-08 Thread David Chelimsky
On 8/8/07, Fischer, Daniel [EMAIL PROTECTED] wrote: 1 def create 2 @user = User.new(params[:user]) 3 @user.save! 4 self.current_user = @user 5 redirect_to user_path(@user) 6 flash[:notice] = Thanks for signing up! 7 rescue ActiveRecord::RecordInvalid 8

Re: [rspec-users] Problems with RESTfully generated helpers

2007-08-08 Thread David Chelimsky
just have to use the parameters if you want the specs to work with the same code with which your app works. On 8/8/07, David Chelimsky [EMAIL PROTECTED] wrote: On 8/8/07, Lance Carlson [EMAIL PROTECTED] wrote: I just visited the action in my browser and i don't get any errors. I am also

Re: [rspec-users] RSpec book?

2007-08-08 Thread David Chelimsky
On 8/8/07, Ashley Moran [EMAIL PROTECTED] wrote: http://www.apress.com/book/bookDisplay.html?bID=10368 Came across this as a stub page browsing Amazon UK. This is good news! I'm surprised it hasn't been discussed on the list before. Was Chad keeping it a secret? I hope it will have plenty

Re: [rspec-users] RSpec book?

2007-08-08 Thread David Chelimsky
On 8/8/07, Ashley Moran [EMAIL PROTECTED] wrote: I'm still waiting for that magic book I can give to someone and say here - read this, it tells you how to build software. Have you read this one?

Re: [rspec-users] Problems with RESTfully generated helpers

2007-08-09 Thread David Chelimsky
exactly. Any insight? Not really more than what I said earlier in this thread. On 8/9/07, David Chelimsky [EMAIL PROTECTED] wrote: On 8/9/07, Lance Carlson [EMAIL PROTECTED] wrote: Were you able to come up with any solutions? Nope. Anyone else? On 8/8/07, David Chelimsky [EMAIL

Re: [rspec-users] Problems with RESTfully generated helpers

2007-08-10 Thread David Chelimsky
know this is a bug, would you kindly report it in the tracker? http://rubyforge.org/tracker/?atid=3149group_id=797func=browse What is your s/n? On 8/9/07, David Chelimsky [EMAIL PROTECTED] wrote: On 8/9/07, Lance Carlson [EMAIL PROTECTED] wrote: Is it possible that rspec is not pulling

Re: [rspec-users] and_yield + instance_eval(block)

2007-08-10 Thread David Chelimsky
On 8/10/07, Scott Taylor [EMAIL PROTECTED] wrote: On Aug 10, 2007, at 3:43 PM, David Chelimsky wrote: On 8/7/07, Scott Taylor [EMAIL PROTECTED] wrote: I have the following code, which yields instance eval's the block given: class Foo def bar(blk) instance_eval blk

Re: [rspec-users] Can't get should redirect_to match to work

2007-08-10 Thread David Chelimsky
On 8/10/07, sbellware [EMAIL PROTECTED] wrote: Folks, I've posted to the simple example I'm working with as well as the spec code and results here: http://pastie.caboo.se/86750 I can't seem to get this to work. Any ideas? As of some time ago, response.should redirect_to should come after

Re: [rspec-users] template.expect_render

2007-08-11 Thread David Chelimsky
getting called On Jun 27, 2007, at 1:31 AM, David Chelimsky wrote: Trunksters, I just added a couple of methods to ActionView::Base in Spec::Rails (as of r2136) that lets you do this in view examples: describe '/things/index.html.erb' do it should render _thing with a collection

Re: [rspec-users] stubbing a method that yeilds sequential results

2007-08-12 Thread David Chelimsky
On 8/12/07, rupert [EMAIL PROTECTED] wrote: I've just found myself stuck trying to rspec something so am hoping someone more knowledgable can help. I have a Connector class which has a class method 'results' that yields results it get from a network service based on a set of attributes that

[rspec-users] 1.0.6 gotcha

2007-08-12 Thread David Chelimsky
Hi All - I released 1.0.6 this morning, but there is apparently a bug related to rspec and autotest. I'll be fixing this today (but not until tonight) so you have two options: Wait until 1.0.7 (tonight) Upgrade now to 1.0.6 but make sure you install the rspec gem. Thanks, David

Re: [rspec-users] expect_render, why does there need to be a warning

2007-08-14 Thread David Chelimsky
On 8/14/07, Zach Dennis [EMAIL PROTECTED] wrote: On 8/14/07, David Chelimsky [EMAIL PROTECTED] wrote: On 8/14/07, Zach Dennis [EMAIL PROTECTED] wrote: There is a warning on the web site about expect_render and stub_render: WARNING: expect_render and stub_render, while very useful, act

Re: [rspec-users] nuby: how spec redirect_to at ApplicationController

2007-08-15 Thread David Chelimsky
On 8/15/07, Courtenay [EMAIL PROTECTED] wrote: On 8/15/07, Priit Tamboom [EMAIL PROTECTED] wrote: describe ApplicationController do it method login_required should redirect to home path without login do heh. it is so out of place here :) I agree. The goal is to describe behaviours of

Re: [rspec-users] RSpec --format --html:/path/to/file.html

2007-08-19 Thread David Chelimsky
On 8/17/07, Cody P. Skidmore [EMAIL PROTECTED] wrote: Greetings everyone. I'm learning RSpec and am pretty fresh to Ruby/Rails, but am so excited I can't help jumping in. I'm running before I can walk here. :-) Yesterday I tried outputting test results to HTML instead of colorized plain

Re: [rspec-users] Render template not matching absolute path

2007-08-21 Thread David Chelimsky
On 8/21/07, Ashley Moran [EMAIL PROTECTED] wrote: Hi I have a simple controller method like this: class StylesheetsController ApplicationController layout nil session :off def gap site = Site.find_by_hostname(request.host) @colours = site.colours respond_to do

Re: [rspec-users] testing behaviour or testing code?

2007-08-24 Thread David Chelimsky
On 8/24/07, Pat Maddox [EMAIL PROTECTED] wrote: On 8/24/07, David Chelimsky [EMAIL PROTECTED] wrote: describe Widget, class do it should provide a list of widgets sorted alphabetically do Widget.should_receive(:find).with(:order = name ASC) Widget.find_alphabetically end

Re: [rspec-users] testing behaviour or testing code?

2007-08-24 Thread David Chelimsky
On 8/24/07, Pat Maddox [EMAIL PROTECTED] wrote: On 8/24/07, David Chelimsky [EMAIL PROTECTED] wrote: On 8/24/07, Pat Maddox [EMAIL PROTECTED] wrote: On 8/24/07, David Chelimsky [EMAIL PROTECTED] wrote: describe Widget, class do it should provide a list of widgets sorted

Re: [rspec-users] Spec'ing ApplicationController

2007-08-27 Thread David Chelimsky
On 8/14/07, sbellware [EMAIL PROTECTED] wrote: Folks, I'd like to spec the behaviors that I'm adding to ApplicationController. Specifically, I'm adding: def authenticated? session[:username] != nil end I described ApplicationController, but couldn't figure out how to call the

Re: [rspec-users] Can module spec behave like controller spec?

2007-08-31 Thread David Chelimsky
On 8/31/07, Shaker [EMAIL PROTECTED] wrote: Hello everyone: Right now I am writing spec on modules, which are provided by my colleagues. Some of the modules actually contain action methods. I tried very hard to spec those action methods in modules. But it seems that the rspec does not

Re: [rspec-users] Setting use_transactional_fixtures=false for a single spec - a bad idea?

2007-08-31 Thread David Chelimsky
On 8/31/07, Peter Marklund [EMAIL PROTECTED] wrote: Hi! I would really like to find a way to allow me to write RSpec specifications for code that use database transactions. I know I can set config.use_transactional_fixtures = false in my spec_helper.rb. That works, and that's great, but it

Re: [rspec-users] How to spec routes for a resource nested in multiples resources?

2007-09-01 Thread David Chelimsky
On 8/31/07, Edgar Gonzalez [EMAIL PROTECTED] wrote: Hi, I got the resource Llamadas nested in: - Operadores - Productos - Centros Here is part of my routes http://pastie.caboo.se/92767 I want to spec that the routes for Llamadas, I tried several approachs: - route_for(:controller =

Re: [rspec-users] testing behaviour or testing code?

2007-09-02 Thread David Chelimsky
On 9/2/07, Pat Maddox [EMAIL PROTECTED] wrote: On 8/24/07, David Chelimsky [EMAIL PROTECTED] wrote: On 8/24/07, Pat Maddox [EMAIL PROTECTED] wrote: On 8/24/07, David Chelimsky [EMAIL PROTECTED] wrote: describe Widget, class do it should provide a list of widgets sorted

Re: [rspec-users] Deprecating the mocking framework?

2007-09-02 Thread David Chelimsky
On 9/2/07, Wilson Bilkovich [EMAIL PROTECTED] wrote: On 9/1/07, rupert [EMAIL PROTECTED] wrote: On 1 Sep 2007, at 10:04, Tom Stuart wrote: On 1 Sep 2007, at 09:31, rupert wrote: Are we planning on dumping the mock framework in favor of using Mocha The idea has been bandied

Re: [rspec-users] Deprecating the mocking framework?

2007-09-02 Thread David Chelimsky
On 9/2/07, Scott Taylor [EMAIL PROTECTED] wrote: On Sep 2, 2007, at 12:55 PM, David Chelimsky wrote: On 9/2/07, Wilson Bilkovich [EMAIL PROTECTED] wrote: On 9/1/07, rupert [EMAIL PROTECTED] wrote: On 1 Sep 2007, at 10:04, Tom Stuart wrote: On 1 Sep 2007, at 09:31, rupert wrote

Re: [rspec-users] testing behaviour or testing code?

2007-09-02 Thread David Chelimsky
On 9/2/07, Jay Levitt [EMAIL PROTECTED] wrote: On 9/2/2007 12:43 PM, David Chelimsky wrote: The problem we face is that AR promises huge productivity gains for the non TDD-er, and challenges the thinking of the die-hard TDD-er. I've gone back and forth about whether it's OK to test

[rspec-users] blog post on story runner

2007-09-02 Thread David Chelimsky
Here's an excellent blog post on Story Runner, which will be part of the next release and is undergoing active development in trunk: http://evang.eli.st/blog/2007/9/1/user-stories-with-rspec-s-story-runner ___ rspec-users mailing list

Re: [rspec-users] testing behaviour or testing code?

2007-09-03 Thread David Chelimsky
On 9/3/07, Peter Marklund [EMAIL PROTECTED] wrote: There's a very useful guideline in TDD that says test YOUR code, not everyone elses. The validation library we're testing here is ActiveRecord's. It's already tested (we hope!). Personally, I don't have the courage to assume Rails code is

Re: [rspec-users] Reason for _spec.rb convention

2007-09-03 Thread David Chelimsky
On 9/3/07, Scott Taylor [EMAIL PROTECTED] wrote: On Sep 3, 2007, at 7:59 AM, Ashley Moran wrote: Hi Easy one - I just wondered why all spec files for rspec_on_rails end _spec.rb instead of just .rb? They are all inside the spec folder so surely the fact they are specs is implicit?

Re: [rspec-users] Deprecating the mocking framework?

2007-09-03 Thread David Chelimsky
Hi all, I've talked this over w/ a couple of the other committers and we've decided that we will NOT be deprecating the mock framework, at least for the foreseeable future. If/when we do, it will happen with plenty of notice and a clear, painless (as much as is possible) upgrade path. To be

Re: [rspec-users] 1.05 to 1.08

2007-09-03 Thread David Chelimsky
On 9/3/07, Shane Mingins [EMAIL PROTECTED] wrote: Hi We are looking at moving a project over from 1.05 to 1.08 but have a problem with some of our helper specs They work fine in 1.05 but error in 1.08 and it is the calls to route helper methods that seems to be the problem. I did some

Re: [rspec-users] Model Specs: Fixtures vs Mocks + Stubs?

2007-09-04 Thread David Chelimsky
On 9/4/07, Lance Carlson [EMAIL PROTECTED] wrote: What is the general opinion about fixtures versus mocking and stubbing in model specs? I heard from agile on IRC that they save the database testing for integration testing, but I also see that the caboose sample applicaiton uses fixtures. I

Re: [rspec-users] Failure Messages in RSpec

2007-09-04 Thread David Chelimsky
On 9/4/07, Geoffrey Wiseman [EMAIL PROTECTED] wrote: Having used JUnit and Test::Unit, I'm quite used to having the ability to insert a failure message, which helps when tests fail. For instance, the example RSpec that is generated for a model class specifies that the model class is valid.

Re: [rspec-users] Rake tasks getting in the way of edge (uses gem instead)

2007-09-04 Thread David Chelimsky
On 9/4/07, Pat Maddox [EMAIL PROTECTED] wrote: So I'd been running gem releases of rspec for the past several months, and I installed edge rspec so that I can use Story Runner. I'm running into a problem because I've got a couple rake tasks that reference spec/rake/raketask. If I try to run

Re: [rspec-users] Failure Messages in RSpec

2007-09-04 Thread David Chelimsky
On 9/4/07, Geoffrey Wiseman [EMAIL PROTECTED] wrote: I come from the same background as you, so I hear where you're coming from. We made a conscious decision, however, not to support custom messages almost two years ago and I'm not sure if its ever even come up before. If it has, it was a

Re: [rspec-users] 1.05 to 1.08

2007-09-04 Thread David Chelimsky
On 9/4/07, Shane Mingins [EMAIL PROTECTED] wrote: On 4/09/2007, at 3:44 PM, David Chelimsky wrote: I am going to guess that it's something like this: You have a nil object when you didn't expect it! You might have expected an instance of Array. The error occurred while evaluating

Re: [rspec-users] False Positives and Autotest on New Folders

2007-09-05 Thread David Chelimsky
On 9/5/07, Geoffrey Wiseman [EMAIL PROTECTED] wrote: False Positives I just discovered how easy it was to create a false positive when I, trying my first RSpec test, did this: ob.should eql?('foo') instead of: ob.should eql('foo') or: ob.should == 'foo' As far as I can see, this

Re: [rspec-users] Caveman Questions

2007-09-05 Thread David Chelimsky
On 9/5/07, sudara [EMAIL PROTECTED] wrote: Hello! I'm just a caveman with some caveman questions. I've been parsing Rspec for quite a while, and I'm writing my first series of specs. My initial impressions are Verbose, but understandable. Helpful and intuitive, but so much to digest. I

Re: [rspec-users] Preconditions

2007-09-08 Thread David Chelimsky
On 9/8/07, Pat Maddox [EMAIL PROTECTED] wrote: On 9/8/07, Wincent Colaiuta [EMAIL PROTECTED] wrote: El 8/9/2007, a las 2:15, Pat Maddox escribió: * Descriptions should be broken up based on the required fixture. I don't split them up until I actually have to. For example, if I'm

Re: [rspec-users] why no newlines in failure messages?

2007-09-08 Thread David Chelimsky
On 9/8/07, Jeremy Stell-Smith [EMAIL PROTECTED] wrote: Instead of : expected ul\n lired/li\n liblue/li\n/ul, got ul\n lired/li\nliblue/li\n /ul (using ==) could we make rspec exceptions look more like : expected ul\n lired/li\n liblue/li\n/ul, got ul\n lired/li\n

Re: [rspec-users] template.expects_render?

2007-09-08 Thread David Chelimsky
On 9/8/07, Leslie Freeman [EMAIL PROTECTED] wrote: Hi All, I'm trying to make use of template.expects_render, is outlined in David's post(http://blog.davidchelimsky.net/articles/2007/06/28/ template-expects_render). I get an undefined method error on expects_render. I made sure I had the

[rspec-users] changes to TextMate bundle

2007-09-08 Thread David Chelimsky
Hi all, I got some help from James Edward Gray II on the RSpec TextMate bundle. For those of you who don't know James, he runs the Ruby Quiz and also maintains the official TM bundle. Per a couple of patches from him and some advice that I acted on, many of the shortcuts have changed. The bad

Re: [rspec-users] Preconditions

2007-09-09 Thread David Chelimsky
On 9/8/07, Ben Mabey [EMAIL PROTECTED] wrote: What was the motivation behind taking that tutorial down, BTW? I really like and benefited from it when I was starting to learn rspec. Was it just a maintenance issue as far as updating the tutorial to the current API (DSL)? That was part of

Re: [rspec-users] Content assist for spec files

2007-09-10 Thread David Chelimsky
On 9/5/07, Tor Norbye [EMAIL PROTECTED] wrote: Hi there, I'm working on Ruby support for NetBeans, and we're bundling RSpec (along with JRuby). One thing I'd really like to fix is having content assist (code completion / intellisense / code insight, it has many names) work inside your spec

Re: [rspec-users] Can NOT overides the stub! in the setup

2007-09-10 Thread David Chelimsky
On 9/10/07, bruce zuo [EMAIL PROTECTED] wrote: Hello, I am new to rSpec. I tried to search in the list, but could not find the answer, please forgive me if somebody already answered this. Here is my question: I have a stub in setup: before(:each) do @current_user = mock(devsu)

Re: [rspec-users] changes to TextMate bundle

2007-09-10 Thread David Chelimsky
On 9/10/07, Scott Taylor [EMAIL PROTECTED] wrote: What happened to pending (with and without the block)? Uh my dog ate it? I don't think it was in there. Or perhaps it wasn't in there correctly, because James found some errors in the bundle related to items that had no names. Feel free to

Re: [rspec-users] Going beyond the default html formatter/report?

2007-09-11 Thread David Chelimsky
On 9/11/07, Geoffrey Wiseman [EMAIL PROTECTED] wrote: On 9/9/07, Priit Tamboom [EMAIL PROTECTED] wrote: I wonder does anybody planning to go beyond the default html formatter/report? Two things on that subject came up today, during some RSpec work. It would be nice if: The report

Re: [rspec-users] Can not 'assigns' value in View test

2007-09-12 Thread David Chelimsky
On 9/12/07, Evan David Light [EMAIL PROTECTED] wrote: Granted that I'm new too; however, assigns[:hash] creates a member variable @hash that is made available to the view. Maybe that's the problem? Modify your view to use @hash instead.

Re: [rspec-users] Philosophical questions

2007-09-12 Thread David Chelimsky
On 9/12/07, Geoffrey Wiseman [EMAIL PROTECTED] wrote: On 9/12/07, David Chelimsky [EMAIL PROTECTED] wrote: I like to start w/ integration tests before anything exists at all. You can do that w/ Rails' Integration Tests or Story Runner (if you're using RSpec's trunk). Next, I hit a view

Re: [rspec-users] Philosophical questions

2007-09-12 Thread David Chelimsky
On 9/12/07, Evan David Light [EMAIL PROTECTED] wrote: On Sep 12, 2007, at 7:35 PM, David Chelimsky wrote: Story Runner is a new one for me. I'll have to look it up. Thanks! (Halfway through writing this, I realized, courtesy of Google, that it's a recently integrated piece

Re: [rspec-users] Can not 'assigns' value in View test

2007-09-12 Thread David Chelimsky
the symbols rather than instance variable. Huh? Symbols in the partials that are supposed to magically transform to some value? I don't get it. What am I missing? David Chelimsky-2 wrote: On 9/12/07, Evan David Light [EMAIL PROTECTED] wrote: Granted that I'm new too; however, assigns[:hash

Re: [rspec-users] Can not 'assigns' value in View test

2007-09-12 Thread David Chelimsky
reading more documentation now. Hopefully we could figure it out shortly. David Chelimsky-2 wrote: On 9/12/07, Shaker [EMAIL PROTECTED] wrote: Unfortunately, I am not supposed to change the code inside the partial. That's why I posted this message. I am trying to find a way

Re: [rspec-users] Can not 'assigns' value in View test

2007-09-12 Thread David Chelimsky
it is really returning an array, so ... and_return([val1, val2]) See if that works. Thanks for investigating this question. David Chelimsky-2 wrote: On 9/12/07, Shaker [EMAIL PROTECTED] wrote: I also feel puzzled. But that's what my colleagues do, and it works. The thing is they use

Re: [rspec-users] Philosophical questions

2007-09-13 Thread David Chelimsky
On 9/13/07, Evan David Light [EMAIL PROTECTED] wrote: My immediate impression was Story == Use Case. Story == User Story User Stories are not the same thing as Use Cases. You may want to google around for some writing on that. Cheers. ___ rspec-users

Re: [rspec-users] Need help in View Spec

2007-09-13 Thread David Chelimsky
this: response.should have_tag(form[action=?][method=post], foo_path(@foo)) HTH Another problem is the tag does not have id or class sometimes, does it mean that is no way of selecting it? David Chelimsky-2 wrote: On 9/13/07, Shaker [EMAIL PROTECTED] wrote: I can not find much information about

Re: [rspec-users] Need help in View Spec

2007-09-13 Thread David Chelimsky
On 9/13/07, Shaker [EMAIL PROTECTED] wrote: I can not find much information about the should have_tag syntax in Rspec. http://rspec.rubyforge.org/rdoc-rails/classes/Spec/Rails/Matchers.html#M11 ___ rspec-users mailing list

Re: [rspec-users] Need help in View Spec

2007-09-13 Thread David Chelimsky
. What is wrong? David Chelimsky-2 wrote: On 9/13/07, Shaker [EMAIL PROTECTED] wrote: Yes, I have gone through the documentation before, and I read the reference of 'assert_select' as well. But I still can not figure out a way of testing attributes in a tag. What I know is we can use

  1   2   3   4   5   6   7   8   9   10   >