-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
store terms_accepted_at for User registration (#13)
- Loading branch information
Showing
4 changed files
with
40 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# SPDX-FileCopyrightText: 2020 Felix Wolfsteller | ||
# | ||
# SPDX-License-Identifier: AGPL-3.0-or-later | ||
|
||
class AddTermsAcceptedAtToUser < ActiveRecord::Migration[6.0] | ||
def change | ||
add_column :users, :terms_accepted_at, :datetime | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,7 +45,18 @@ class TosTest < ApplicationSystemTestCase | |
end | ||
|
||
test "when signed up, dates of consent are saved in User model" do | ||
skip "tbi" | ||
visit new_user_registration_url | ||
|
||
fill_in "E-Mail", with: '[email protected]' | ||
fill_in "Passwort", with: '[email protected]' | ||
fill_in "Passwortbestätigung", with: '[email protected]' | ||
|
||
check('Datenschutzhinweise gelesen') | ||
check('Stimme AGB zu') | ||
|
||
click_on "Für Schnupperwoche registrieren" | ||
|
||
assert_in_delta DateTime.now.to_i, User.last.terms_accepted_at.to_i, 5 | ||
end | ||
|
||
test "when logging in and no consent was given, user is forced to agree or delete account" do | ||
|