djmailhot/BeatTide — Issue #24: test_sign_in(user) for rspec tests only works with sessions_controller_spec
Author: djmailhot
Created: 2012-02-20 01:25:22+00:00
State: open
Labels: Bug, Priority: HIGH

In the rails tutorial source code, it shows the posts_controller_spec tests using the helper method test_sign_in()
https://github.com/railstutorial/sample_app/blob/master/spec/controllers/microposts_controller_spec.rb

However, this doesn't work for me.

Steps to repro
1) Make a new controller_spec test for a hypothetical posts_controller
2) Write a test case that includes using the helper method "test_sign_in(user)"
3) Run a rspec test over that test case

Expected behavior
Rspec test behaves as intended

Actual behavior
Taken verbosely:
Failure/Error: @user = test_sign_in(FactoryGirl.build(:user))
NoMethodError:
undefined method 'sign_in' for PostsController