h2. Views Security has been tightened in Rails3, forcing you to include _authenticity_token__ with all requests. If you have forms or javascript that submits requests without this token, Rails will destroy the user session, effectively logging the user out (see http://weblog.rubyonrails.org/2011/2/8/csrf-protection-bypass-in-ruby-on-rails). The easiest way to make sure this token is properly included in your forms is to generate the forms using the +form_tag+ or +form_for+ view helpers from Rails. h2. Fixtures Fixtures are loaded from a directory _within the test app_, which is updated when you run rake hyhead:setup_test_app so in order to update a fixture, you must change it in test_support/fixtures and then either re-run rake hyhead:setup_test_app or copy the fixture into tmp/test_app/test_support/fixtures h2. Cucumber tests We have switched from Webrat to Capybara as the driver for our Cucumber tests. If you have been writing your own cucumber tests (you should!) and want to stay in sync with the rest of the hydra developers, you should switch to Capybara and pull all of the "step definitions from the hydra code":https://github.com/projecthydra/hydra-head/tree/rails3/test_support/features/step_definitions into your local app. Sometime soon, we hope to wrap our step definitions into the Hydra code itself so that you can use them without having to manually copy the files into your step_definitions directory. This will probably be done in a way that imitates the "Factory Girl step definitions":http://robots.thoughtbot.com/post/284805810/gimme-three-steps h2. User objects Blacklight has switched to using devise instead of authlogic as its default user/authentication system. As part of this switch, no longer have a "login" attribute as their unique identifier. Instead, you must use email as the unique identifier. We have added a "login" method that h2. User Attributes User attributes (first_name, last_name, full_name, affiliation and photo) have been removed from HydraHead. h2. Controllers * Removed Djatoka (JPEG 2000) support and the GetController h2. Views * removed fluid infusion javascript * moved javascripts from the plugin directory. Update your views to remove ":plugin=>:hydra_repository" h3. What this means: * Our sample user "archivist1" is now "archivist1@example.com". * Your cucumber features and rspec tests must use email addresses as the unique identifier for Users Change your features and role_map YAML files accordingly. h2. How to upgrade The sureest and easiest path to upgrading a hydra head application from Rails 2 to Rails 3, is to start a new project from scratch. * Create a new rails 3 project * Add ```gem 'blacklight'``` and ```gem 'hydra-head'``` to the Gemfile * run ```bundle install``` * cp -r old_project/vendor/plugin/old_project_plugin/app/* new_project/app * cp -r old_project/vendor/plugin/old_project_plugin/lib/* new_project/lib <<<<<<< HEAD * copy any tests (test, spec, feature, etc) from the old_project_plugin directory to the new project * Run the generators ```rails g blackight -devise``` Run the hydra-head generator ```rails g hydra:head -df``` Run the database migrations ```rake db:migrate rake db:migrate RAILS_ENV=test``` * If you will be writing cucumber tests, run the cucumber generator ```rails g cucumber:install``` * copy any tests (test, spec, feature, etc) from the old_project_plugin directory to the new project * update your solrconfig.xml * update your role_map_...yml files to use appropriate identifiers