Hey guys. My ApplicationController rescues
Mongoid::Errors::DocumentNotFound errors like this:
class ApplicationController < ActionController::Base
rescue_from Mongoid::Errors::DocumentNotFound,
:with => :resource_not_found
protected
def resource_not_found(error)
flash[:alert] = t(
Hey guys. I'm writing a Rails gem that's used by controllers. The gem
creates a singleton resource at run-time, along the lines of:
controller_name = ...dynamically generated...
ActionController::Routing::Routes.draw do |map|
map.resource controller_name, :only => :show
end
I'm trying to f
Hey Patrick.
> I have this in my controller action:
>
> from_address = Setting.find_by_name("shipping_from_address").address
>
> and my spec fails:
>
> NoMethodError in 'Admin::ShippingLabelsController should render a pdf
> file'
> undefined method `address' for nil:NilClass
>
> yet in the con
patrick99e99 wrote:
>> Patrick, please create a new thread for this, since it doesn't have
>> anything to do with the current topic.
>
> Wow that is weird.. I replied to the previous thread in my email
> client but removed the subject-- as I assumed that was what kept
> things associated with thr
Patrick Collins wrote:
> Hi,
>
> I have this in my controller action:
>
> from_address = Setting.find_by_name("shipping_from_address").address
>
> and my spec fails:
>
> NoMethodError in 'Admin::ShippingLabelsController should render a pdf
> file'
> undefined method `address' for nil:NilClass
Pat Maddox wrote:
> I've never heard of CurbFu, but according to
> http://github.com/gdi/curb-fu/blob/master/lib/curb-fu.rb#L43 it defines
> a stub method already. So you're hitting that one, which expects two
> arguments. stub! goes to RSpec's mocking framework.
>
> Pat
Good catch! Thanks,
RSpec's changelog says that in version 1.2.5:
"also alias_method :stub, :stub!, so you can stub with less bang"
which I've been taking advantage of a lot.
However, I just ran into a situation where using #stub caused an error
to occur, and changing to #stub! caused the error the disappear.
Any
emdub wrote:
> I think what is easiest/cleanest in the code should prevail :) I
> personally like "shared_examples_for", but can easily adapt to
> whatever decision is made.
>
> On a semi-related note. Where do I require my shared specs so
> it_should_behave_like can find my shared example groups?
David Chelimsky wrote:
> So this presents an interesting problem :)
>
> My intent some time back was to deprecate :shared => true, not
> share_examples_for (which is aliased with shared_examples_for). Based
> on that, the rspec.info site is correct and Pat is incorrect. However,
> Pat didn't know
Pat Maddox wrote:
> describe "something something", :shared => true do
> ...
> end
>
> describe "chunky bacon" do
> it_should_behave_like "something something"
> end
BTW, is rspec.info supposed to be up-to-date? It still recommends using
"shared_examples_for".
http://rspec.info/documentatio
Pat Maddox wrote:
> describe "something something", :shared => true do
> ...
> end
>
> describe "chunky bacon" do
> it_should_behave_like "something something"
> end
Thanks, mate.
--
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing li
API Dock says that "share_examples_for" is deprecated. If that's
correct, what should we be using instead?
http://apidock.com/rspec/Spec/Extensions/Main/share_examples_for
Thanks,
Nick
--
Posted via http://www.ruby-forum.com/.
___
rspec-users mailing l
One of my controller actions sends a redirect if the request URI begins
with /foods/search
34 def search
35return redirect_to "/#{params[:name]}" if
request.request_uri.match /^\/foods\/search/
Unfortunately, I can't figure out how to spec this.
>From everything that I've read while res
Hey guys. I have two different paths that lead to the same controller
and action:
map.connect 'foods/search/:name', :controller => 'foods', :action =>
'search'
map.food':name', :controller => 'foods', :action =>
'search'
Unfortunately, the spec for the second route fails be
David Chelimsky wrote:
> On Wed, Jan 13, 2010 at 10:20 AM, Nick Hoffman
> wrote:
>
>> > Yes - route_to checks both sides of the translation.
>>
>> Great, thanks for that, David!
>
>
> Thank Randy Harmon for this one. It was he who recognized and solve
David Chelimsky wrote:
> On Tue, Jan 12, 2010 at 11:35 AM, Nick Hoffman
> wrote:
>
>> By the way, does this spec:
>>{:get => '/path'}.should route_to(...)
>> make this spec redundant?:
>>params_from(:get, '/path').should
By the way, does this spec:
{:get => '/path'}.should route_to(...)
make this spec redundant?:
params_from(:get, '/path').should == {...}
They read the same, but it feels like they each check one end of the
route's translation.
--
Posted via http://www.ruby-forum.com/.
___
Randy Harmon wrote:
> On 1/11/10 9:22 PM, Nick Hoffman wrote:
>>> Cheers,
>>> David
>>>
>> Thanks for that, David. I updated my spec (http://codepad.org/F828X7Fg).
>> For some reason though, it's still failing: http://codepad.org/s65Ckubc
>&
David Chelimsky wrote:
> I'd recommend using the route_to matcher that was added in 1.2.9
> instead.
>
> http://codepad.org/fLcxyA9N
> http://rspec.rubyforge.org/rspec-rails/1.2.9/classes/Spec/Rails/Matchers.html#M29
>
> It's more reliable, and aligns better with the rspec matchers API.
>
>
Amit Kulkarni wrote:
> Nick Hoffman wrote:
>> Hey guys. I'm having some trouble with a route spec. In routes.rb , I
>> have:
>> map.connect 'foods/search/:name', :controller => :foods, :action =>
>> :search
>>
>> foods_controller_spe
Hey guys. I'm having some trouble with a route spec. In routes.rb , I
have:
map.connect 'foods/search/:name', :controller => :foods, :action =>
:search
foods_controller_spec.rb has: http://codepad.org/dg3FERKw
Unfortunately, that fails: http://codepad.org/lck4r1S0
After reading the rspec-rail
On Fri, Aug 7, 2009 at 9:55 AM, Nick Hoffman wrote:
> Hey guys. I'm building an app in Sinatra, and am having some trouble
> writing a controller spec. It seems that #get isn't known:
>
> NoMethodError in 'server shows the index page'
> undefined method `get
Hey guys. I'm building an app in Sinatra, and am having some trouble
writing a controller spec. It seems that #get isn't known:
NoMethodError in 'server shows the index page'
undefined method `get' for #
I've pasted the spec, spec_helper, etc here, in case it's of any help:
http://pastie.org/5746
On Thu, Jul 23, 2009 at 5:58 PM, Chris
Sund wrote:
> Hey everyone,
>
> I just thought I would provide some feedback on my experience with the
> rspec book - I "just" finished it.
..snip..
> In any case, the book was great, I want to thank everyone that wrote
> it, and a special thanks to Ben Mabey
On Sun, May 24, 2009 at 3:25 PM, Rick DeNatale wrote:
> One thing which strikes me is that if Rails naming conventions were
> being followed:
>
> 1) the file name be lib/ad_sense_heaven_parser not lib/adsense_heaven_parser
> 2) the require wouldn't be needed since it would be autoloaded.
>
> Per
> -Original Message-
> From: rspec-users-boun...@rubyforge.org
> [mailto:rspec-users-boun...@rubyforge.org] On Behalf Of David Chelimsky
> Sent: Wednesday, May 27, 2009 5:55 PM
> To: rspec-users
> Subject: Re: [rspec-users] spec for authenticated user
>> before_filter :requires_user,
>>
On Sun, May 24, 2009 at 3:25 PM, Rick DeNatale wrote:
>> However, that doesn't really matter. The call to #require shouldn't
>> happen, because the method is supposed to be stubbed out.
>
> No that's what confused me.
>
> class KeywordListsController < ApplicationController
> ...
> private
> ...
>> Hi Fernando. I'm not sure what you mean by "the code never gets out of
>> this require statement".
> I should have said 'the interpreter never ...'
Ah, I understand what you mean now.
>> However, that doesn't really matter. The call to #require shouldn't
>> happen, because the method is suppos
On Sun, May 24, 2009 at 2:13 PM, Fernando Perez wrote:
>> Hi Fernando. In this case, I don't think it's a matter of using the
>> debugger.
>
> I suspect a problem in: require 'lib/adsense_heaven_parser', the code
> maybe never gets out of this require statement. The debugger would allow
> you to i
On Sun, May 24, 2009 at 1:10 PM, Rick DeNatale wrote:
> On Sun, May 24, 2009 at 12:25 PM, Nick Hoffman wrote:
>> Hi guys. I'm setting an expectation on a class method. For some
>> reason, the method isn't being stubbed, and the expectation isn'
On Sun, May 24, 2009 at 12:49 PM, Fernando Perez wrote:
>> I've been beating my head against this for a couple of hours. Any
>> thoughts?
> The easiest for you is to use the debugger and go through each line in
> the controller.
>
> Maybe @keyword_list.save is returning false? Stub it out and see
Hi guys. I'm setting an expectation on a class method. For some
reason, the method isn't being stubbed, and the expectation isn't
seeing the call.
In KeywordListsController#create, I call the private method
#create_keywords_and_associate, which calls AdSenseHeavenParser#parse
.
Thus, some of my s
> Basically, there are two situation.
> 1) I want to check if a function was called and I want to execute the
> function code
I don't think that's possible. Setting a method expectation (Eg:
template.should_receive(:render)) automatically stubs #render.
> 2) I want to check if a function was call
Hey there Evgeny. My response is inline.
> I call a partial inside another partial.
> _mother.haml contains:
> render :partial => "children/child"
> In mother_spec.rb file I am trying to stub the render call.
> Here is a working version:
> =
> template.should_receive(:render)
>
On Mon, Mar 16, 2009 at 7:00 AM, Yun Huang Yong wrote:
> Hi,
>
> I'm using Log4r and one of its neat features is its handling of blocks such
> that you can do:
> log.debug { "Something bad happened" + some_expensive_method() }
> instead of:
> log.debug("Something bad happened" + some_expensive_m
On Wed, Mar 4, 2009 at 2:58 PM, James Byrne wrote:
> Scott Taylor wrote:
>
>> You could try this plugin:
>>
>> http://github.com/aussiegeek/active_record_defaults/tree/master
>>
>> Scott
>
> Thanks, I will try this out.
Hi James. Just a quick message to let you know that I've used
active_record_d
On 26/02/2009, at 11:25 AM, David Chelimsky wrote:
On Thu, Feb 26, 2009 at 10:01 AM, Evgeny Bogdanov
wrote:
Could somebody please explain me what I am doing wrong.
I am trying to spec create.rjs file, that is returned from my
controller.
render_template("create.rjs") works just fine,
however
On 25/02/2009, at 9:49 PM, Suprie Leonhart wrote:
On Thu, Feb 26, 2009 at 4:39 AM, Nick Hoffman
wrote:
Hi Suprie. AFAIK, RSpec populates the "request" object in your specs
after a controller action is called. Since your "should know if it's
from blackberry&quo
On 25/02/2009, at 4:51 AM, Suprie Leonhart wrote:
On Wed, Feb 25, 2009 at 4:19 PM, David Chelimsky
wrote:
On Wed, Feb 25, 2009 at 1:57 AM, Suprie Leonhart
wrote:
> hi
>
> i'm testing some lib i've made for detecting mobile user agent, I
confused
> how to test the lib i've made.
> the test
On 24/02/2009, at 8:03 AM, vo.x wrote:
On 23 Ún, 18:41, Nick Hoffman wrote:
On 22/02/2009, at 3:34 PM, vo.x wrote:
Hello all,
Is there some best practice how to test Rails controller action
which
is using send_file method? Could you help me please?
Vit
On 23/02/2009, at 2:43 AM
On 22/02/2009, at 3:34 PM, vo.x wrote:
Hello all,
Is there some best practice how to test Rails controller action which
is using send_file method? Could you help me please?
Vit
On 23/02/2009, at 2:43 AM, vo.x wrote:
Just to be clear, this is how the action looks:
def download
log = Act
On 16/02/2009, at 4:12 PM, David Chelimsky wrote:
On Mon, Feb 16, 2009 at 1:48 PM, Nick Hoffman
wrote:
I often use #and_raise like so:
@error_message = 'Some error'
@sf.should_receive(:shift_time!).and_raise @error_message
However, after trying to do this:
@argument_error =
I often use #and_raise like so:
@error_message = 'Some error'
@sf.should_receive(:shift_time!).and_raise @error_message
However, after trying to do this:
@argument_error = mock_model ArgumentError,
:message => @error_message
@sf.should_receive(:shift_time!).and_raise @argument_error
and th
On 13/02/2009, at 7:26 PM, Fernando Perez wrote:
How do you spec protected controller methods such as before_filters
and
helpers that with the params and session hashes?
I cannot call controller.my_method if my_method is protected.
Try this:
controller.andreplace("foo and bar").should eql("
On 12/02/2009, at 2:59 PM, David Chelimsky wrote:
On Feb 12, 2009, at 1:03 PM, Nick Hoffman wrote:
Does RSpec automatically call #valid? on ActiveRecord models?
For instance, when this example is run:
it 'should reject a nil value' do
@form = TimeShiftForm.new :file =&
Does RSpec automatically call #valid? on ActiveRecord models?
For instance, when this example is run:
it 'should reject a nil value' do
@form = TimeShiftForm.new :file => nil
puts "@form.errors.count = <<#...@form.errors.count}>>"
@form.should have(1).error_on :file
puts "@form.errors.c
Ack, that subject is completely wrong! I forgot to update it after re-
writing the email.
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
I'm experiencing some strange behaviour with an ActiveRecord model
object. I'm trying to spec that a mocked AR object, @form, has an
error on the "file" attribute.
I've confirmed that there *is* an error on the "file" attribute,
because I print out the error.
However, the spec fails, sayi
On 31/01/2009, at 1:45 AM, jschank wrote:
Hello,
I recently unpacked the latest (1.1.12) rspec and rspec rails in my
applicaiton.
When I run my specs I get:
config.gem: Unpacked gem rspec-1.1.12 in vendor/gems has no
specification file. Run 'rake gems:refresh_specs' to fix this.
config.gem: Unpa
On 10/02/2009, at 10:09 PM, James Byrne wrote:
Zach Dennis wrote:
On Tue, Feb 10, 2009 at 6:22 PM, James Byrne
wrote:
David Chelimsky wrote:
please use "should be >=" as "should >=" will eventually be
deprecated
and removed.
Removed? You are not seriously contemplating forcing people
On 11/02/2009, at 8:51 AM, Kaleem Ullah wrote:
Hi,
I am quite new to Rspec. I want to use Rspec to test my existing
Code. I
start from Models (Unit Testing). Here i want your help on a issue.
Here is model/user_spec.rb
describe User do
before(:each) do
@user=User.new
@user.id='2'
On 17/12/2008, at 9:56 AM, James Byrne wrote:
Re: authlogin
Can someone familiar with this gem explain where and how the
user_sessions are maintained? I have pawed through the code but it
has
left me rather more confused than not. The best inkling I can
arrive at
is that the authlogic pe
On 08/02/2009, at 4:39 PM, Matt Wynne wrote:
On 7 Feb 2009, at 19:02, David Chelimsky wrote:
On Sat, Feb 7, 2009 at 12:27 PM, Pat Maddox
wrote:
On Sat, Feb 7, 2009 at 9:30 AM, Nick Hoffman
wrote:
With that said, I'm wondering what the accepted way to setup gem
dependencies on rspe
On 08/02/2009, at 7:44 AM, Remi Gagnon wrote:
I want to mock to Model.to_xml but not his block. How to do it?
Here is what I have (sorry for the formatting)
output = @detenteur.to_xml( :skip_types =>
false, :skip_instruct => true, :dasherize => false, :only =>
[:inte_no] ) do |xml_de
On 07/02/2009, at 10:45 PM, David Chelimsky wrote:
On Sat, Feb 7, 2009 at 8:05 PM, Nick Hoffman
wrote:
On 07/02/2009, at 1:16 PM, David Chelimsky wrote:
On Sat, Feb 7, 2009 at 9:59 AM, Nick Hoffman
wrote:
When writing Cucumber stories and features for controllers,
should you
cover
On 07/02/2009, at 1:16 PM, David Chelimsky wrote:
On Sat, Feb 7, 2009 at 9:59 AM, Nick Hoffman
wrote:
When writing Cucumber stories and features for controllers, should
you cover
every edge case? For example, should you write stories that feed
bad or
missing data to your controllers, or
On 07/02/2009, at 12:30 PM, Nick Hoffman wrote:
For a while now, I've had the following in config/environment.rb :
config.gem 'haml'
config.gem 'rspec', :lib => 'spec'
config.gem 'rspec-rails', :lib => 'spec/rails'
I just tried run
For a while now, I've had the following in config/environment.rb :
config.gem 'haml'
config.gem 'rspec', :lib => 'spec'
config.gem 'rspec-rails', :lib => 'spec/rails'
I just tried running the Rails console in production mode, and this
warning occured:
irb: warn: can't alias context from irb_
On 06/02/2009, at 10:00 PM, s.ross wrote:
I did stop writing new controller specs, but we were discussing the
use-case for controller specs in the new Cukified world. Supposing
you write scenarios that pretty much describe your app, what could
possibly go wrong that a controller spec would c
On 30/01/2009, at 9:49 AM, James Byrne wrote:
Pardon my ignorance, but exactly what does _fu mean WRT Ruby plugins,
gems and such?
I have run across this suffix a number of times in Ruby and Rails,
always in connection with some add-on or extension. In the original
context that I encountered '_
On 29/01/2009, at 4:27 PM, aslak hellesoy wrote:
On Thu, Jan 29, 2009 at 10:14 PM, David Chelimsky > wrote:
On Thu, Jan 29, 2009 at 2:38 PM, Nick Hoffman
wrote:
I like "on_failure", as it's consistent with RSpec's output. Eg:
31 examples, 0 failures
What could be don
On 29/01/2009, at 2:18 PM, David Chelimsky wrote:
On Thu, Jan 29, 2009 at 1:02 PM, aslak hellesoy > wrote:
On Thu, Jan 29, 2009 at 7:25 PM, David Chelimsky
wrote:
>
>
> On Thu, Jan 29, 2009 at 12:00 PM, wrote:
>>
>> Hi all,
>>
>> I've found myself writing a thing I think is less than optimal,
On 29/01/2009, at 1:41 PM, David Chelimsky wrote:
On Thu, Jan 29, 2009 at 12:08 PM, tatyree wrote:
Even if this is a bug, it's a pretty obscure one. It was frustrating
the hell out of me until I found a workaround, so I thought I'd just
post the details:
Given a find like this:
def self.find_
On 29/01/2009, at 1:00 PM, r_j_h_box...@yahoo.com wrote:
Hi all,
I've found myself writing a thing I think is less than optimal,
looking for suggestions. The context is, I'm testing a result, and
as a part of that test, I might verify two or three things, which
are individually relevant b
On 29/01/2009, at 10:36 AM, David Chelimsky wrote:
I’m pleased to announce the beta release of the Pragmatic
Bookshelf’s The RSpec Book: Behaviour Driven Development with RSpec,
Cucumber and Friends!
It’s been a long time coming, and there’s still a lot of work to do
to get to print. The b
On 27/01/2009, at 11:03 AM, Nick Hoffman wrote:
Hey guys. I've just found some odd behaviour within RSpec 1.1.12 ,
and would like to know whether this is a bug, or I'm doing something
wrong.
When I give multiple return values to a stub, like this:
SubtitleFile.stub!(:new).and_r
On 28/01/2009, at 12:16 PM, Pat Maddox wrote:
If it doesn't automatically clone (it may, I don't know), it probably
should provide a lambda syntax so you can do:
default :subtitles => lambda { [] }
Yeah, I just looked at the code for ARD and this is the problem. You
can pass in immutable objec
On 28/01/2009, at 12:12 PM, Pat Maddox wrote:
On Wed, Jan 28, 2009 at 8:30 AM, Nick Hoffman
wrote:
On 28/01/2009, at 7:50 AM, Zach Dennis wrote:
On Tue, Jan 27, 2009 at 2:48 PM, Nick Hoffman
wrote:
G'day folks. I've been beating my head on this one problem for a
couple
of
On 28/01/2009, at 7:50 AM, Zach Dennis wrote:
On Tue, Jan 27, 2009 at 2:48 PM, Nick Hoffman
wrote:
G'day folks. I've been beating my head on this one problem for a
couple of
hours, and have managed to figure out what's causing it. However, I
don't
understand why it
On 27/01/2009, at 7:44 PM, David Chelimsky wrote:
On Tue, Jan 27, 2009 at 1:48 PM, Nick Hoffman
wrote:
G'day folks. I've been beating my head on this one problem for a
couple of
hours, and have managed to figure out what's causing it. However, I
don't
understand why it
G'day folks. I've been beating my head on this one problem for a
couple of hours, and have managed to figure out what's causing it.
However, I don't understand why it's happening, nor do I know how to
solve or get around it.
One of my methods clones an arg, and it seems that doing so causes
On 27/01/2009, at 11:03 AM, Nick Hoffman wrote:
Hey guys. I've just found some odd behaviour within RSpec 1.1.12 ,
and would like to know whether this is a bug, or I'm doing something
wrong.
When I give multiple return values to a stub, like this:
SubtitleFile.stub!(:new).and_r
Hey guys. I've just found some odd behaviour within RSpec 1.1.12 , and
would like to know whether this is a bug, or I'm doing something wrong.
When I give multiple return values to a stub, like this:
SubtitleFile.stub!(:new).and_return @sf1, @sf2
RSpec complains:
Mock 'SubtitleFile_1001' re
On 25/01/2009, at 9:56 PM, Stuart Hungerford wrote:
Hi,
I've got a set of classes in nested Ruby modules which I'm using
rspec to specify:
module Foo
module Baz
class C1 ... end
class C2 ... end
end
end
To specify C2 behaviour I need to create a bunch of C1 instances:
On 23/01/2009, at 12:04 PM, Ben Mabey wrote:
So... I'm curious what people's thoughts are. When writing
acceptance tests how do you choose which tool is best for the job?
I often hear people complaining about the GWT syntax and they see no
benefit of it over the frameworks that provide con
Can anyone confirm that message expectations are not copied/duplicated
to the new object when using Object#dup or #clone ?
Thanks!
Nick
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
On 2009-01-17, at 14:16, LesFreeman wrote:
Hello,
I am trying to move shared specs out of my spec_helper and into
separate files. I found an article about the process here:http://
blog.kineticweb.com/articles/2008/04/15/automagical-rspec-shared-
example-loading-from-separate-files
Essentially, I
On 2009-01-17, at 05:10, Fernando Perez wrote:
G'day again Fernando. IIRC, Paperclip's #save_attached_files is what
takes care of saving the attachment to disk, uploading it to S3, etc.
Here's a small gist that tests the allowance of JPG files, and
ensures
that the file isn't saved [to disk, f
On 2009-01-16, at 17:42, Fernando Perez wrote:
Nicholas Wieland wrote:
Does someone have an example on faking a file upload for just
ensuring
it gets called, without actually uploading the file to s3.
I thought that stubbing Model.has_attached_file would be enough, but
it doesn't seem so ...
On 2009-01-16, at 17:19, Fernando Perez wrote:
Aslak Hellesøy wrote:
On Thu, Dec 25, 2008 at 2:04 PM, Manasi Vora
wrote:
I am using webrat 0.3.2 cucumber 0.1.13 activerecord 2.1.1
You need a newer webrat - for example gem install aslakhellesoy-
webrat
Aslak
Thanks that help me out. I
Hi guys. Which webrat gem should be used? There seem to be a few:
$ gem search -r webrat
*** REMOTE GEMS ***
aslakhellesoy-webrat (0.3.2.2)
benschwarz-webrat (0.3.2.1)
brynary-webrat (0.3.2.2)
flazz-webrat (0.3.2.1)
mfilej-webrat (0.2.1)
webrat (0.3.4)
On 2009-01-15, at 11:35, aslak hellesoy wrote:
On Thu, Jan 15, 2009 at 5:18 PM, aidy lewis
wrote:
Hi,
The users are using IE6. The Cucumber HTML appears fine in firefox,
opera, IE7 etc.
However, I am not receiving any colouring in IE6.
I put the cucumber.css through the w3c validator and no
Great work on the logo and website, Aslak & Co! It looks great, and
and the prominent six steps to using Cucumber is exactly what newbs.
I have one question about step #2. The Given-block initialises a new
Calculator each time it's run. This would cause the
"Given I have entered 50 into th
On 2009-01-03, at 23:17, Mark Wilden wrote:
On Sat, Jan 3, 2009 at 6:58 PM, Reza Primardiansyah > wrote:
I found out that running RSpec on Rails takes too much overhead. It
takes more than 16s per run although the specs only take less than
6s, like seen below.
The killer is the time it tak
On 2008-12-09, at 06:29, Ivor Paul wrote:
Hi
I have the following code:
def will_paginate(items, options = {})
options = options.merge(:container => true, :class => 'paging')
super(items, options)
end
I am curious about how to test that the call to super is infact
being called wi
On 2008-12-04, at 19:56, Pat Maddox wrote:
Nick Hoffman <[EMAIL PROTECTED]> writes:
On 2008-12-04, at 17:43, Nick Hoffman wrote:
The only solution that I can think of is to do this:
before :each do
@account_url = account_url
end
it_should_redirect_to 'the account page
On 2008-12-05, at 10:06, Daniel Lopes wrote:
Thanks for help and sorry for insistance but I don't understand
aspects on rspec ( I think not understand how we use mocks and stubs):
Hi Daniel. If you're a bit unsure about when to use mocks vs stubs,
have a read of this article by Martin Fowler
On 2008-12-05, at 01:51, Andrew Premdas wrote:
Scott
Working on this, assuming I have a cloned project 'foo' from my base
project base and I'm working on foo. So I implement something new
and then think this should be in base any ideas how to manage this.
Was thinking maybe of having a bas
On 2008-12-04, at 17:43, Nick Hoffman wrote:
The only solution that I can think of is to do this:
before :each do
@account_url = account_url
end
it_should_redirect_to 'the account page', @account_url
Actually, that suggestion above of mine doesn't work. It fails with:
On 2008-12-04, at 17:06, Zach Dennis wrote:
On Thu, Dec 4, 2008 at 3:41 PM, Nick Hoffman <[EMAIL PROTECTED]>
wrote:
Hi guys. I just wrote a small spec helper method to DRY up some of
my specs,
and found that passing a URL helper (Eg: #photos_url) to a method
results in
a NameError er
Hi guys. I just wrote a small spec helper method to DRY up some of my
specs, and found that passing a URL helper (Eg: #photos_url) to a
method results in a NameError error. I extracted the problem into its
own short spec file to isolate it. Any thoughts on what's going on?:
http://gist.githu
On 2008-12-04, at 13:34, Andrew Premdas wrote:
This is of topic but I have a feeling I might get some useful advice
here - hope you don't mind
I've created a rails project that I want to use as a basis for other
rails project. I was wondering if anyone had any tips on workflow
for doing th
On 2008-11-25, at 22:07, David Parker wrote:
Hello!
So I'm having some problems working out some probably really easy
associations in Rails. I've Googled around and read some things on
different Rails forums and blogs, but I just haven't seen many solid
examples.
Anyway, my question is
On 2008-11-25, at 14:04, s.ross wrote:
In Rails, the primary key, by default 'id', is used all over the
place. However, Ruby now deprecates the use of constructs like:
@post = Post.find(:first)
@post_id = @post.id
..snip..
Thanks,
Steve
Hi Steve. Ruby deprecated Object#id in favour of Objec
On 2008-11-24, at 11:47, James Byrne wrote:
Missing slash at end of regex
/When /should determine the party (.*)/
Sig Thanks.
Hey, it happens to the best of us, mate. At least it's an easy fix!
___
rspec-users mailing list
rspec-users@rub
On 2008-11-24, at 11:16, James Byrne wrote:
I have this:
When /obtain the party (.*)/ do |n|
n case
Hi James. Shouldn't that be "case n"?
-Nick
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
On 2008-11-24, at 00:39, Zach Dennis wrote:
Try: helper.format_utilities
Thanks everyone! I should have searched the API rather than Google.
I'll do that next time.
Cheers,
Nick
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyf
On 2008-11-21, at 09:20, Ramon Tayag wrote:
Hi everyone,
WIth restful_authentication you get a method "permission_denied" that
you just slap onto the controller when you don't want a user to gain
access to something. In this method Rails does a bunch of stuff then
basically tries to be smart an
I'm trying to write specs for a helper method that I'm creating, but
my specs are failing to find the helper method
# app/helpers/properties_helper.rb
module PropertiesHelper
def format_utilities(utilities)
end
end
# spec/helpers/properties_helper_spec.rb
require File.expand_path(File.dirn
On 2008-11-19, at 12:26, Chris Flipse wrote:
I've actually taken this old gem and enhanced it a bit
module Spec::Mocks::Methods
def stub_association!(association_name, methods_to_be_stubbed ={})
mock_assn = Spec::Mocks::Mock.new(association_name.to_s)
stub_association_with(association_
1 - 100 of 201 matches
Mail list logo