usman 0.3.19 → 0.3.20

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6c48cc7bd8d51aa2b31f2bac8cb4469bde5874ed
4
- data.tar.gz: eaf3b0f77a1a4372aebbf3335d9ee1109ff42e62
3
+ metadata.gz: eb365fb6b07ac4b3768080d93f9fd8c9d7833eae
4
+ data.tar.gz: 34b300f8d53af152f10413402641cb615a2fcb43
5
5
  SHA512:
6
- metadata.gz: ff9b9ebdaf521b43a9c3da93ff6788c81d561dd8e205e38f99ca1366b979c833c7a58d3ac469069e74f22ac11d7dcb5bade6bcf8c7a8254cde45b91070f033bd
7
- data.tar.gz: 462bde7386a76c363f42a524af88e796e4246f9b6ea81d21730db14534cb5cad7c62afebdc77f67f4529ec2425a54bf00e278046d78a6853453a8027765f6437
6
+ metadata.gz: fe80a55619b84f35ccb006efa262542da0ccaa6e1fd2eb9891a89b8314b11da8d9b6a4285e20790a79756ec3535c806520d3d907234472283f92136a77eed562
7
+ data.tar.gz: 42157dda7e12b97dccfb303516c3734a3a1b31f9fa922920056c83db4b5ee41dc466767cc505adfa0b271688477caff61ee7d4edb97a7dbf357ab9d0bd15f3c7
data/app/models/user.rb CHANGED
@@ -448,10 +448,12 @@ class User < Usman::ApplicationRecord
448
448
  self.password_confirmation = passwd
449
449
  end
450
450
 
451
- def generate_dummy_data(registration_id=nil)
451
+ def generate_dummy_data(registration)
452
452
  generate_username_and_password
453
453
  self.email = "#{self.username}@donedealapps.com"
454
- self.name = "User #{registration_id}"
454
+ self.name = "User #{registration.try(:id)}"
455
+ self.country_id = registration.country_id
456
+ self.city_id = registration.city_id
455
457
  self.dummy = true
456
458
  end
457
459
 
@@ -112,7 +112,7 @@ module Usman
112
112
  def create_a_dummy_user
113
113
  return unless @registration.persisted?
114
114
  @registration.user = User.new
115
- @registration.user.generate_dummy_data(@registration.id)
115
+ @registration.user.generate_dummy_data(@registration)
116
116
  @registration.user.save
117
117
  end
118
118
 
@@ -25,7 +25,58 @@ api_output = <<-eos
25
25
  "message": "Store and use the API token for further communication"
26
26
  },
27
27
  "data": {
28
- "api_token": "ajshdjkashdkjasdas"
28
+ "api_token": "ajshdjkashdkjasdas",
29
+ "registration": {
30
+ "id": 165,
31
+ "dialing_prefix": "+97",
32
+ "mobile_number": "1501370320",
33
+ "status": "verified",
34
+ "user_id": 19,
35
+ "country_id": 235,
36
+ "city_id": 21,
37
+ "user": {
38
+ "id": 19,
39
+ "name": "Mickey Mouse ",
40
+ "gender": "male",
41
+ "date_of_birth": "10-10-1983",
42
+ "username": "342721f3",
43
+ "email": "mickey@dondealapps.com",
44
+ "phone": "",
45
+ "dummy": false
46
+ },
47
+ "country": {
48
+ "id": 235,
49
+ "name": "United Arab Emirates",
50
+ "iso_name": "UNITED ARAB EMIRATES",
51
+ "iso_alpha_2": "AE",
52
+ "dialing_prefix": "971",
53
+ "priority": 1000,
54
+ "operational": true
55
+ },
56
+ "city": {
57
+ "id": 21,
58
+ "name": "Abu Dhabi",
59
+ "priority": 1000,
60
+ "operational": true
61
+ }
62
+ },
63
+ "profile": {
64
+ "id": 19,
65
+ "name": "Mickey Mouse ",
66
+ "gender": "male",
67
+ "date_of_birth": "10-10-1983",
68
+ "username": "342721f3",
69
+ "email": "mickey@dondealapps.com",
70
+ "phone": "",
71
+ "dummy": false,
72
+ "profile_picture": {
73
+ "id": 60,
74
+ "created_at": "26-09-2017 01:05:15",
75
+ "profile_id": 19,
76
+ "image_large_path": "/uploads/profile_pictures/60/large_micky.jpg",
77
+ "image_small_path": "/uploads/profile_pictures/60/small_micky.jpg"
78
+ }
79
+ }
29
80
  }
30
81
  }
31
82
  eos
@@ -48,7 +48,7 @@ api_output = <<-eos
48
48
  "operating_system": "iOS",
49
49
  "software_version": "iOS 11.2.2",
50
50
  "status": "pending",
51
- "otp_verified_at": null
51
+ "otp_verified_at": ""
52
52
  }
53
53
  },
