Re: [rspec-users] Scenarios Plugin Pre-Announcement

2007-10-16 Thread Jonathan Linowes
how about "factory"? or something along that metaphor "assemblies" ... "erections"? maybe not... :) On Oct 17, 2007, at 1:33 AM, John W. Long wrote: > On 10/16/07, Pat Maddox <[EMAIL PROTECTED]> wrote: >> I would recommend that you rename it, because "Scenario" already >> has a >> precise me

Re: [rspec-users] Scenarios Plugin Pre-Announcement

2007-10-16 Thread John W. Long
On 10/16/07, Pat Maddox <[EMAIL PROTECTED]> wrote: > I would recommend that you rename it, because "Scenario" already has a > precise meaning and plays a very important role in RSpec. I can certainly understand why you would say that. The name is inspired by another project mentioned on ErrTheBlog

Re: [rspec-users] Scenarios Plugin Pre-Announcement

2007-10-16 Thread John W. Long
On 10/16/07, Andy Watts <[EMAIL PROTECTED]> wrote: > I recently spent a lot of time looking at something similar before going > with the fixtures replacement plugin. > It gives me new_user, create_user, create_user(:first_name => > 'overriddefault' ). > Also creates records for associations where r

Re: [rspec-users] works in script but not in rake

2007-10-16 Thread David Chelimsky
On 10/17/07, Jonathan Linowes <[EMAIL PROTECTED]> wrote: > Hi, > > This is weird > > All my current spec examples are passing (about 750 of 'em) except a > set of 6 in a specific controller spec. I get the following failure > on each 6 when I run it via > $ rake spec Do you have --reverse in y

Re: [rspec-users] works in script but not in rake

2007-10-16 Thread Jonathan Linowes
btw I just noticed the text of the example is a typo, it -is- a GET called in the spec with get :accept, :project_id => @project.id, :id => @mem.id On Oct 17, 2007, at 1:01 AM, Jonathan Linowes wrote: > Hi, > > This is weird > > All my current spec examples are passing (about 750 of 'em)

[rspec-users] works in script but not in rake

2007-10-16 Thread Jonathan Linowes
Hi, This is weird All my current spec examples are passing (about 750 of 'em) except a set of 6 in a specific controller spec. I get the following failure on each 6 when I run it via $ rake spec for example: --- ActionController::UnknownAction in 'MembershipsController handling PUT /pro

[rspec-users] should_receive

2007-10-16 Thread Steve
Is there any way to setup a should_receive so that it returns whatever it was passed in from the actual code? I just want to make sure that a specific function is called, I don't want to mess around with the parameters it receives, or what it does inside, or what it returns. Is that possible? Using

Re: [rspec-users] Example for attr_accessible?

2007-10-16 Thread Pat Maddox
On 10/16/07, David Chelimsky <[EMAIL PROTECTED]> wrote: > On 10/16/07, Pat Maddox <[EMAIL PROTECTED]> wrote: > > Personally, if I wanted to extract this pattern, I would use a custom > > expectation matcher. > > ... which would probably be implemented like this under the hood: > > def matches?(targ

Re: [rspec-users] Example for attr_accessible?

2007-10-16 Thread David Chelimsky
On 10/16/07, Pat Maddox <[EMAIL PROTECTED]> wrote: > On 10/16/07, Steve <[EMAIL PROTECTED]> wrote: > > I've been thinking about this throughout the day, and is this a pattern > > that should maybe be implemented in a more widespread pattern? For > > example, check that the model makes the requisite

Re: [rspec-users] Example for attr_accessible?

2007-10-16 Thread Pat Maddox
On 10/16/07, Steve <[EMAIL PROTECTED]> wrote: > On Tue, 16 Oct 2007 13:43:43 -0500, David Chelimsky wrote: > > > On 10/16/07, Pat Maddox <[EMAIL PROTECTED]> wrote: > >> describe Chicken do > >> it "should make only :name and :age attr_accessible" do > >> Chicken.should_receive(:attr_accessibl

Re: [rspec-users] Example for attr_accessible?

2007-10-16 Thread Steve
On Tue, 16 Oct 2007 13:43:43 -0500, David Chelimsky wrote: > On 10/16/07, Pat Maddox <[EMAIL PROTECTED]> wrote: >> describe Chicken do >> it "should make only :name and :age attr_accessible" do >> Chicken.should_receive(:attr_accessible).with(:name, :age) >> load "#{RAILS_ROOT}/app/model

Re: [rspec-users] Scenarios Plugin Pre-Announcement

2007-10-16 Thread Andy Watts
Looks good. I recently spent a lot of time looking at something similar before going with the fixtures replacement plugin. It gives me new_user, create_user, create_user(:first_name => 'overriddefault' ). Also creates records for associations where required. This is useful in story runner, where

Re: [rspec-users] RailsStory - lessons learned

2007-10-16 Thread Alvin Schur
Thanks! A usable stack trace now shows up in the console. Alvin. Ben Mabey wrote: > This might help: > http://www.dcmanges.com/blog/debugging-rails-integration-tests > -Ben > > Alvin Schur wrote: > >> After trying RailsStory for a few days, I have learned: >> >> 1. Rails testing support does

Re: [rspec-users] Scenarios Plugin Pre-Announcement

2007-10-16 Thread Pat Maddox
On 10/16/07, John W. Long <[EMAIL PROTECTED]> wrote: > This is sort of a pre-announcement for a Rails plugin my friend Adam > Williams and I are working on. We're in the process of extracting it > from a project we are working on so that it can be generally useful to > the Rails community. We are c

Re: [rspec-users] (no subject) - rspec not running

2007-10-16 Thread Steven Garcia
Ahh I didnt know I had to run that again after upgrading. I am getting a different error now..seems like its more of a Rails issue though: /Sites/test_appvendor/rails/railties/lib/../../activesupport/lib/active_support/dependencies.rb:266:in `load_missing_constant': uninitialized constant Act

Re: [rspec-users] RailsStory - lessons learned

2007-10-16 Thread Ben Mabey
This might help: http://www.dcmanges.com/blog/debugging-rails-integration-tests -Ben Alvin Schur wrote: > After trying RailsStory for a few days, I have learned: > > 1. Rails testing support does not serve up static pages > > 2. RailsStory masks errors generated by the app under test > > 3. The ma

[rspec-users] Scenarios Plugin Pre-Announcement

2007-10-16 Thread John W. Long
This is sort of a pre-announcement for a Rails plugin my friend Adam Williams and I are working on. We're in the process of extracting it from a project we are working on so that it can be generally useful to the Rails community. We are calling it "Scenarios". It is a drop in replacement for Rails

Re: [rspec-users] RailsStory - lessons learned

2007-10-16 Thread Alvin Schur
David Chelimsky wrote: > On 10/16/07, Alvin Schur <[EMAIL PROTECTED]> wrote: > >> After trying RailsStory for a few days, I have learned: >> >> 1. Rails testing support does not serve up static pages >> >> 2. RailsStory masks errors generated by the app under test >> >> 3. The masked errors are

Re: [rspec-users] RailsStory - lessons learned

2007-10-16 Thread David Chelimsky
On 10/16/07, Alvin Schur <[EMAIL PROTECTED]> wrote: > After trying RailsStory for a few days, I have learned: > > 1. Rails testing support does not serve up static pages > > 2. RailsStory masks errors generated by the app under test > > 3. The masked errors are available in log/test > > 4. I should

[rspec-users] RailsStory - lessons learned

2007-10-16 Thread Alvin Schur
After trying RailsStory for a few days, I have learned: 1. Rails testing support does not serve up static pages 2. RailsStory masks errors generated by the app under test 3. The masked errors are available in log/test 4. I should read log/test more often See http://pastie.caboo.se/107876 for

Re: [rspec-users] RailsStory runner - empty response

2007-10-16 Thread Alvin Schur
David Chelimsky wrote: > On 10/16/07, Alvin Schur <[EMAIL PROTECTED]> wrote: > >> Alvin Schur wrote: >> On 10/16/07, Alvin Schur <[EMAIL PROTECTED]> wrote: > I generated a new rails app then installed rspec and rspec_on_rails > from > trunk. > > I

Re: [rspec-users] (no subject) - rspec not running

2007-10-16 Thread David Chelimsky
On 10/16/07, Steven Garcia <[EMAIL PROTECTED]> wrote: > I just unfroze my app and am getting the same error. > > Gonna reinstall a stable rspec to make sure that the trunk is really the > issue Try script/generate rspec first :) ___ rspec-users mailing l

Re: [rspec-users] (no subject) - rspec not running

2007-10-16 Thread David Chelimsky
On 10/16/07, Steven Garcia <[EMAIL PROTECTED]> wrote: > @post.should_be more_specific > > script/spec:4:in `run': wrong number of arguments (5 for 1) > (ArgumentError) http://rspec.rubyforge.org/documentation/rails/install.html script/generate rspec You need to do that every time you update vend

Re: [rspec-users] (no subject) - rspec not running

2007-10-16 Thread Steven Garcia
I just unfroze my app and am getting the same error. Gonna reinstall a stable rspec to make sure that the trunk is really the issue -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/ma

Re: [rspec-users] (no subject) - rspec not running

2007-10-16 Thread Steven Garcia
@post.should_be more_specific script/spec:4:in `run': wrong number of arguments (5 for 1) (ArgumentError) -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] (no subject) - rspec not running

2007-10-16 Thread David Chelimsky
On 10/16/07, Steven Garcia <[EMAIL PROTECTED]> wrote: > I am getting this same error when I run autotest. There are a few errors cited in this thread. Which one do you mean? > > My system specs > > Rails v7945 > Rspec Version 1.1.0 (in SVN) > OS 10.4.10 ___

Re: [rspec-users] (no subject) - rspec not running

2007-10-16 Thread Steven Garcia
I am getting this same error when I run autotest. My system specs Rails v7945 Rspec Version 1.1.0 (in SVN) OS 10.4.10 -- Posted via http://www.ruby-forum.com/. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo

Re: [rspec-users] Spec dirs not in path?

2007-10-16 Thread Steve
On Tue, 16 Oct 2007 14:17:48 -0500, David Chelimsky wrote: > Do you mean the dirs inside rspec, or in the spec directory in your project? Inside the spec dir in the project. spec/controllers, spec/models, etc... ___ rspec-users mailing list rspec-users@

Re: [rspec-users] Spec dirs not in path?

2007-10-16 Thread David Chelimsky
On 10/16/07, Steve <[EMAIL PROTECTED]> wrote: > I'm just curious if there's a reason why rspec doesn't add the various > spec dirs to $: so that "requires" can be done without specifying the full > path name. Do you mean the dirs inside rspec, or in the spec directory in your project?

[rspec-users] Spec dirs not in path?

2007-10-16 Thread Steve
I'm just curious if there's a reason why rspec doesn't add the various spec dirs to $: so that "requires" can be done without specifying the full path name. Thanks, Steve ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailma

Re: [rspec-users] Example for attr_accessible?

2007-10-16 Thread Steve
On Tue, 16 Oct 2007 13:43:43 -0500, David Chelimsky wrote: > On 10/16/07, Pat Maddox <[EMAIL PROTECTED]> wrote: >> describe Chicken do >> it "should make only :name and :age attr_accessible" do >> Chicken.should_receive(:attr_accessible).with(:name, :age) >> load "#{RAILS_ROOT}/app/model

Re: [rspec-users] Example for attr_accessible?

2007-10-16 Thread David Chelimsky
On 10/16/07, Pat Maddox <[EMAIL PROTECTED]> wrote: > describe Chicken do > it "should make only :name and :age attr_accessible" do > Chicken.should_receive(:attr_accessible).with(:name, :age) > load "#{RAILS_ROOT}/app/models/chicken.rb" > end > end > > I first saw this technique describ

Re: [rspec-users] Example for attr_accessible?

2007-10-16 Thread Pat Maddox
On 10/16/07, Steve <[EMAIL PROTECTED]> wrote: > > > > You could expect a call to attr_accessible and then load your model file. > > > > Or, loop through all the column names in your model, and make sure > > that only the ones that are supposed to be accessible get set. > > > > Pat > > Expecting the

Re: [rspec-users] Example for attr_accessible?

2007-10-16 Thread Steve
> > You could expect a call to attr_accessible and then load your model file. > > Or, loop through all the column names in your model, and make sure > that only the ones that are supposed to be accessible get set. > > Pat Expecting the call is what I had originally thought of, but couldn't figu

Re: [rspec-users] RailsStory runner - empty response

2007-10-16 Thread David Chelimsky
On 10/16/07, Alvin Schur <[EMAIL PROTECTED]> wrote: > Alvin Schur wrote: > > > >> On 10/16/07, Alvin Schur <[EMAIL PROTECTED]> wrote: > >> > >>> I generated a new rails app then installed rspec and rspec_on_rails > >>> from > >>> trunk. > >>> > >>> I then created a sample story: > >>> > >>> require

Re: [rspec-users] RailsStory runner - empty response

2007-10-16 Thread Pat Maddox
On 10/16/07, Alvin Schur <[EMAIL PROTECTED]> wrote: > Alvin Schur wrote: > > > >> On 10/16/07, Alvin Schur <[EMAIL PROTECTED]> wrote: > >> > >>> I generated a new rails app then installed rspec and rspec_on_rails > >>> from > >>> trunk. > >>> > >>> I then created a sample story: > >>> > >>> require

Re: [rspec-users] RailsStory runner - empty response

2007-10-16 Thread Alvin Schur
Alvin Schur wrote: > >> On 10/16/07, Alvin Schur <[EMAIL PROTECTED]> wrote: >> >>> I generated a new rails app then installed rspec and rspec_on_rails >>> from >>> trunk. >>> >>> I then created a sample story: >>> >>> require File.dirname(__FILE__) + "/helper" >>> >>> Story "View Home Page", %{

Re: [rspec-users] Does a mock model have to satisfy contraints

2007-10-16 Thread Chris Olsen
That is what I thought (and was hoping for) Thanks David. > This is a bit tricky. What you're setting up here (which is true of > message expectations in general, not must mock_model) is an > expectation that @site will receive the message :save and that when it > does receive it, you are instru

Re: [rspec-users] Does a mock model have to satisfy contraints

2007-10-16 Thread David Chelimsky
On 10/16/07, Chris Olsen <[EMAIL PROTECTED]> wrote: > I am a little confused to the what happens with the following: > > before do > @site = mock_model(Site, :to_param => "1") > Site.stub!(:new).and_return(@site) > end > > def post_with_successful_save > @site.should_receive(:save

[rspec-users] Does a mock model have to satisfy contraints

2007-10-16 Thread Chris Olsen
I am a little confused to the what happens with the following: before do @site = mock_model(Site, :to_param => "1") Site.stub!(:new).and_return(@site) end def post_with_successful_save @site.should_receive(:save).and_return(true) post :create, :site => {} end I understand

Re: [rspec-users] RailsStory runner - empty response

2007-10-16 Thread Alvin Schur
> On 10/16/07, Alvin Schur <[EMAIL PROTECTED]> wrote: > >> I generated a new rails app then installed rspec and rspec_on_rails from >> trunk. >> >> I then created a sample story: >> >> require File.dirname(__FILE__) + "/helper" >> >> Story "View Home Page", %{ >> As a user >> I want to view

Re: [rspec-users] Example for attr_accessible?

2007-10-16 Thread Pat Maddox
On 10/15/07, Steve <[EMAIL PROTECTED]> wrote: > Is anyone out there writing specs to check attr_accessible fields? I had > originally written my spec to check for allowing the desired fields, and > then none of the other regular db fields. Unfortunately this isn't > satisfactory, because attr_prote

Re: [rspec-users] Controller iterating through returned records and appending to each

2007-10-16 Thread Pat Maddox
On 10/16/07, Dylan Markow <[EMAIL PROTECTED]> wrote: > I have a controller that gets a list of employees (which has an "include => > [:salaries, :incentives, :billablegoals, :reviews]"). I then need it to > iterate through each employee and determine their current active goal based > on the "effect

Re: [rspec-users] Example for attr_accessible?

2007-10-16 Thread Steve
On Tue, 16 Oct 2007 10:39:32 +0200, Wincent Colaiuta wrote: > Yes, I spec this kind of thing. > >describe User, 'accessible attributes' do > it 'should allow mass-assignment to the login name' do >lambda { new_user.update_attributes(:login_name => > String.random) }.should_not

Re: [rspec-users] Controller iterating through returned records and appending to each

2007-10-16 Thread Dylan Markow
Okay I'm retarded. I added a helper method "def current_goal" to my Employee model and can test it there, so I don't even need the @employees.each... line. Dylan Markow wrote: > > I have a controller that gets a list of employees (which has an "include > => > [:salaries, :incentives, :billableg

Re: [rspec-users] Controller iterating through returned records and appending to each

2007-10-16 Thread David Chelimsky
On 10/16/07, Dylan Markow <[EMAIL PROTECTED]> wrote: > I have a controller that gets a list of employees (which has an "include => > [:salaries, :incentives, :billablegoals, :reviews]"). I then need it to > iterate through each employee and determine their current active goal based > on the "effect

Re: [rspec-users] RailsStory runner - empty response

2007-10-16 Thread David Chelimsky
On 10/16/07, Alvin Schur <[EMAIL PROTECTED]> wrote: > I generated a new rails app then installed rspec and rspec_on_rails from > trunk. > > I then created a sample story: > > require File.dirname(__FILE__) + "/helper" > > Story "View Home Page", %{ > As a user > I want to view my home page >

[rspec-users] Controller iterating through returned records and appending to each

2007-10-16 Thread Dylan Markow
I have a controller that gets a list of employees (which has an "include => [:salaries, :incentives, :billablegoals, :reviews]"). I then need it to iterate through each employee and determine their current active goal based on the "effective date." After playing around with it a bunch, I got the f

[rspec-users] RailsStory runner - empty response

2007-10-16 Thread Alvin Schur
I generated a new rails app then installed rspec and rspec_on_rails from trunk. I then created a sample story: require File.dirname(__FILE__) + "/helper" Story "View Home Page", %{ As a user I want to view my home page So that I can get a birds eye view of the system }, :type => RailsStor

Re: [rspec-users] Step matchers

2007-10-16 Thread Josh Chisholm
This isn't in production, it's not even fully baked. It's just something I hacked away at over a couple of weekends. I can show you where I wanted to get to (off the top of my head) : http://pastie.caboo.se/107693 ( adapted from http://evang.eli.st/blog/2007/9/1/user-stories-with-rspec-s-story-ru

[rspec-users] new screencast on rspec

2007-10-16 Thread Bryan Liles
http://tinyurl.com/2bolrs I'm working on a series of screencasts on RSpec and BDD. This first iteration is on the real basics. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users

Re: [rspec-users] Step matchers

2007-10-16 Thread David Chelimsky
On 10/16/07, Josh Chisholm <[EMAIL PROTECTED]> wrote: > Hi all. I'm with David in that plain-text specs are my holy grail. I > have actually been experimenting with this idea since I first saw the > story runner. My interpreter (spike!) would execute "specs" against > "proofs", but I tried to put a

Re: [rspec-users] Example for attr_accessible?

2007-10-16 Thread Wincent Colaiuta
El 16/10/2007, a las 6:50, Steve <[EMAIL PROTECTED]> escribió: > Is anyone out there writing specs to check attr_accessible fields? > I had > originally written my spec to check for allowing the desired > fields, and > then none of the other regular db fields. Unfortunately this isn't > satisf

Re: [rspec-users] Step matchers

2007-10-16 Thread Josh Chisholm
Hi all. I'm with David in that plain-text specs are my holy grail. I have actually been experimenting with this idea since I first saw the story runner. My interpreter (spike!) would execute "specs" against "proofs", but I tried to put a bit more into the grammar. Specifically, the interpreter woul

Re: [rspec-users] Named routes in controller not working?

2007-10-16 Thread Steve
Nevermind, I newbed the named route. It's obviously too late, and I should be in bed. ___ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users