Refactored to rename "service terms" to "terms of service" (#9581)
* #124 renamed identififers from service terms to terms of service * #124 renamed identififers from service terms to terms of service * 124 renamed ServiceTerms model to TermsOfService * 124 Renamed EnableCustomServiceTerms feature flag to EnableCustomTermsOfService * 124 Renamed EnableCustomServiceTerms feature flag to EnableCustomTermsOfService * #124 fixed formatting * #124 fixed formatting * #132 renamed table ServiceTerms to TermsOfService * #124 renamed some missed files from 'service_terms' to 'terms_of_service' * #124 removed fixed TODOs * drop migrate of ServiceTerms table, since backporting * s/ServiceTerms/TermsOfService/ in tests * s/AcceptedServiceTermsId/AcceptedTermsOfServiceId/ Change the model attribute, even though the column name will eventually be removed. * s/accepted_service_terms_id/accepted_terms_of_service_id/ to match redux * s/serviceTerms/termsOfService * rename column too, and add max size constraint * s/EnableCustomServiceTerms/EnableCustomTermsOfService
Этот коммит содержится в:
коммит произвёл
Jesse Hallam
родитель
59319b7915
Коммит
bffcccf99d
@@ -545,7 +545,7 @@ func TestPermanentDeleteUser(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestRecordUserServiceTermsAction(t *testing.T) {
|
||||
func TestRecordUserTermsOfServiceAction(t *testing.T) {
|
||||
th := Setup().InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
@@ -563,24 +563,24 @@ func TestRecordUserServiceTermsAction(t *testing.T) {
|
||||
|
||||
defer th.App.PermanentDeleteUser(user)
|
||||
|
||||
serviceTerms, err := th.App.CreateServiceTerms("text", user.Id)
|
||||
termsOfService, err := th.App.CreateTermsOfService("text", user.Id)
|
||||
if err != nil {
|
||||
t.Fatalf("failed to create service terms: %v", err)
|
||||
t.Fatalf("failed to create terms of service: %v", err)
|
||||
}
|
||||
|
||||
err = th.App.RecordUserServiceTermsAction(user.Id, serviceTerms.Id, true)
|
||||
err = th.App.RecordUserTermsOfServiceAction(user.Id, termsOfService.Id, true)
|
||||
if err != nil {
|
||||
t.Fatalf("failed to record user action: %v", err)
|
||||
}
|
||||
|
||||
nuser, err := th.App.GetUser(user.Id)
|
||||
assert.Equal(t, serviceTerms.Id, nuser.AcceptedServiceTermsId)
|
||||
assert.Equal(t, termsOfService.Id, nuser.AcceptedTermsOfServiceId)
|
||||
|
||||
err = th.App.RecordUserServiceTermsAction(user.Id, serviceTerms.Id, false)
|
||||
err = th.App.RecordUserTermsOfServiceAction(user.Id, termsOfService.Id, false)
|
||||
if err != nil {
|
||||
t.Fatalf("failed to record user action: %v", err)
|
||||
}
|
||||
|
||||
nuser, err = th.App.GetUser(user.Id)
|
||||
assert.Empty(t, nuser.AcceptedServiceTermsId)
|
||||
assert.Empty(t, nuser.AcceptedTermsOfServiceId)
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user