Skip to content

Commit

Permalink
use example.{org,com} as domain for example emails
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
dahorak committed Sep 11, 2018
1 parent 4125cf1 commit 99f7a5c
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 8 additions & 8 deletions docs/users.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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
----------
Expand All @@ -36,7 +36,7 @@ Sample Response
Status: 201 Created
{
"email": "thardy@tendrl.org",
"email": "thardy@example.org",
"username": "thardy",
"name": "Tom Hardy",
"role": "admin",
Expand All @@ -51,15 +51,15 @@ 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

----------
Status: 200 OK
{
"email": "thardy@tendrl.org",
"email": "thardy@example.org",
"username": "thardy",
"name": "Tom Hardee",
"role": "normal",
Expand Down Expand Up @@ -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",
Expand All @@ -128,7 +128,7 @@ Sample Response
----------
Status: 200 OK
{
"email": "thardy@tendrl.org",
"email": "thardy@example.org",
"username": "thardy",
"name": "Tom Hardy",
"role": "admin",
Expand All @@ -153,7 +153,7 @@ Sample Response
----------
Status: 200 OK
{
"email": "thardy@tendrl.org",
"email": "thardy@example.org",
"username": "thardy",
"name": "Tom Hardy",
"role": "admin",
Expand Down
4 changes: 2 additions & 2 deletions spec/controllers/users_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

let(:body){
{
email: 'thardy@tendrl.org',
email: 'thardy@example.org',
username: 'thardy',
name: 'Tom Hardy',
password: 'temp12345',
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spec/fixtures/dwarner.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"createdIndex": 197
}, {
"key": "/_tendrl/users/dwarner/email",
"value": "dwarner@tendrl.org",
"value": "dwarner@example.org",
"modifiedIndex": 190,
"createdIndex": 190
}, {
Expand Down
2 changes: 1 addition & 1 deletion spec/fixtures/quentin.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"createdIndex": 197
}, {
"key": "/_tendrl/users/quentin/email",
"value": "quentin@tendrl.org",
"value": "quentin@example.org",
"modifiedIndex": 190,
"createdIndex": 190
}, {
Expand Down
2 changes: 1 addition & 1 deletion spec/fixtures/thardy.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"createdIndex": 197
}, {
"key": "/_tendrl/users/thardy/email",
"value": "thardy@tendrl.org",
"value": "thardy@example.org",
"modifiedIndex": 190,
"createdIndex": 190
}, {
Expand Down
4 changes: 2 additions & 2 deletions spec/fixtures/users.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions spec/forms/user_form_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions spec/models/user_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 99f7a5c

Please sign in to comment.