blob: bb4e8c9b0044b961e2b4eb795c2ef6d9c6e44e8a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
require 'test_helper'
class SessionTest < BrowserIntegrationTest
setup do
Capybara.current_driver = Capybara.javascript_driver
@username, password = submit_signup
end
teardown do
user = User.find_by_login(@username)
id = user.identity
id.destroy
user.destroy
end
test "valid session" do
assert page.has_content?("Welcome #{@username}")
end
test "expired session" do
assert page.has_content?("Welcome #{@username}")
pretend_now_is(Time.now + 40.minutes) do
visit '/'
assert page.has_no_content?("Welcome #{@username}")
end
end
end
|