Displaying 20 results from an estimated 3000 matches similar to: "should_change"
2006 Dec 04
5
should_be_different -- possible implementation
There is an assert_difference helper for Test::Unit (you can read
about it at http://blog.caboo.se/articles/2006/06/13/a-better-
assert_difference and to some it should look familiar -- you know who
you are :), so I took a shot at one for rSpec on Rails.
class Object
def should_be_different(method = nil, difference = nil)
return self.should_not_eql(yield) if method.nil?
2007 Sep 25
7
simple story, extract link
hi,
I just started fooling around with story runner, thought I''d start
with a dead simple scenario:
The first thing I do when describing a site to someone is go to the
home page, and begin exploring public pages from there.
So, that seems like a good first story to spec out.
And I''d really like to extract the actual link from the rendered page
(rather than just
2007 Dec 04
1
spec''ing shared controller methods
I want to isolate and spec methods that are shared by controllers,
and live in application.rb.
Whereas I usually also provide examples in individual controllers
that use these methods, not necessarily all the edge cases and I''d
like to isolate the examples.
This is the approach I''m taking (thanks to bryanl for suggestions and
http://pastie.caboo.se/123626). WDYT?
This
2007 Aug 12
3
Scope and specing models
Hello all, I''m currently having an issue with some specs, specifically scope
issues (probably more of a scope issue than a spec issue at this point)...
Here''s the error:
ActiveRecord::AssociationTypeMismatch in ''A new User should know what role
it has''
Role expected, got NilClass
D:/ruby/projects/restful_authentication_test/config/../app/models/role.rb:5:in
2007 Jul 31
11
helper spec not finding rails core helpers
Hi,
My helper specs were going ok until I added a call to a rails
DateHelper method in one of my helpers
http://api.rubyonrails.com/classes/ActionView/Helpers/
DateHelper.html#M000574
The helper runs fine from my view templates, just dies in the spec test.
I boiled my question down to a simple (not too useful) example. I''m
not sure what I''m missing.
#
2007 Jun 09
11
authentication, controller specs. I think I''m missing something simple ....
Hi all,
I feel like I''m missing something really easy and I''m just not seeing
it.
I''m using the restful_authentication plugin and have a User model. Uesr
has_many :things and Thing belongs_to :user.
That''s it.
I did a "script/generate rspec_scaffold thing" to generate all the
necessary bits. The "rake db:migrate" to create the db.
At
2006 Dec 24
6
What do you think of this controller spec?
Here''s a controller spec I wrote, it''s for a very simple RESTful
controller (well, aren''t all RESTful controllers simple? :)
I''ve created a couple spec helper methods to refactor some of the
common code...for example, require_login_and_correct_user creates two
specifications: one for when the user isn''t logged in, and one when
the user is logged in but
2007 Aug 06
5
Problems with array mock
Hi everyone,
I''m trying this in my helper spec and it didn''t work:
@curr_odontogram.should_receive(''photos[1]'').and_return(@photo)
and the error is:
SyntaxError in ''PersonHelper Deberia devolverme un link para eliminar una foto''
compile error
/home/gramos/src/rails/r-dental/config/../vendor/plugins/rspec/lib/spec/mocks/proxy.rb:99:
syntax
2007 Sep 07
3
Fails to restart mongrel cluster after Capistrano rollback (PIDs not deleted)
Hi,
I am deploying a Rails website using Capistrano to a VPS running the
site through Apache and Mongrel.
''cap deploy'' works fine, and mongrels are restarted. When I execute
''cap deploy:rollback'', however, my script fails to restart the
mongrels giving this error:
!!! PID file tmp/pids/mongrel.5000.pid already exists. Mongrel could
be running already.
2007 Jun 11
2
not response
(rails)
I was making a model called Survey and another called Response
hehe, don''t use a model named Response...
it really messes up the mocks and stubs
:)
2007 Aug 14
1
Upgrade to 1.0.8 broke Rake
Hello Guys.
I''m upgrading a project from 0.9.8 to 1.0.8, following this procedure:
* Removed vendor/plugins/rspec* completely.
* installed rspec and rspec_on_rails from
svn://rubyforge.org/var/svn/rspec/tags/REL_1_0_8
* Run script/generate rspec to update spec_helper and spec.opts
Now, when running rake, get the following error: superclass mismatch
for class Annotation
The following
2007 Aug 02
3
Code works in console but fails test?
So I have message model and each user has many messages. When I run
user.messages in the console it returns correctly, however in the test
it returns and empty collection? Any thoughts. All the sql is being
generate correctly, I checked the log. Here''s a pastie with the code
in question.
http://pastie.caboo.se/84337
--~--~---------~--~----~------------~-------~--~----~
You received
2008 Mar 23
1
redcloth gem ragel code doesn''t build in jruby
I tried to install RedCloth-3.274 in jruby (trunk) but the install
failed when RedCloth tried to build the C code using mkmf:
I forget whether SuperRedcloth ever did build in JRuby??
I know Hpricot (which also uses ragel which can compile to Java code)
works in JRuby -- with the patch here:
https://code.whytheluckystiff.net/hpricot/ticket/131)
I might be confusing the two ...
FYI: If you
2007 Feb 24
3
Spec failing [Possible Bug with kind_of? and instance_of?]
I have a spec which is failing, but I just can''t say why. Maybe I''m
missing something painfully obvious?
Here is the pastie of the results & the spec:
http://pastie.caboo.se/42626
The spec to look for is "should have an array of users" I''ve printed
out ("puts''ed") to the terminal the fact that the values are
*opposite* to what
2007 Aug 07
4
Problems with raising errors on a mocked object
I''m trying to mock a object to raise a certain error. By doing so I
get a ArgumentError on ActiveRecord''s save! method:
http://pastie.caboo.se/85628
I''ve tried to debug it but just can''t seem to find what I''m doing
wrong. Any help is greatly appreciated.
Cheers,
Eivind Uggedal
2007 Sep 20
4
issues submitting a search form
Hello to the list and thanks to Aaron for the cool software.
I''ve been fooling around with Mechanize and Hpricot for a couple of
days and from the docs I''ve read, the following code SHOULD work but
doesn''t. I''ve tried the same code on a couple of different sites and I
get the same exception for each. Any pointers or suggestions are
appreciated.
2008 May 03
6
Everyone Using Rspec Autotest?
I haven''t been spec''ing lately, but been hopping back on and adding
autotest.
However I get an error:
http://pastie.caboo.se/177538/wrap
I also noticed a post by Scott and there was mention of rspec_autotest.
Is this is what everyone is using?
http://svn.caldersphere.net/svn/main/plugins/rspec_autotest/
2007 Oct 20
14
Problems with form_for and partials
i''m having problem with a form_for situation where i''m trying to DRY
out the repeated parts of my forms and put them in common/form and
render the form elements via another partial in controller_name/_form.
Here''s the first form
# app/views/common/form
<% form_for ... do |f| -%>
<%= render :partial => "params[:controller]/form", :object => f
2007 Aug 31
2
How to spec routes for a resource nested in multiples resources?
Hi,
I got the resource "Llamadas" nested in:
- Operadores
- Productos
- Centros
Here is part of my routes http://pastie.caboo.se/92767
I want to spec that the routes for Llamadas, I tried several approachs:
- route_for(:controller => "llamadas", :action => "exitosas",
:operador_id => 1).should == "/operador/1/llamadas;exitosas"
-
2007 Sep 21
5
Stubbing yielding methods
I''ve just been tying my brain in knots looking at bug #8687 (
http://rubyforge.org/tracker/index.php?func=detail&aid=8687&group_id=1917&atid=7477
).
I''ve been (1) trying to work out whether there is anything logically wrong
with Mocha''s existing behaviour and (2) whether Mocha should support the
requested functionality.
It all centres around the use of the