search for: caboo

Displaying 20 results from an estimated 286 matches for "caboo".

Did you mean: aboo
2006 Dec 24
6
What do you think of this controller spec?
...ications: one for when the user isn''t logged in, and one when the user is logged in but requests someone else''s book. do_request automatically calls do_get/post/put/delete depending on what''s implemented. Here''s all the code: books_controller.rb: http://pastie.caboo.se/29469 books_controller_spec.rb: http://pastie.caboo.se/29470 spec_helper.rb: http://pastie.caboo.se/29471 The specs just feel somewhat unwieldy to me...maybe it''s because the controller code is very simple and elegant, and the spec looks big and bloated in comparison. Also, it feels l...
2007 May 31
28
Another attempt for a succinct model validation DSL
...lid"/"invalid"), because they get right to the core of what actually happens, i.e. what the behavior is. And I like the emphasis on the examples (especially since I often think of TDD/BDD as EDD, Example Driven Design). So here''s my latest thought-experiment: http://pastie.caboo.se/66478 And also, a simpler multi-field version: http://pastie.caboo.se/66510 Notice how checking all three sides of each boundary is so simple and succinct that there is almost no excuse not to do so. Also, after noticing how similar the multi-field validation is to a fit-table or some of Brian...
2007 Jun 09
11
authentication, controller specs. I think I''m missing something simple ....
...9;'m sure it will be a use-case that crops up in my application. The basic issue I''m struggling with is how does define mocks/stubs for a controller method that does something of the form: method_a.method_b.find Pasted code/spec/errors here * things_controller http://pastie.caboo.se/69136 * things_controller_spec http://pastie.caboo.se/69137 * Errors w/ find(:all) http://pastie.caboo.se/69138 -- Rick rick.tessner at gmail.com
2007 Aug 12
3
Scope and specing models
...::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 `add'' ./spec/models/user_spec.rb:62: script/spec:4: Here''s the user.rb http://pastie.caboo.se/87029 role.rb http://pastie.caboo.se/87030 user_spec.rb http://pastie.caboo.se/87032 The code is based off of RESTful authentication + Ben Curtis'' user roles in Rails Application: http://www.bencurtis.com/archives/2007/06/user-roles-in-rails-applications/ Thanks for your help! -- d...
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 Aug 06
5
Problems with array mock
...onfig/../vendor/plugins/rspec/lib/spec/mocks/proxy.rb:99: syntax error, unexpected ''['', expecting ''\n'' or '';'' def photos[1](*args, &block) does anyone have a good solution for this? the complete code of the helper: http://pastie.caboo.se/85287 the complete code of the spec helper: http://pastie.caboo.se/85289 See you. -- Gast?n Ramos GNU/Linux Counter user #450312 http://gastonramos.wordpress.com/ No a la Matricula Obligatoria http://noalamatricula.wordpress.com/about/
2007 Jun 21
9
it_should_behave_like
...gt;true, the DSL complains that the next line is the fixture declaration: /vendor/plugins/rspec/lib/spec/dsl/behaviour_eval.rb:137:in `method_missing'': undefined method `fixtures'' for #<Spec::DSL::EvalModule:0x324a2cc> (NoMethodError) Here''s the spec http://pastie.caboo.se/72287 Am I using it_should_behave_like properly? Am I making a separate mistake? I have RSpec setup as a svn external (currently rev2101). Thanks, Jordan http://jordan.mckible.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rs...
2007 Jun 07
6
Problem with response.should render_template
Hello, I have problems with this spec controllers: http://pastie.caboo.se/68634 when I run: rake spec:controllers I get this error: ...............F...... 1) ''DocTypeController should update and redirect to show'' FAILED expected redirect to {:action=>"show", :id=>1}, got redirect to "http://test.host/doc_type/show/%23%3CSpe...
2007 Jun 05
6
Help with spec controller
Hello, I haven''t been able to create a controller spec. You can see the code here: http://pastie.caboo.se/67980 The error message I''m getting is: Spec::Mocks::MockExpectationError in ''PersonController should tell the Person model to create a new person on POST to create'' Mock ''person'' received unexpected message :save with (no args) /home/gramos/src/rai...
2008 Feb 13
7
Good RoR design example.
Hi all, I was wondering if anyone could point me to a good (ideally simple) example of RoR design. I am rather new to this subject, and I am playing with https://rubyforge.org/projects/mystic/ as an simple example to understand how stuff works, but I am not entirely convinced that it has been properly written in terms of locating html code, javascript code, etc. (e.g. There is a fragment of html
2008 Mar 11
2
for a beginner - good rspec examples?
I''m learning to use rspec and I want to see some good examples. Any recommendations of open source projects that demonstrate the use of rspec? So far I''ve found: 1) the Caboose sample app (http://sample.caboo.se/) 2) the Altered Beast forums app (http://beast.caboo.se/forums/1/topics/4650 ) Any others come to mind? I''m especially interested in seeing examples that spec RESTful authentication. Thanks, Daniel
2007 Sep 20
4
issues submitting a search form
...h 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. http://pastie.caboo.se/99216 -- Thank you, Shane Witbeck Digital Sanctum, inc. ----------------------------------------------------- skype: digitalsanctum blog: http://www.digitalsanctum.com
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 19
11
Patch idea for rspec_on_rails
...ect. Before I go to the trouble of writing out rdoc and fully spec''ing it, I just wanted to make sure this was something the community would like. Instead of pasting in the code into the email, I thought I''d just make a pastie and let those interested read it there: http://pastie.caboo.se/108922 I think it would make a nice addition to the current Rails matchers. Here''s hoping you do too. RSL
2007 Oct 23
4
Weird application/x-www-form-urlencoded bug
Hello, I experienced a weird bug today, while implementing an AtomPub server. I pasted all the story and bug details here : http://p.caboo.se/110125 It maybe be related to http://code.whytheluckystiff.net/camping/ticket/142 ... I am using - mongrel 1.0.1 - camping 1.5 Cheers, -- Simon Rozet <simon at rozet.name>
2007 Apr 12
19
Multiple Model Search
[from out-of-band communication with steven, just for the record] Hi! On Wed, Apr 11, 2007 at 01:47:49PM +0200, Steven Garcia wrote: > Hey Jens, > [..] > > 1. Is the Search model just an Active Record object or do I need to > set up a database for it as well (if so then with what columns)? No, that search model is just a plain class that backs your search form. If you want to
2007 Sep 07
3
Fails to restart mongrel cluster after Capistrano rollback (PIDs not deleted)
...sure how I end up with this problem, as the old dir I''m rolling back also has the link setup. The mongrels are stopped, but for some reason they don''t clean up their PID files, and thus they fail to start again. The full output of the rollback looks like this: http://pastie.caboo.se/94602 My deploy.rb looks like this: http://pastie.caboo.se/94600 Any help on this issue would be appreciated - thanks! Best regards, Casper Fabricius
2007 Jun 15
3
dynamic specs
...} @account.balance.should_not == 1000 end instead of doing each attribute manually however, I''d like to automate it so I can pass a list of attributes which CAN be assigned that way and let the code figure out what should be protected. Here''s what I have so far : http://pastie.caboo.se/70685 the problem is, I can''t figure out how to make "protected attributes" reusable. I''d like to be able to pass it a different class name and list of allowed attributes at run time, but AFAIK, shared behaviours can''t be sent parameters. I tried using insta...
2006 Jul 28
11
Forum
Im making forum and i have problem with paths. Here is code: http://pastie.caboo.se/6389 With this code, it works. But its a bit weird to use so many paths function. For every path i need to make new function. So can you suggest me something. Tables are like here: http://wiki.rubyonrails.com/rails/pages/ForumExample -- Posted via http://www.ruby-forum.com/.
2007 Sep 21
5
Stubbing yielding methods
...logically wrong with Mocha''s existing behaviour and (2) whether Mocha should support the requested functionality. It all centres around the use of the Expectation#yields method. I''ve put a couple of examples together to try and help me think about it. The first one (http://pastie.caboo.se/99412) is a simplified version of the example in the bug report using a block and stubbing a method that yields to that block. In the second example (http://pastie.caboo.se/99413) I tried to think about how it would work if I converted the block to a method on an object. I slightly ran out of s...