Showing posts with label Ruby. Show all posts
Showing posts with label Ruby. Show all posts

Ruby on Rails / How to change controller name

Things to take care of when changing controller name
  • Controller name and optionally directory name
  • Controller class name in class XxxController < ApplicationController
  • Associated routes in routes.rb
  • *_path and *_url URL helper instances

Rails testing / How to use assert_equal on arrays

The answer is simple: don't.
Instead use assert_same_elements from gem shoulda. Details below.

Imagine you have a test like this:

and a fixture file that looks like the following: