From 62fe9e6955d943c2e4ab361ed5892b7de0be39e3 Mon Sep 17 00:00:00 2001 From: Christoph Haas Date: Wed, 15 Aug 2018 17:04:19 +0200 Subject: [PATCH] Fixed functional tests --- .../browse_test.rb | 0 test/functional/login_test.rb | 28 +++++++++++++++++++ 2 files changed, 28 insertions(+) rename test/{integration => functional}/browse_test.rb (100%) create mode 100644 test/functional/login_test.rb diff --git a/test/integration/browse_test.rb b/test/functional/browse_test.rb similarity index 100% rename from test/integration/browse_test.rb rename to test/functional/browse_test.rb diff --git a/test/functional/login_test.rb b/test/functional/login_test.rb new file mode 100644 index 0000000..30989ed --- /dev/null +++ b/test/functional/login_test.rb @@ -0,0 +1,28 @@ +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