debshots/test/functional/login_test.rb
2018-08-15 17:04:19 +02:00

28 lines
771 B
Ruby

require 'test_helper'
class BrowserBrowseTest < ActionDispatch::IntegrationTest
test "user can navigate to login form and log in" do
visit root_path
click_link 'Login'
within 'form' do
fill_in 'email address', with: users(:normal).email
fill_in 'password', with: 'normalsecret'
click_button 'Log in'
end
# byebug
assert_equal 200, status_code
# puts page.body
assert_current_path my_welcome_path
page.must_have_content 'You are now logged in'
# click_on 'profile page'
# page.must_have_content users(:normal).email
end
# test "user can browse packages" do
# visit packages_grid_path
# page.must_have_content /Previous/
# page.must_have_link href: packages_grid_path(page: 2)
# end
end