El Tue, 27 de Apr de 2010, a las 09:30:21PM -0300, Porta dijo: > Buenas. > Pregunta rápida: > Alguien tuvo problemas con RSpec usando el metodo create de un modelo con > act_as_taggable_on? > > Este es el test que falla: Cómo falla no tiene niguna categoría? Sería útil que hagas un pastie con los modelos involucrados y las salida de la falla del test
> On 23/04/2010 18:37, Juan Pablo Taulamet wrote: > #statement_spec.rb > describe Statement do > > before(:each) do > @statement = Statement.create(:text => 'dummy text', :category_list => > 'Some_Category') > end > > it "should have only ONE category" do > @statement.categories.length.should == 1 > end un detalle podés hacer: @statement.should have(1).categories > > end > > > Y este es el modelo: > #statement.rb > class Statement < ActiveRecord::Base > acts_as_taggable_on :categories > end > > Googleando un poco, lo mas parecido a una explicación que encontré fue esto: > > http://developer.newsdesk.se/2009/05/07/rails-gotcha-global-methods-can-cause-activerecord-attribute-methods-to-never-be-defined/ > > Pero ni siquiera estoy seguro de que ese sea el problema. > > Alguna idea? > > Por las dudas, aclaro que cuando corro el codigo por script/console, anda > todo perfecto. > > Gracias! > > Porta. > _______________________________________________ > Ruby mailing list > [email protected] > http://lista.rubyargentina.com.ar/listinfo.cgi/ruby-rubyargentina.com.ar -- "Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris." (Larry Wall) +-------------------------------------+ Gastón Ramos http://gastonramos.com.ar/ GNU/Linux Counter user #450312 _______________________________________________ Ruby mailing list [email protected] http://lista.rubyargentina.com.ar/listinfo.cgi/ruby-rubyargentina.com.ar
