# How do I run the Rails test suite on Edge?

**URL:** <https://www.ruby-forum.com/t/how-do-i-run-the-rails-test-suite-on-edge/67978>\
**Category:** Rails\
**Created:** [September 8, 2006, 8:18am UTC](https://www.ruby-forum.com/t/how-do-i-run-the-rails-test-suite-on-edge/67978 "2006-09-08T08:18:04Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![weyus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7ab992/32.png) [@weyus](https://www.ruby-forum.com/u/weyus)\
**Post date:** [September 8, 2006, 8:18am UTC](https://www.ruby-forum.com/t/how-do-i-run-the-rails-test-suite-on-edge/67978/1 "2006-09-08T08:18:04Z")

</div>

I want to submit a patch for Rails.

I have checked out from the trunk.

I have created what I assume is the test database based on contents of  
activerecord/test/fixtures

QUESTIONS:

1. I’m not sure how to actually attempt to run the tests. Where do I  
configure the DB connection to point to my test database?

2. How do I actually run the tests?

Thanks,  
Wes

---

<div class="post-metadata">

**Author:** ![weyus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7ab992/32.png) [@weyus](https://www.ruby-forum.com/u/weyus)\
**Post date:** [September 8, 2006, 8:32am UTC](https://www.ruby-forum.com/t/how-do-i-run-the-rails-test-suite-on-edge/67978/2 "2006-09-08T08:32:43Z")

</div>

More specifically, I want to run the ActiveRecord test suite.

---

<div class="post-metadata">

**Author:** ![weyus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7ab992/32.png) [@weyus](https://www.ruby-forum.com/u/weyus)\
**Post date:** [September 8, 2006, 10:27am UTC](https://www.ruby-forum.com/t/how-do-i-run-the-rails-test-suite-on-edge/67978/3 "2006-09-08T10:27:38Z")

</div>

On 9/8/06, ã?¹ã?¿ã?³ ã??ã?ºã?¬ã??ã?¯ [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> :buffer\_size =\> ‘4096’ )  
> end
> 
> Any ideas, suggestion, quirk-remover-spray ? (I’m desperate…)

Hi Stan - Rails sets the HTTP header Cache-Control: no-cache by default.  
IE  
cries big tears when you download a no-cache file over SSL since,  
internally, it can’t save the file to the disk cache! Reference  
[Internet Explorer file downloads over SSL do not work with the cache control headers - Microsoft Support](http://support.microsoft.com/kb/323308) and  
[http://support.microsoft.com/kb/815313](http://support.microsoft.com/kb/815313)

Please try headers.delete(‘Cache-Control’) before the call to send\_data.  
Also see the expires\_at and expires\_now for a Railsy take on HTTP  
caching.

Best,  
jeremy

---

<div class="post-metadata">

**Author:** ![weyus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7ab992/32.png) [@weyus](https://www.ruby-forum.com/u/weyus)\
**Post date:** [September 8, 2006, 9:13am UTC](https://www.ruby-forum.com/t/how-do-i-run-the-rails-test-suite-on-edge/67978/4 "2006-09-08T09:13:18Z")

</div>

Hi and thanks if you can help…

I have a quirk in my application : i can’t make send\_data to stream for  
download (disposition=attachment) an image over SSL with internet  
explorer.  
Works fine with FF (ssl or not), works fine inline (ssl or not, IE or  
FF), works even fine without ssl (still IE).  
But when i try to get the link through SSL, IE somehow gives me a :

“cannot download blabla from someurl, not able to open this internet  
site, requested site either unavailable or cannot be found. please try  
again later…”

Of course it doesn’t work later. The only thing i could find about this  
is from the rails api on send\_file : “IE versions 4, 5, 5.5, and 6 are  
all known to have a variety of quirks (especially when downloading over  
SSL)”

see my source below. I’m using lighttpd with fcgi, nothing fancy.

def download  
qr = blabla (edit)  
send\_data(qr.to\_blob, :filename =\> qr.code+’.png’, :type =\>  
‘image/x-png’, :disposition =\> ‘attachment’, :streaming =\> ‘true’,  
:buffer\_size =\> ‘4096’ )  
end

Any ideas, suggestion, quirk-remover-spray ? (I’m desperate…)

Stan

---

<div class="post-metadata">

**Author:** ![weyus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7ab992/32.png) [@weyus](https://www.ruby-forum.com/u/weyus)\
**Post date:** [September 8, 2006, 11:53am UTC](https://www.ruby-forum.com/t/how-do-i-run-the-rails-test-suite-on-edge/67978/5 "2006-09-08T11:53:49Z")

</div>

Wes G. wrote:

> configure the DB connection to point to my test database?  
> If you go into the activerecord directory, there’s a file called  
> RUNNING\_UNIT\_TESTS. In there, it says:

== Creating the test database

The default names for the test databases are “activerecord\_unittest”  
and  
“activerecord\_unittest2”. If you want to use another database name then  
be sure  
to update the connection adapter setups you want to test with in  
test/connections//connection.rb.  
When you have the database online, you can import the fixture tables  
with  
the test/fixtures/db\_definitions/\*.sql files.

Assuming you’re running MySQL, this means that you have to create two  
new databases called ‘activerecord\_unittest’ and  
‘activerecord\_unittest2’. Then, import the starting structure/data in  
from the provided SQL files using commands like:

mysql -u root -p activerecord\_unittest \<  
test/fixtures/db\_definitions/mysql.sql  
mysql -u root -p activerecord\_unittest2 \<  
test/fixtures/db\_definitions/mysql2.sql

If you look in the connections.rb file in  
test/connections/native\_mysql/connection.rb, you’ll see that it is set  
up by default to use a user ‘rails’ with no password. So make a user  
‘rails’ with no password and grant it permissions on the two new  
databases.

> 1. How do I actually run the tests?

Again, in RUNNING\_UNIT\_TESTS, it says:

The easiest way to run the unit tests is through Rake. The default task  
runs  
the entire test suite for all the adapters. You can also run the suite  
on just  
one adapter by using the tasks test\_mysql\_ruby, test\_ruby\_mysql,  
test\_sqlite,  
or test\_postgresql. For more information, checkout the full array of  
rake tasks with “rake -T”

So to run the tests using the MySQL adapter, just run

rake test\_mysql

Hope that helps.

Chris

---

<div class="post-metadata">

**Author:** ![weyus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7ab992/32.png) [@weyus](https://www.ruby-forum.com/u/weyus)\
**Post date:** [September 8, 2006, 11:41am UTC](https://www.ruby-forum.com/t/how-do-i-run-the-rails-test-suite-on-edge/67978/6 "2006-09-08T11:41:47Z")

</div>

Thanks ! Works great ! Had to delete the pragma as well.

I have another issue with IE on this actually, it doesn’t look like  
caring much about my type=\>‘image/x-png’ : I get Type: Unkown File Type.

I’ve been careful to check that this one was on the list of known mime  
types  
([http://msdn.microsoft.com/library/default.asp?url=/workshop/networking/moniker/overview/appendix\_a.asp](http://msdn.microsoft.com/library/default.asp?url=/workshop/networking/moniker/overview/appendix_a.asp)),  
and I know from that article that IE checks the 256 first bytes to  
ensure the type matches the data.

Is there a problem with my image (built within rmagick) or is it related  
to headers and cache once again ? (first fix didn’t do much for that  
other problem).

here is my to\_blob :

def to\_blob(fileformat=‘PNG’)  
draw()  
return @imgl.to\_blob do  
self.format = fileformat  
end  
end

Stan

---

<div class="post-metadata">

**Author:** ![weyus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7ab992/32.png) [@weyus](https://www.ruby-forum.com/u/weyus)\
**Post date:** [September 8, 2006, 4:35pm UTC](https://www.ruby-forum.com/t/how-do-i-run-the-rails-test-suite-on-edge/67978/7 "2006-09-08T16:35:27Z")

</div>

Chris,

Thanks! I look forward to doing it later today.

Wes
