similar to: Good RoR design example.

Displaying 20 results from an estimated 4000 matches similar to: "Good RoR design example."

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
2007 Mar 28
1
attachment_fu & update_attributes... bug?
It seems that attachment_fu is a pretty popular plugin (it''s great), but I''ve been having a terrible time trying to figure out an issue when using "update_attributes". I''m storing files on the file system rather than in a database. It seems that when "update_attributes" is called with a new file, upload_data= tries to copy a file that
2007 Mar 02
2
ActMethods has been removed from the module tree ???
Hello, I wrote a light weight version of acts_as_attachment and this has been working fine for some time now (about a week). Now i get the title error: ActMethods has been removed from the module tree but is still active! I have updated edge rails a few times as my project uses active_resource. The closest thing ive found is an AAA post on beast forum: http://beast.caboo.se/forums/2/topics/664
2007 May 18
1
URL Fragment Anchors -- may be a Safari Question
Hi, I''m a new beginner so, please forgive if I am somewhat imprecise... I''m wanting to use fragment anchors in my pages. (I think that is the right term for them). So my URL will be something like pmrs/1#id56. I am using REST and resource style mapping. My first question is will this work o.k.? I''ve tested it a tiny bit and it seems o.k. but I''m worried
2006 Sep 18
2
RedCloth !image! bug with filter_html
Hi all! I am trying tu set up RedCloth for user-submitted comments. And here is my problem. The :filter_html option just breaks images :-( For example, if I try in irb: string= "Some textile !agif.gif! and textile again" RedCloth.new(string, [:filter_html, :filter_styles]).to_html(:textile) I get: NoMethodError: You have a nil object when you didn''t expect it! The error
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 May 31
28
Another attempt for a succinct model validation DSL
On 5/28/07, David Chelimsky <dchelimsky at gmail.com> wrote: > The behaviour you''re trying to describe is that the User should > require that passwords bear certain qualities - in this case a length > between 5 and 40. So you need to ask yourself how the User should > behave when this requirement is violated, and then specify that it > behaves that way. > >
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
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 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 Jun 21
9
it_should_behave_like
I''m trying to use it_should_behave_like, and something seems to be wonky with the syntax. When I add :shared=>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
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
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 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)
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.
2007 Oct 19
11
Patch idea for rspec_on_rails
I recently wrote a matcher for testing AR associations which allows you to specify things like: Foo.should have_many(:bars).through(:bazes) I''m pretty darned proud of it and a couple of people have suggested that I should submit it to the rspec_on_rails project. Before I go to the trouble of writing out rdoc and fully spec''ing it, I just wanted to make sure this was
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
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 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 Oct 31
12
autotest displays no output
Hey, I''m trying to configure autotest with rspec on cygwin but something is going wrong. I made a very simple testing environment with a user.rb and user_spec.rb file. Rspec works fine, but autotest outputs nothing - it just stays here, idle. ^C doesn''t display anything more. I can see it''s running because I added require ''autotest/snarl'' in my