Displaying 20 results from an estimated 3000 matches similar to: ".html.erb files and autotest"
2008 Jan 23
18
Not seeing the failure
All,
I''m missing something simple, I think. I am writing a spec to say that my
CouponController should create a new coupon from the form parameters, then
set the current user. Here''s the spec:
describe CouponController, "When posting to save_coupon" do
before(:each) do
@expectedName = "pepper''s"
@expectedAmount = 5
coupon =
2008 Jan 15
4
Okay, I''m finally asking for help
Hi, all!
I would love if someone could help me figure this out. I can''t seem to see
why the following fails:
Here''s the spec:
it "should redirect back to the index page" do
Coupon.should_receive
(:new).with({"name"=>@expectedName,"amount"=>@expectedAmount}).and_return(@coupon)
@coupon.should_receive(:save)
response.should
2008 Jan 27
20
OT local version control?
Hi, all,
This isn''t about rspec, but this list has people whose opinions I respect.
So, I''m looking for a new version control system for my local development. I
was going to install subversion, but I''ve heard rumors of people using some
newer ones. Thoughts? I''d like to be able to run it either locally or on a
home server. If I run it off a home server, then
2008 Jan 31
6
loading fixtures?
How do you load fixtures from specs as you would test?
eg. rake db:fixtures:load RAILS_ENV=development
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/rspec-users/attachments/20080131/38c3b0ab/attachment.html
2008 Mar 04
2
textmate bundle
Hi,
I''m just getting e set up on my machine, and I was wondering if someone
could point me to the current rspec bundle for textmate? I googled and found
a million of them, I think.
Thanks.
-Corey
--
http://www.coreyhaines.com
The Internet''s Premiere source of information about Corey Haines
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2008 Mar 19
3
ApplicationHelper
When working with views, I use instance methods of ApplicationHelper:
# app/helpers/application_helper.rb:
module ApplicationHelper
def distribute(total, min, cutof, list)
[1,2,3]
end
end
# app/views/planner/_mta_colors.rhtml:
<td>
<%
...
dist = distribute(total_v_px, 4, 0, colors.collect{|color| color[1]})
...
%>
So to test the distribute method in ApplicationHelper, I have
2007 Dec 27
5
ExampleGroup and SharedExampleGroup relationship(?)
I''m working on a series going over the source code for rspec, and I ran into
something interesting with ExampleGroup and SharedExampleGroup. I was
wondering if anyone could shed light on it.
[NOTE: I''m working through the code for my own edification in learning Ruby.
Ruby has some features that I think are incredibly cool, so I''m using a
concrete implementation (RSpec)
2008 Mar 11
6
Story testing views in isolation
Hi,
I''ve been investigating plain text stories, and I had a quick question. How
would I go about creating story tests for views in isolation, instead of the
full stack? I had hoped to be able to do a straight render ''/'', but it says
it can''t find the method.
The reason that I want to do this is that I want to give our
designer/business people a way to write
2008 Jan 29
3
I thought the RSPec community might be interested
in my latest blog posting
:http://talklikeaduck.denhaven2.com/articles/2008/01/29/why-i-dont-mind-using-rspec-in-fact-ive-come-to-love-it
--
Rick DeNatale
My blog on Ruby
http://talklikeaduck.denhaven2.com/
2008 Mar 05
2
Testing that a model helper method is called
So, I have a plugin that adds a method to ActiveRecord::Base, let''s call the
method is_encrypted.
class MyModel < ActiveRecord::Base
is_encrypted
end
So, my question is, how do I write a spec to show that is_encrypted is
called here? I would rather not write specs that say that the behavior is
there, since I have tested the behavior already in my plugin.
Thanks.
-Corey
--
2008 Jan 20
2
Which taggable library do people use?
I''d like to add taggability to a model in the site I''m working on, and I
wanted to get an idea of what people are using. I keep seeing that
acts_as_taggable is deprecated, so I tried the acts_as_taggable_on_steroids.
I also tried be_taggable.
In any case, I figured I''d see what people use.
thanks.
-corey
--
http://www.coreyhaines.com
The Internet''s Premiere
2008 Mar 14
2
Multiple should_receive(:render).with
I''m trying to specify that a particular view must render two different partials.
My spec looks like:
describe AClass do
it do
template.should_receive(:render).with(:partial => ''foo'', :locals => { ... })
...
end
describe ''some conditional case'' do
it do
template.should_receive(:render).with(:partial =>
2008 Mar 04
3
rspec vs. test::more
Hey all,
you HAVE to read this blog post:
http://blog.jrock.us/articles/RSpec%20vs.%20Test::More.pod#comments
My favorite parts are:
1)
... some rspec code ...
> For the sake of comparison lets translate this directly into perl:
... some perl code ...
2)
>First, notice that the rspec-version isn''t actually ruby code. It''s
not any real language.
For the sake of
2008 Mar 08
7
ridding away with do_request
I''m heading out of town, but had a quick thought I wanted to share.
Rather then using ambiguous named request helpers in controller specs
like "do_request", I''ve been using more readable helpers like
"post_create".
For example...
describe ProjectController do
def post_create
post :create, ...
end
before do
end
it "creates a new
2008 Mar 21
3
Oh inheritacne, wherefore art thou
Is there anyway to achieve inheritance of specifications?
Suppose I had an action like
def index
filter = params[:filter] ? params[:filter] : ''%''
order = params[:order] ? params[:order] : ''created_at DESC''
@posts = Post.find(:conditions => "title LIKE #{filter}", :order => order)
...
end
Now I might have half a dozen specs for this
2008 Mar 05
7
mocking successive return values
I''m having a problems mocking successive return values. I don''t know
if I''m doing something wrong or if this is a limitation of rspec
mocks. Any ideas of what I may be doing wrong?
I''m trying to test the generate_quote_number method. It generates a
quote number, looks to see if it is in the db already. If it is, it
calls itself to try again. I want
2008 Jan 30
2
(no subject)
Message-ID:<ef1d468f0801291747q3f605e6cjb73028a888a441ee at mail.gmail.com>
On: Tue, 29 Jan 2008 20:47:41 -0500, "Andrew WC Brown" <omen.king at gmail.com>
wrote:
> I''ve seen lambda before but not sure what it does.
A lambda is a fancy name for an anonymous or unbound function. Its
significance comes from the fact that it is completely stateless, producing no
2008 Jan 13
1
View spec''ing style
I''ve been getting my head around view spec''ing lately for a fairly
complex project that makes heavy use of partials in views and I have hit
up against a style puzzle.
I see two strategies for spec''ing views:
First:
Develop detailed specs for each partial and then make sure that the
final view expects that the appropriate partials are included and used.
Pros:
2006 Dec 21
7
rspec_autotest no longer re-runs tests with rspec 0.7.5
Has anyone else encountered this problem?
What I mean is, rspec_autotest runs all specs, then waits. When you
change a spec, it reruns that spec. However, if that spec now passes,
it should run the whole suite again, so you can see the next one to
work on. It no longer does this. This renders it somewhat useless.
Does anyone have autotest working with rspec 0.7.5, or does anyone
have any
2008 Feb 29
5
outside-in = integration tests on views?
Hi,
In the spirit of "outside-in" are given-when-then scenarios supposed to be
integration tests of views? Or should we be accessing the model interfaces
directly (not through a view)?
Thanks,
David :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/rspec-users/attachments/20080229/dc6b1660/attachment.html