Skip to content

Instantly share code, notes, and snippets.

@dcorking
Created August 22, 2013 20:13
Show Gist options
  • Save dcorking/6312191 to your computer and use it in GitHub Desktop.
Save dcorking/6312191 to your computer and use it in GitHub Desktop.
Typo spec that passes on its own, but fails when running the whole rspec suite
Failures:
1) Admin::ContentController with admin connection edit action should edit article
Failure/Error: get :edit, 'id' => @article.id
ActionView::Template::Error:
undefined method `to_sym' for nil:NilClass
# ./spec/models/page_spec.rb:68:in `block in except'
# ./spec/models/page_spec.rb:68:in `reject'
# ./spec/models/page_spec.rb:68:in `except'
# ./app/views/admin/shared/_merge.html.erb:3:in `_app_views_admin_shared__merge_html_erb__108427934_120784420__461995380'
# ./app/views/admin/shared/_edit.html.erb:10:in `_app_views_admin_shared__edit_html_erb__554174329_119554110__737275118'
# ./app/views/admin/content/new.html.erb:3:in `_app_views_admin_content_new_html_erb___1034609185_119632660__1037443760'
# ./app/controllers/admin/content_controller.rb:183:in `new_or_edit'
# ./app/controllers/admin/content_controller.rb:37:in `edit'
# ./spec/controllers/admin/content_controller_spec.rb:487:in `block (4 levels) in <top (required)>'
@dcorking
Copy link
Author

Resolved. This was caused by misuse of a path helper in the merge view, like this:

<%= form_tag(admin_content_path(:merge, :id)) do%> 

It is a good lesson to run the entire test suite every time I make a new spec turn green, and not to rely on a green result from merely the obviously relevant examples.

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