Testing should answer this question for you, regularly: How do you
know it works?
Courtenay
On Fri, Feb 19, 2010 at 12:59 AM, Erik Pukinskis
wrote:
> Hello Specmeisters!
>
> I have a bit of a philosophical question for the TDD witches and
> wizards out there. I'm working
On Sat, Jan 9, 2010 at 7:38 PM, Sean DeNigris
wrote:
>> window = stub('window', :title => "programming_ruby_1.9.pdf")
>> preview = stub('preview', :front_window => window)
> Perfect - so easy! Thanks.
>
There's also stub_chain, which is probably a Bad Thing but helps break
through layers of
On Wed, Nov 5, 2008 at 2:58 AM, Alex Satrapa <[EMAIL PROTECTED]> wrote:
> On 05/11/2008, at 01:37 , Steven Baker wrote:
>
>> Big difference between "haven't been able to" and "wouldn't learn the
>> tools". Ashley's post below sums it up best. This is a problem that's seen
>> regularly when workin
On Tue, Jul 1, 2008 at 11:08 AM, David Chelimsky <[EMAIL PROTECTED]> wrote:
> On Jul 1, 2008, at 12:59 PM, marcio <[EMAIL PROTECTED]> wrote:
>
>> hi everyone! i ve been working in my new rspec scaffold generator.
>> I have made all the neccesary specs over all controllers and models.
>> I am worki
On Thu, Apr 3, 2008 at 4:38 AM, Juanma Cervera <[EMAIL PROTECTED]> wrote:
> Thanks to all for your answers.
> I also have found a plugin with matchers for active record validations,
> associations and even useful matchers for views.
>
> It has a matcher for validates_uniqueness_of that doesn't g
IMO this function should be tested using the database, since it relies
heavily on the data.
Courtenay
@(o..O)@
On Apr 2, 2008, at 1:13 AM, Juanma Cervera <[EMAIL PROTECTED]> wrote:
> Hello
>
> I am learning rspec and trying to especify the activerecord
> v
ething happened, which didn't exist before the
call was run. Whereas the latter is stubbing the method as well as
raising if it doesn't.
Courtenay
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
of course, you do both. you need to unit test in isolation, as well as
integration test the stack.
On Nov 15, 2007 5:44 AM, Matthew Lins <[EMAIL PROTECTED]> wrote:
> But, that should be okay, since my intent is not to test the associated
> models. I have a separate spec file for those models.
>
>
Reads like haiku :p
On Nov 14, 2007, at 7:01 PM, Nathan Sutton <[EMAIL PROTECTED]> wrote:
> I'm writing a plain text story (testing the waters) and I have
> scenarios that I need to chain in my specs.
>
> Here is what I have so far:
>
> Story: User purchasing tshirts
> As a user
> I want to
You create the records.
@bah = Bah.create!
[1, 5, 22, 16].each { |amount| Foo.create! :amount => amount, :bah => @bah }
@bah.foos.should == 44
On 8/27/07, Rodrigo Alvarez Fernández <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I would like to know how would you test a method in a model that uses
>
Does this work?
Image.stub!(:validates_uniqueness_of).and_return(true)
On 8/23/07, s.ross <[EMAIL PROTECTED]> wrote:
> I want to use mocks and stubs to test the controller, but am having
> trouble getting my validation not to trigger. Here's the code:
>
> # spec:
>
> Image.stub!(:find).a
On 8/19/07, Edward Ocampo-Gooding <[EMAIL PROTECTED]> wrote:
> David Chelimsky wrote:
> > On 8/19/07, Edward Ocampo-Gooding <[EMAIL PROTECTED]> wrote:
> >> Is there a built-in way of describing a mock_model as being an instance,
> >> beyond
> >> stubbing the eval("Object.methods - Object.new.metho
; it's more convenient..
>
> On 8/17/07, Courtenay <[EMAIL PROTECTED]> wrote:
> > What do you guys think of this: if someone calls should_receive
> > outside of an "it" block, it warns you.
> >
> > before(:each) do
> > @foo = Foo.new
>
s correct when setting up objects.
Opinions?
courtenay
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
On 8/15/07, Steve Tooke <[EMAIL PROTECTED]> wrote:
> Hi,
>
> How are people specifying models which act_as_list?
>
> I'm thinking that it would be possible to check that acts_as_list
> instance methods have been added to a class using something like this:
You're specing the code not the behavior.
On 8/15/07, Priit Tamboom <[EMAIL PROTECTED]> wrote:
> Good morning rspec people!
>
> Still rspec nuby: I must do something wrong obviously.
>
> How can I spec about redirect_to at ApplicationController
>
> describe ApplicationController do
>it "method login_required should redirect to home pat
On 8/14/07, aslak hellesoy <[EMAIL PROTECTED]> wrote:
> On 8/15/07, Scott Taylor <[EMAIL PROTECTED]> wrote:
> >
> > Mocha's mock/stub framework has the ability to stub all methods on a
> > mock given. Does RSpec's mocking framework have this ability?
>
You mean like :null_object => true ??
=
_return(@current_user)
> request.session[:user] = @current_user
The fact that you're stubbing "find" calls in the *view* spec
indicates that you're probably testing things that are out of the
scope of that spec.
The actual ACL system should be tested on its own, not in the context of a view.
Courtenay
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
On 7/27/07, Justin Williams <[EMAIL PROTECTED]> wrote:
> Thanks for the help.
>
You're welcome
> I think I'm getting closer. I'm still not getting a redirect. I
> still think it's the same reason though. I say this because when I
> modify the last line of my spec to be render_template("index")
u can change the implementation without screwing round with a
bunch of tests. In fact neither of these would require a change of
controller specs.
@user.should_receive(:has_role?).with('tutor').and_return(true)
Hope this helps :)
Courtenay
On 7/26/07, Justin Williams <[EMAIL PROTECTED]&
On 7/24/07, Rick Tessner <[EMAIL PROTECTED]> wrote:
> Hi,
>
> On Tue, 2007-24-07 at 15:26 -0700, Courtenay wrote:
> > Does this work?
> >
> > ApplicationHelper.stub!(:controller).and_return mock('controller',
> > :controller_name => 'foo
Does this work?
ApplicationHelper.stub!(:controller).and_return mock('controller',
:controller_name => 'foo')
On 7/24/07, Rick Tessner <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I'm in the process of creating rspecs for my helpers. One of the
> helpers in app/helpers/application_helper.rb looks
22 matches
Mail list logo