Sha256: f88a031cea0cf92b481e41435b1fc83e83a0f8a4cf49ede417407a8e8b9bb2ca
Contents?: true
Size: 1.17 KB
Versions: 1
Compression:
Stored size: 1.17 KB
Contents
begin require 'padrino-gen' Padrino::Generators.load_paths << Dir[File.dirname(__FILE__) + '/lazy-head-gen/{bootstrapped_admin_app,admin_controller_test,scaffold}.rb'] rescue LoadError # Fail silently end module LazyHeadGen # Allows testing as a logged in admin user # # param [Account] account - The account to attempt login with def login_as_admin(account) post "/admin/sessions/create", { :email => account.email, :password => "password" } follow_redirect! end # Standard assertions to test when an admin user is not logged in # and trys to view an admin page # def assert_admin_not_logged_in assert !last_response.ok? assert_equal 302, last_response.status assert_equal "http://example.org/admin/sessions/new", last_response.original_headers["Location"] end # Removing due to conflicts when testing. # # def path # last_request.path # end # def session # last_request.env['rack.session'] # end # def body # last_response.body # end # def status # last_response.status # end # def location # last_response.original_headers["Location"] # end # def ok? # last_response.ok? # end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
lazy-head-gen-0.5.1 | lib/lazy-head-gen.rb |