Displaying 20 results from an estimated 7000 matches similar to: "(no subject)"
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 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
2007 May 27
12
Checking for Range
how would you check for a range using rspec?
person.password.range.should == Range.new(5..40) <- this doesn''t work
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/rspec-users/attachments/20070527/4d8cb007/attachment-0001.html
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 13
10
.html.erb files and autotest
When I work with a .html.erb file, the autotest rspec on rails stuff doesn''t
understand the file to map it to the right test. I wanted to submit a patch
for this, but I''m unsure where the specs would be to update. I found the
necessary mapping in rspec_autotest.rb, but I can''t find any specs anywhere.
Help?
I just need to have
/app/views/coupon/index.html.erb to map to
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 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:
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 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
2005 May 27
2
Possible bug not deleting files
I am using rsnapshot <http://www.rsnapshot.org/> to make snapshots of
my filesystem. rsnapshot uses rsync to do all the heavy lifting. I
was recently browsing my snapshots and discovered that none of the
excluded files or files deleted in the source are getting deleted from
the snapshot. rsnapshot calls rsync like this:
/usr/bin/rsync -a --delete --numeric-ids --relative --delete-excluded
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 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 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 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
2007 Dec 29
15
Do you think it would look cleaner?
I was looking over some of my specs.
I was thinking that the following:
@game.should_receive(:name).and_return(''The Battle for Blaze'')
@game.should_receive(:people).and_return(5000000)
@game.should_receive(:activated).and_return(true)
Would it look cleaner if I could do this instead?
@game.should_recieve_and_return(
:name => ''The Battle for Blaze''
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
2007 Aug 06
4
[Patch] HttpServer.port reports the bound port
This is for when you pass mongrel 0 for the port and the OS assigns
an open one.
Corey
--- mongrel-1.0.1/lib/mongrel.rb 2007-08-05 15:29:59.000000000
-0700
+++ mongrel-1.0.1/lib/mongrel.rb.zero_port_fix 2007-08-05
15:29:23.000000000 -0700
@@ -560,7 +560,7 @@
@socket = TCPServer.new(host, port)
@classifier = URIClassifier.new
@host = host
- @port = port