Skip to content

Commit

Permalink
Generated AuthenticatedTestHelper#login_as now accepts both symbol fo…
Browse files Browse the repository at this point in the history
…r lookup in the fixture as well as an instance of the originating class.
  • Loading branch information
bjhess committed Nov 21, 2008
1 parent 61cd9b3 commit 61f377d
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module AuthenticatedTestHelper
# Sets the current <%= file_name %> in the session from the <%= file_name %> fixtures.
def login_as(<%= file_name %>)
@request.session[:<%= file_name %>_id] = <%= file_name %> ? <%= table_name %>(<%= file_name %>).id : nil
@request.session[:<%= file_name %>_id] = <%= file_name %> ? (<%= file_name %>.is_a?(<%= file_name.camelize %>) ? <%= file_name %>.id : <%= table_name %>(<%= file_name %>).id) : nil
end
def authorize_as(<%= file_name %>)
Expand Down

0 comments on commit 61f377d

Please sign in to comment.