Skip to content

Instantly share code, notes, and snippets.

@jraines
Created July 22, 2011 07:05
Show Gist options
  • Save jraines/1099013 to your computer and use it in GitHub Desktop.
Save jraines/1099013 to your computer and use it in GitHub Desktop.

fixture_file_upload is a good way to simulate an uploaded file in tests. In Rspec, make sure to include ActionDispatch::TestSupport

Useful Rspec custom matcher to write: with_layout(layout)

assign(:variable, 'value') in your specs

Anonymous controllers in tests for testing filters

Testing nested hashes

Rspec output options

TODO: write a bash alias for running single spec file/line

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment