From 99f7a5cd825a823351aa10e3da687ac4021603bc Mon Sep 17 00:00:00 2001 From: Daniel Horak Date: Thu, 2 Aug 2018 10:01:27 +0200 Subject: [PATCH] use example.{org,com} as domain for example emails * do not use existing domains for example and testing emails, but use example.org or example.com designated for examples and documentation purposes: - https://tools.ietf.org/html/rfc2606#section-3 Signed-off-by: Daniel Horak --- Rakefile | 2 +- docs/users.adoc | 16 ++++++++-------- spec/controllers/users_controller_spec.rb | 4 ++-- spec/fixtures/dwarner.json | 2 +- spec/fixtures/quentin.json | 2 +- spec/fixtures/thardy.json | 2 +- spec/fixtures/users.yml | 4 ++-- spec/forms/user_form_spec.rb | 8 ++++---- spec/models/user_spec.rb | 4 ++-- 9 files changed, 22 insertions(+), 22 deletions(-) diff --git a/Rakefile b/Rakefile index 3aadc13..5ecdfdb 100644 --- a/Rakefile +++ b/Rakefile @@ -18,7 +18,7 @@ namespace :etcd do Tendrl::User.new, name: 'Admin', username: 'admin', - email: 'admin@tendrl.org', + email: 'admin@example.org', role: 'admin', password: password, email_notifications: false diff --git a/docs/users.adoc b/docs/users.adoc index 0dcfae0..486b50e 100644 --- a/docs/users.adoc +++ b/docs/users.adoc @@ -25,7 +25,7 @@ Sample Request curl -H 'Content-Type: application/json' -H 'Authorization: Bearer d03ebb195dbe6385a7caeda699f9930ff2e49f29c381ed82dc95aa642a7660b8' -XPOST -d '{"name":"Tom Hardy", "username":"thardy", -"email":"thardy@tendrl.org", "role":"admin", "password":"pass1234", +"email":"thardy@example.org", "role":"admin", "password":"pass1234", "email_notifications": true}' http://127.0.0.1/api/1.0/users ---------- @@ -36,7 +36,7 @@ Sample Response Status: 201 Created { - "email": "thardy@tendrl.org", + "email": "thardy@example.org", "username": "thardy", "name": "Tom Hardy", "role": "admin", @@ -51,7 +51,7 @@ Update a existing user. Sample Request ---------- -curl -H 'Content-Type: application/json' -H 'Authorization: Bearer d03ebb195dbe6385a7caeda699f9930ff2e49f29c381ed82dc95aa642a7660b8' -XPUT -d '{"name":"Tom Hardee", "username":"thardy", "email":"thardy@tendrl.org", "role":"normal"}' http://127.0.0.1/api/1.0/users/thardy +curl -H 'Content-Type: application/json' -H 'Authorization: Bearer d03ebb195dbe6385a7caeda699f9930ff2e49f29c381ed82dc95aa642a7660b8' -XPUT -d '{"name":"Tom Hardee", "username":"thardy", "email":"thardy@example.org", "role":"normal"}' http://127.0.0.1/api/1.0/users/thardy ---------- Sample Response @@ -59,7 +59,7 @@ Sample Response ---------- Status: 200 OK { - "email": "thardy@tendrl.org", + "email": "thardy@example.org", "username": "thardy", "name": "Tom Hardee", "role": "normal", @@ -99,13 +99,13 @@ Sample Response ---------- Status: 200 OK [{ - "email": "admin@tendrl.org", + "email": "admin@example.org", "username": "admin", "name": "Admin", "role": "admin", "email_notitifications": true }, { - "email": "thardy@tendrl.org", + "email": "thardy@example.org", "username": "thardy", "name": "Tom Hardy", "role": "admin", @@ -128,7 +128,7 @@ Sample Response ---------- Status: 200 OK { - "email": "thardy@tendrl.org", + "email": "thardy@example.org", "username": "thardy", "name": "Tom Hardy", "role": "admin", @@ -153,7 +153,7 @@ Sample Response ---------- Status: 200 OK { - "email": "thardy@tendrl.org", + "email": "thardy@example.org", "username": "thardy", "name": "Tom Hardy", "role": "admin", diff --git a/spec/controllers/users_controller_spec.rb b/spec/controllers/users_controller_spec.rb index 43b1b7b..b878b66 100644 --- a/spec/controllers/users_controller_spec.rb +++ b/spec/controllers/users_controller_spec.rb @@ -22,7 +22,7 @@ let(:body){ { - email: 'thardy@tendrl.org', + email: 'thardy@example.org', username: 'thardy', name: 'Tom Hardy', password: 'temp12345', @@ -111,7 +111,7 @@ end it 'self' do - stub_email_notifications_index('quentin', 'quentin@tendrl.org') + stub_email_notifications_index('quentin', 'quentin@example.org') body = { name: 'Quentin D' } stub_update_user_attributes('quentin', body) put "/users/quentin", body.to_json, http_env diff --git a/spec/fixtures/dwarner.json b/spec/fixtures/dwarner.json index 78b8b47..ff9900e 100644 --- a/spec/fixtures/dwarner.json +++ b/spec/fixtures/dwarner.json @@ -17,7 +17,7 @@ "createdIndex": 197 }, { "key": "/_tendrl/users/dwarner/email", - "value": "dwarner@tendrl.org", + "value": "dwarner@example.org", "modifiedIndex": 190, "createdIndex": 190 }, { diff --git a/spec/fixtures/quentin.json b/spec/fixtures/quentin.json index 08e0c20..3219a68 100644 --- a/spec/fixtures/quentin.json +++ b/spec/fixtures/quentin.json @@ -17,7 +17,7 @@ "createdIndex": 197 }, { "key": "/_tendrl/users/quentin/email", - "value": "quentin@tendrl.org", + "value": "quentin@example.org", "modifiedIndex": 190, "createdIndex": 190 }, { diff --git a/spec/fixtures/thardy.json b/spec/fixtures/thardy.json index 00dbd4f..2189981 100644 --- a/spec/fixtures/thardy.json +++ b/spec/fixtures/thardy.json @@ -17,7 +17,7 @@ "createdIndex": 197 }, { "key": "/_tendrl/users/thardy/email", - "value": "thardy@tendrl.org", + "value": "thardy@example.org", "modifiedIndex": 190, "createdIndex": 190 }, { diff --git a/spec/fixtures/users.yml b/spec/fixtures/users.yml index 62c3138..12763cc 100644 --- a/spec/fixtures/users.yml +++ b/spec/fixtures/users.yml @@ -23,7 +23,7 @@ node: !ruby/object:Etcd::Node modified_index: 65748 ttl: key: /_tendrl/users/dwarner/data - value: '{"name":"David Warner","username":"dwarner","password_salt":"$2a$10$2TEvrFp5cKo9dFvJSRyp6e","password_hash":"$2a$10$ACiOy8CCN57RjCP5qyd4Oe3Jokl6Jaj25vrb617NZ6xU5CUSsJTOW","email":"dwarner@tendrl.org","role":"dwarner","email_notifications":false}' + value: '{"name":"David Warner","username":"dwarner","password_salt":"$2a$10$2TEvrFp5cKo9dFvJSRyp6e","password_hash":"$2a$10$ACiOy8CCN57RjCP5qyd4Oe3Jokl6Jaj25vrb617NZ6xU5CUSsJTOW","email":"dwarner@example.org","role":"dwarner","email_notifications":false}' expiration: dir: - !ruby/object:Etcd::Node @@ -40,7 +40,7 @@ node: !ruby/object:Etcd::Node modified_index: 531720 ttl: key: /_tendrl/users/quentin/data - value: '{"name":"Quentin","username":"quentin","password_salt":"$2a$10$2TEvrFp5cKo9dFvJSRyp6e","password_hash":"$2a$10$2TEvrFp5cKo9dFvJSRyp6e7g5GzGzic7X4Xu1n.Cf2WCiiOuh3o.u","email":"quentin@email.com","role":"normal","email_notifications":false}' + value: '{"name":"Quentin","username":"quentin","password_salt":"$2a$10$2TEvrFp5cKo9dFvJSRyp6e","password_hash":"$2a$10$2TEvrFp5cKo9dFvJSRyp6e7g5GzGzic7X4Xu1n.Cf2WCiiOuh3o.u","email":"quentin@example.com","role":"normal","email_notifications":false}' expiration: dir: etcd_index: 1039888 diff --git a/spec/forms/user_form_spec.rb b/spec/forms/user_form_spec.rb index 2e0a14c..21215f9 100644 --- a/spec/forms/user_form_spec.rb +++ b/spec/forms/user_form_spec.rb @@ -26,7 +26,7 @@ it 'with valid attributes' do validator = UserForm.new(user, { name: 'Tom Hardy', - email: 'tom@tendrl.org', + email: 'tom@example.org', username: 'thardy', password: 'temp12345', role: Tendrl::User::ADMIN, @@ -38,7 +38,7 @@ it 'with existing username/email' do validator = UserForm.new(user, { name: 'David Warner', - email: 'dwarner@tendrl.org', + email: 'dwarner@example.org', username: 'dwarner', password: 'temp12345', email_notifications: true, @@ -77,7 +77,7 @@ it 'with valid attributes and password' do validator = UserForm.new(user, { name: 'Tom Hardy', - email: 'tom@tendrl.org', + email: 'tom@example.org', username: 'thardy', password: 'temp12345', role: Tendrl::User::NORMAL @@ -88,7 +88,7 @@ it 'with existing username/email' do validator = UserForm.new(user, { name: 'David Warner', - email: 'dwarner@tendrl.org', + email: 'dwarner@example.org', username: 'dwarner', password: 'temp12345', role: Tendrl::User::LIMITED diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 345208e..6743cac 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -2,11 +2,11 @@ RSpec.describe Tendrl::User do it 'create' do - stub_email_notifications_index('dwarner', 'dwarner@tendrl.org') + stub_email_notifications_index('dwarner', 'dwarner@example.org') stub_user('dwarner') stub_user_create('dwarner') attributes = { - email: 'dwarner@tendrl.org', + email: 'dwarner@example.org', name: 'David Warner', username: 'dwarner', password: 'temp1234'