daily pastebin goal
51%
SHARE
TWEET

Untitled

a guest Mar 17th, 2018 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. require 'sinatra/base'
  2. require 'minitest/autorun'
  3. require 'rack/test'
  4. require 'minitest/spec'
  5. require 'nokogiri'
  6. require 'rack/test'
  7. require_relative 'login'
  8.  
  9. class Test < MiniTest::Test`
  10.  
  11.   include Rack::Test::Methods
  12.  
  13.   def app
  14.     Sinatra::Application
  15.   end
  16.  
  17.   def test_login
  18.     response = get ('/home')
  19.     doc = Nokogiri::HTML(response.body)
  20.     puts last_response
  21.     puts doc
  22.     #response = post '/login', username: 'test_user', password: 'password'
  23.     #get '/home'
  24.     #follow_redirect!()
  25.     #puts doc
  26.     #assert_equal "Admin", doc.at_css("#admin-block div h1")
  27.   end
  28. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top