Re: [Rails] Is the test database cleared after each test?

2016-12-03 Thread 'krfg' via Ruby on Rails: Talk
On Friday, December 2, 2016 at 10:45:45 PM UTC+1, Colin Law wrote: > > > The default is that the database will be rolled back between tests. If > you look in test.log you will the rollbacks happening. > > This is coherent with a useful stackoverflow topic

Re: [Rails] Is the test database cleared after each test?

2016-12-02 Thread Colin Law
On 2 December 2016 at 16:57, 'krfg' via Ruby on Rails: Talk wrote: > Some of my tests would not pass if the test database was not cleared after > the previous tests. > For instance my application, based on the Michael Hartl's tutorial, gives > users the

Re: [Rails] Is the test database cleared after each test?

2016-12-02 Thread 'krfg' via Ruby on Rails: Talk
I will have a look at database_cleaner. Many thanks for your suggestion. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to

Re: [Rails] Is the test database cleared after each test?

2016-12-02 Thread Dave Aronson
On Fri, Dec 2, 2016 at 12:56 PM, 'krfg' via Ruby on Rails: Talk wrote: > On Friday, December 2, 2016 at 6:45:12 PM UTC+1, Dave Aronson wrote: >> >> The important thing is that every test start from a *known state*. >> The easiest state to achieve and reason

Re: [Rails] Is the test database cleared after each test?

2016-12-02 Thread 'krfg' via Ruby on Rails: Talk
On Friday, December 2, 2016 at 6:45:12 PM UTC+1, Dave Aronson wrote: > > > The important thing is that every test start from a *known state*. > The easiest state to achieve and reason about, is empty. > And what is Rails' default behaviour? I only guess that it empties all tables after each

Re: [Rails] Is the test database cleared after each test?

2016-12-02 Thread Dave Aronson
On Fri, Dec 2, 2016 at 11:57 AM, 'krfg' via Ruby on Rails: Talk wrote: > Some of my tests would not pass if the test database was not cleared after > the previous tests. The important thing is that every test start from a *known state*. The easiest state to

[Rails] Is the test database cleared after each test?

2016-12-02 Thread 'krfg' via Ruby on Rails: Talk
Some of my tests would not pass if the test database was not cleared after the previous tests. For instance my application, based on the Michael Hartl's tutorial, gives users the opportunity to create an association between two users. The web interface is configured to use or not use Ajax. There