[Rails] Re: my web app seed data and cucumber

2010-07-08 Thread Constantin Gavrilescu
On 8 juil, 14:34, Robert Walker wrote: > Constantin Gavrilescu wrote: > > I have three questions: > > 1. I don't want to run this MinimumData.populate task before each > > scenario because it takes 8 seconds. Should I make it run just once, > > globally? > >

[Rails] my web app seed data and cucumber

2010-07-08 Thread Constantin Gavrilescu
I'm writing a web app which is used a SaS. Each customer has their own db and app directory. I have a rake task which creates all necessary minimum data to run their website: default rights and roles, a superadmin user, a "us_states" table already populated, some local depots and terminals (it's a

[Rails] Re: in a view, call a helper method from another controller

2009-06-19 Thread Constantin Gavrilescu
On 14 juin, 05:18, Frederick Cheung wrote: > On Jun 14, 5:31 am, Constantin Gavrilescu > > wrote: > > > Here I want to use another's helper column_list: > > <%=render 'companies/companies', :object => >

[Rails] in a view, call a helper method from another controller

2009-06-13 Thread Constantin Gavrilescu
I need to call a helper method from another controller. The catch is that I have the same method name defined in my current controllers helper. Here the partial will use the the default column_list defined in my helper. <%=render 'companies/company', :object => @company%> For example, if I chang

[Rails] Multiple customers/tenants - keeping the data separate - how?

2009-04-22 Thread Constantin Gavrilescu
I have found this very good thread from 2006 about multi-tenant applications: http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/25bc6cd899318d9a/ I'm making my app available to multiple customers and right now my strategy is: 1. svn export code each customer has their own 2.

[Rails] Re: After Rails 2.3.2 upgrade: superclass mismatch for class TestCase (TypeError)

2009-04-06 Thread Constantin Gavrilescu
On 6 avr, 17:23, Frederick Cheung wrote: > On Apr 6, 11:09 pm, Constantin Gavrilescu > > wrote: > > I upgraded a working app from rails 2.1 to 2.3.2. Now when I run rake > > test:units I get this error: /usr/lib/ruby/gems/1.8/gems/ > > activesupport-2.3.2/lib/act

[Rails] assert_valid in unit tests after upgrade to rails 2.3 doesn't work

2009-04-06 Thread Constantin Gavrilescu
def test_valid assert_valid State.first end Error: test_valid(StateTest): NoMethodError: undefined method `assert_valid' for # I see that test_valid is now in ActionController::Assertions::ModelAssertions. Does this mean that test_valid is designed to be used i ActionController tests on

[Rails] Re: After Rails 2.3.2 upgrade: superclass mismatch for class TestCase (TypeError)

2009-04-06 Thread Constantin Gavrilescu
On 6 avr, 17:23, Frederick Cheung wrote: > On Apr 6, 11:09 pm, Constantin Gavrilescu > > wrote: > > I upgraded a working app from rails 2.1 to 2.3.2. Now when I run rake > > test:units I get this error: /usr/lib/ruby/gems/1.8/gems/ > > activesupport-2.3.2/lib/act

[Rails] After Rails 2.3.2 upgrade: superclass mismatch for class TestCase (TypeError)

2009-04-06 Thread Constantin Gavrilescu
I upgraded a working app from rails 2.1 to 2.3.2. Now when I run rake test:units I get this error: /usr/lib/ruby/gems/1.8/gems/ activesupport-2.3.2/lib/active_support/test_case.rb:17: superclass mismatch for class TestCase (TypeError) I generated a new test app and all tests run OK. For the upgr

[Rails] Re: Parsing html files => putting them in fixtures for testing

2009-03-07 Thread Constantin Gavrilescu
On 7 mar, 07:39, MaD wrote: > you are right. it seems like an error that occurrs after reading your > yml-file. obviously there are some additional whitespaces/carriage > returns added to it. but you could just gsub them. It may not be just the whitespace, because the parser gives different resu

[Rails] Parsing html files => putting them in fixtures for testing

2009-03-07 Thread Constantin Gavrilescu
I'm using Hpricot parser to scrape web pages. I saved two of these pages for a test in lack of a better way, I put the html files in the fixtures like this: dl_found_tickets: html: "<%= File.read( 'test/fixtures/html/ search_dl_found_tickets.html' ).gsub('"', '\"') %>" [...] Even though the

[Rails] Optional parameter in nested routes

2008-12-01 Thread Constantin Gavrilescu
All my charges belong to a company. On the new charge form, sometimes I specify a company, sometimes I don't because I don't know the company beforehand in all cases. So, sometimes the @company object is nil. I'm using this helper: new_company_charge_path(@company) For a company object, it genera