54
54
  "errors": {
@@ -48,7 +48,7 @@ api_output = <<-eos
48
48
  "operating_system": "iOS",
49
49
  "software_version": "iOS 11.2.2",
50
50
  "status": "pending",
51
- "otp_verified_at": null
51
+ "otp_verified_at": ""
52
52
  }
53
53
  },
54
54
  "errors": {
@@ -49,7 +49,7 @@ api_output = <<-eos
49
49
  "software_version": "iOS 11.2.2",
50
50
  "api_token": "257720f0d84c233d49b2490b240e0b10",
51
51
  "status": "verified",
52
- "otp_verified_at": null
52
+ "otp_verified_at": ""
53
53
  }
54
54
  },
55
55
  "errors": {
@@ -30,14 +30,42 @@ api_output = <<-eos
30
30
  "city_id": "",
31
31
  "dialing_prefix": "+91",
32
32
  "mobile_number": "192837465",
33
- "status": "verified"
33
+ "status": "verified",
34
+ "user": {
35
+ "id": 15,
36
+ "name": "Name",
37
+ "gender": "male",
38
+ "date_of_birth": "10-10-1980",
39
+ "username": "0d5fe1c4",
40
+ "email": "sa@domain.com",
41
+ "phone": "",
42
+ "dummy": false
43
+ },
44
+ "country": {
45
+ "id": 100,
46
+ "name": "India",
47
+ "iso_name": "INDIA",
48
+ "iso_alpha_2": "IN",
49
+ "dialing_prefix": "91",
50
+ "priority": 1000,
51
+ "operational": true
52
+ },
53
+ "city": {
54
+ "id": 20199,
55
+ "name": "Cochin",
56
+ "priority": 1000,
57
+ "operational": true
58
+ }
34
59
  },
35
60
  "profile": {
36
61
  "id": "",
37
62
  "name": "",
38
63
  "gender": "",
39
64
  "email": "",
40
- "date_of_birth": ""
65
+ "username": "0d5fe1c4",
66
+ "date_of_birth": "",
67
+ "phone": "",
68
+ "dummy": false
41
69
  }
42
70
  }
43
71
  }
@@ -21,25 +21,59 @@ api_output = <<-eos
21
21
  "heading": "OTP was verified succesfully",
22
22
  "message": "You may need to accept the terms and conditions to get the API token if you have not yet finished the registration"
23
23
  },
24
- "data": {
25
- "api_token": "22431f28189e2c88ba58ee221f373931",
26
- "registration": {
27
- "id": 4,
28
- "user_id": "12",
29
- "country_id": 1,
30
- "city_id": "",
31
- "dialing_prefix": "+91",
32
- "mobile_number": "192837465",
33
- "status": "verified"
34
- },
35
- "profile": {
36
- "id": 12,
37
- "name": "Some Name",
38
- "gender": "Male",
39
- "email": "asd@asd.com",
40
- "date_of_birth": "10/10/1980"
41
- },
42
- "api_token": "<API Token for the device>"
24
+ "data": {
25
+ "api_token": "67d9f2430759eb304e1e64fa01a7829e",
26
+ "registration": {
27
+ "id": 165,
28
+ "dialing_prefix": "+97",
29
+ "mobile_number": "1501370320",
30
+ "status": "verified",
31
+ "user_id": 19,
32
+ "country_id": 235,
33
+ "city_id": 21,
34
+ "user": {
35
+ "id": 19,
36
+ "name": "Mickey Mouse ",
37
+ "gender": "male",
38
+ "date_of_birth": "10-10-1983",
39
+ "username": "342721f3",
40
+ "email": "mickey@dondealapps.com",
41
+ "phone": "",
42
+ "dummy": false
43
+ },
44
+ "country": {
45
+ "id": 235,
46
+ "name": "United Arab Emirates",
47
+ "iso_name": "UNITED ARAB EMIRATES",
48
+ "iso_alpha_2": "AE",
49
+ "dialing_prefix": "971",
50
+ "priority": 1000,
51
+ "operational": true
52
+ },
53
+ "city": {
54
+ "id": 21,
55
+ "name": "Abu Dhabi",
56
+ "priority": 1000,
57
+ "operational": true
58
+ }
59
+ },
60
+ "profile": {
61
+ "id": 19,
62
+ "name": "Mickey Mouse ",
63
+ "gender": "male",
64
+ "date_of_birth": "10-10-1983",
65
+ "username": "342721f3",
66
+ "email": "mickey@dondealapps.com",
67
+ "phone": "",
68
+ "dummy": false,
69
+ "profile_picture": {
70
+ "id": 60,
71
+ "created_at": "26-09-2017 01:05:15",
72
+ "profile_id": 19,
73
+ "image_large_path": "/uploads/profile_pictures/60/large_micky.jpg",
74
+ "image_small_path": "/uploads/profile_pictures/60/small_micky.jpg"
75
+ }
76
+ }
43
77
  }
44
78
  }
45
79
  eos
data/lib/usman/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Usman
2
- VERSION = '0.3.19'
2
+ VERSION = '0.3.20'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: usman
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.19
4
+ version: 0.3.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - kpvarma