When testing has_and_belongs_to_many models using rspec and factory girl you should setup your factory the following way:
Tags / Software
Page 8
If you run MySQL you probably use the innodb storage engine because it provides a number of advantages over MyIsam.
The official documentation recommends giving 50-80% of your ram to
innodb_buffer_pool_size
which can easily go above 10 gb because ram is
cheap nowadays.
The same documentation recommends settings innodb_log_file_size
to 25% of
innodb_buffer_pool_size
meaning this can easily be 2 or more gb.
2012-06-12
If you are using heroku you probably ran into some issues with
rake assets:precompile
. When using active admin
bringing it’s assets into your app can also be quite tricky.
The method of precompiling your assets yourself and adding them to your git repository works for sure but it isn’t really best practice.
Another way to get the needed assets to be compiled is as follows:
2012-06-10
If you want to use another test framework for rails like
rspec and factories instead of
fixtures.
You should adapt config/application.rb
as follows:
2012-06-08
Sometimes you’ll want or have to split a git repository into two. This is usually a sign of not thinking forward enough but hey sh.. happens. If your repository is structured in a way that you just need a subdirectory of it into a new repository you can follow the steps below.
2012-06-07
If you are using lighttpd as webserver and
host drupal websites you probably have used
some lua script and mod_magnet to get clean urls.
Recent versions of lighttpd (1.4.26+) are able to handle rewrites better
through the url.rewrite-if-not-file
command.
The config for your [virtual] server should look like this:
To write unit tests for your javascript code you can use a testing framework like JSTestDriver which is able to run under TeamCity.
Usage and configuration instructions for JSTestDriver are available on their website. For integration with TeamCity you’ll have to write an ant build file. But to be able to run browsers on your build agent machine you’ll have to use Xvfb. The test task in your ant file should look like the one below:
2012-06-05
2012-06-04
Sometimes you’ll want to remove all ruby gems from your system. This is very easy (at least under unix like operating systems). Just issue the following command: