Sha256: 18dfd5d3391008f4f3eff4044dd517ee0be3cb11cff823971b10707714c4daf2
Contents?: true
Size: 873 Bytes
Versions: 21
Compression:
Stored size: 873 Bytes
Contents
require 'test_helper' class AuthenticationTest < ActiveSupport::IntegrationCase teardown do Capybara.reset_sessions! end test 'action not requiring authentication' do visit articles_path assert_equal articles_path, current_path within 'h1' do assert page.has_content?('Articles') end end test 'action requiring authentication' do # try to see page visit new_article_path # test we need to authenticate assert_equal sign_in_path, current_path within '.flash.notice' do assert page.has_content? 'Please sign in first.' end # sign in user_factory 'Bob', 'bob', 'secret' sign_in_as 'bob', 'secret' visit new_article_path # test we can now see page assert_equal new_article_path, current_path within 'h1' do assert page.has_content?('New Article') end end end
Version data entries
21 entries across 21 versions & 1 rubygems