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
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
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
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
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
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
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
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
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
>
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
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
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
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
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
> 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
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
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
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
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", %{
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
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
>
> 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
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
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
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
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
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?
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@
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
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
___
@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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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)
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
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
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
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
55 matches
Mail list logo