Tag Archives: MySQL

How to load all fixtures testing with RSpec 2 and Rails 3

Anyway, if you want to have RSpec 2 load all of the fixtures (in your spec/fixtures directory) to your database and test your Rails 3 app, you need have this configuration:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
RSpec.configure do |config|
  # == Mock Framework
  #
  # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
  #
  # config.mock_with :mocha
  # config.mock_with :flexmock
  # config.mock_with :rr
  config.mock_with :rspec

  # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
  config.fixture_path = "#{::Rails.root}/spec/fixtures"

  # If you're not using ActiveRecord, or you'd prefer not to run each of your
  # examples within a transaction, remove the following line or assign false
  # instead of true.
  config.use_transactional_fixtures = true

  # This will pick up all of the fixtures defined in spec/fixtures into your
  # database and you'll be able to test with some sample data
  # (eg. Countries, States, etc.)
  config.global_fixtures = :all
end
Posted in developer tools, open source, programming, Ruby programming, software engineering, web programming | Also tagged , , , , , , , | Leave a comment

how to migrate a database from SQLite to MySQL

I had to migrate a database from SQLite to MySQL for a project.

Posted in developer tools, open source | Also tagged , | Leave a comment