I had to create a view for a join table of a many-to-many relationship in my model. To do this, I had to have a database migration use the ‘execute’ command to create the view. Tests failed because the schema.rb dump file does not deal with views. To fix, I had to set the following in my environments.rb file.
ActiveRecord::Base.schema_format= :sql
Then everything worked. At that point, it was just fixing my tests.