Sha256: 4937a844c2a010a8363e93ce22264e8d4a9435420549c20bdb14ff5a342b1236

Contents?: true

Size: 930 Bytes

Versions: 15

Compression:

Stored size: 930 Bytes

Contents

#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 %> ? (<%= file_name %>.is_a?(<%= file_name.camelize %>) ? <%= file_name %>.id : <%= table_name %>(<%= file_name %>).id) : nil
#  end

#  def authorize_as(<%= file_name %>)
#    @request.env["HTTP_AUTHORIZATION"] = <%= file_name %> ? ActionController::HttpAuthentication::Basic.encode_credentials(<%= table_name %>(<%= file_name %>).login, 'monkey') : nil
#  end
#
#<% if options[:rspec] -%>
#  # rspec
#  def mock_<%= file_name %>
#    <%= file_name %> = mock_model(<%= class_name %>, :id => 1,
#      :login  => 'user_name',
#      :name   => 'U. Surname',
#      :to_xml => "<%= class_name %>-in-XML", :to_json => "<%= class_name %>-in-JSON",
#      :errors => [])
#    <%= file_name %>
#  end
#<% end -%>
#end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
branston-0.6.6 lib/branston/vendor/plugins/restful_authentication/generators/authenticated/templates/authenticated_test_helper.rb
branston-0.6.5 lib/branston/vendor/plugins/restful_authentication/generators/authenticated/templates/authenticated_test_helper.rb
branston-0.6.4 lib/branston/vendor/plugins/restful_authentication/generators/authenticated/templates/authenticated_test_helper.rb
branston-0.6.3 lib/branston/vendor/plugins/restful_authentication/generators/authenticated/templates/authenticated_test_helper.rb
branston-0.6.2 lib/branston/vendor/plugins/restful_authentication/generators/authenticated/templates/authenticated_test_helper.rb
branston-0.6.1 lib/branston/vendor/plugins/restful_authentication/generators/authenticated/templates/authenticated_test_helper.rb
branston-0.6.0 lib/branston/vendor/plugins/restful_authentication/generators/authenticated/templates/authenticated_test_helper.rb
branston-0.5.2 lib/branston/vendor/plugins/restful_authentication/generators/authenticated/templates/authenticated_test_helper.rb
branston-0.5.1 lib/branston/vendor/plugins/restful_authentication/generators/authenticated/templates/authenticated_test_helper.rb
branston-0.5.0 lib/branston/vendor/plugins/restful_authentication/generators/authenticated/templates/authenticated_test_helper.rb
branston-0.4.6 lib/branston/vendor/plugins/restful_authentication/generators/authenticated/templates/authenticated_test_helper.rb
branston-0.4.5 lib/branston/vendor/plugins/restful_authentication/generators/authenticated/templates/authenticated_test_helper.rb
branston-0.4.4 lib/branston/vendor/plugins/restful_authentication/generators/authenticated/templates/authenticated_test_helper.rb
branston-0.4.3 lib/branston/vendor/plugins/restful_authentication/generators/authenticated/templates/authenticated_test_helper.rb
branston-0.4.2 lib/branston/vendor/plugins/restful_authentication/generators/authenticated/templates/authenticated_test_helper.rb