punk 0.3.2 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test.yml +1 -1
  3. data/.rdoc_options +0 -1
  4. data/.rubocop.yml +1091 -93
  5. data/.standard.yml +2 -0
  6. data/Gemfile +60 -61
  7. data/Gemfile.lock +64 -59
  8. data/README.md +7 -3
  9. data/Rakefile +9 -7
  10. data/VERSION +1 -1
  11. data/app/migrations/001_lets_punk.rb +1 -1
  12. data/app/routes/hello.rb +1 -1
  13. data/bin/punk +5 -5
  14. data/env/defaults.sh +3 -0
  15. data/lib/punk.rb +8 -9
  16. data/lib/punk/actions/sessions/create.rb +3 -3
  17. data/lib/punk/actions/sessions/verify.rb +2 -2
  18. data/lib/punk/commands/auth.rb +4 -4
  19. data/lib/punk/commands/generate.rb +5 -5
  20. data/lib/punk/commands/http.rb +4 -4
  21. data/lib/punk/commands/list.rb +10 -10
  22. data/lib/punk/core/app.rb +41 -41
  23. data/lib/punk/core/boot.rb +5 -5
  24. data/lib/punk/core/cli.rb +3 -3
  25. data/lib/punk/core/commander.rb +28 -28
  26. data/lib/punk/core/commands.rb +8 -8
  27. data/lib/punk/core/env.rb +27 -27
  28. data/lib/punk/core/exec.rb +8 -8
  29. data/lib/punk/core/interface.rb +19 -19
  30. data/lib/punk/core/load.rb +2 -2
  31. data/lib/punk/core/logger.rb +3 -3
  32. data/lib/punk/core/monkey.rb +1 -1
  33. data/lib/punk/core/pry.rb +2 -2
  34. data/lib/punk/core/settings.rb +4 -4
  35. data/lib/punk/core/version.rb +1 -1
  36. data/lib/punk/core/worker.rb +6 -6
  37. data/lib/punk/framework/all.rb +8 -8
  38. data/lib/punk/framework/model.rb +6 -5
  39. data/lib/punk/framework/plugins/all.rb +1 -1
  40. data/lib/punk/framework/plugins/validation.rb +8 -8
  41. data/lib/punk/framework/service.rb +5 -3
  42. data/lib/punk/framework/worker.rb +3 -3
  43. data/lib/punk/helpers/all.rb +5 -5
  44. data/lib/punk/helpers/loggable.rb +3 -3
  45. data/lib/punk/helpers/publishable.rb +1 -1
  46. data/lib/punk/helpers/renderable.rb +10 -10
  47. data/lib/punk/helpers/validatable.rb +7 -6
  48. data/lib/punk/migrations/001_punk.rb +12 -12
  49. data/lib/punk/models/group.rb +1 -1
  50. data/lib/punk/models/identity.rb +1 -1
  51. data/lib/punk/models/session.rb +7 -7
  52. data/lib/punk/models/tenant.rb +1 -1
  53. data/lib/punk/models/user.rb +2 -2
  54. data/lib/punk/plugins/all.rb +2 -2
  55. data/lib/punk/plugins/cors.rb +2 -2
  56. data/lib/punk/plugins/ssl.rb +1 -1
  57. data/lib/punk/routes/groups.rb +1 -1
  58. data/lib/punk/routes/plivo.rb +1 -1
  59. data/lib/punk/routes/sessions.rb +2 -2
  60. data/lib/punk/routes/swagger.rb +2 -2
  61. data/lib/punk/routes/tenants.rb +1 -1
  62. data/lib/punk/routes/users.rb +1 -1
  63. data/lib/punk/services/challenge_claim.rb +5 -5
  64. data/lib/punk/services/generate_swagger.rb +6 -6
  65. data/lib/punk/services/prove_claim.rb +1 -1
  66. data/lib/punk/startup/cache.rb +3 -3
  67. data/lib/punk/startup/database.rb +4 -4
  68. data/lib/punk/startup/environment.rb +6 -6
  69. data/lib/punk/startup/logger.rb +2 -2
  70. data/lib/punk/startup/task.rb +5 -5
  71. data/lib/punk/views/fail.rb +2 -2
  72. data/lib/punk/views/groups/list.rb +2 -2
  73. data/lib/punk/views/info.rb +2 -2
  74. data/lib/punk/views/plivo_store.rb +2 -2
  75. data/lib/punk/views/sessions/list.rb +2 -2
  76. data/lib/punk/views/sessions/pending.rb +2 -2
  77. data/lib/punk/views/tenants/list.rb +2 -2
  78. data/lib/punk/views/users/list.rb +2 -2
  79. data/lib/punk/views/users/show.rb +2 -2
  80. data/lib/punk/workers/geocode_session_worker.rb +3 -3
  81. data/lib/punk/workers/identify_session_worker.rb +1 -1
  82. data/lib/punk/workers/send_email_worker.rb +3 -3
  83. data/lib/punk/workers/send_sms_worker.rb +3 -3
  84. data/punk.gemspec +33 -31
  85. data/spec/actions/groups/punk/list_groups_action_spec.rb +9 -9
  86. data/spec/actions/sessions/punk/clear_session_action_spec.rb +11 -11
  87. data/spec/actions/sessions/punk/create_session_action_spec.rb +9 -9
  88. data/spec/actions/sessions/punk/list_sessions_action_spec.rb +8 -8
  89. data/spec/actions/sessions/punk/verify_session_action_spec.rb +24 -24
  90. data/spec/actions/tenants/punk/list_tenants_action_spec.rb +6 -6
  91. data/spec/actions/users/punk/list_group_users_action_spec.rb +6 -6
  92. data/spec/actions/users/punk/list_tenant_users_action_spec.rb +6 -6
  93. data/spec/factories/group.rb +1 -1
  94. data/spec/factories/group_user_metadata.rb +1 -1
  95. data/spec/factories/identity.rb +4 -4
  96. data/spec/factories/session.rb +1 -1
  97. data/spec/factories/tenant.rb +1 -1
  98. data/spec/factories/tenant_user_metadata.rb +1 -1
  99. data/spec/factories/user.rb +1 -1
  100. data/spec/lib/commands/generate_spec.rb +2 -2
  101. data/spec/lib/commands/list_spec.rb +2 -2
  102. data/spec/lib/commands/swagger_spec.rb +2 -2
  103. data/spec/lib/engine/punk_env_spec.rb +4 -4
  104. data/spec/lib/engine/punk_exec_spec.rb +2 -2
  105. data/spec/lib/engine/punk_init_spec.rb +2 -2
  106. data/spec/lib/engine/punk_store_spec.rb +2 -2
  107. data/spec/models/punk/group_spec.rb +4 -4
  108. data/spec/models/punk/group_user_metadata_spec.rb +2 -2
  109. data/spec/models/punk/identity_spec.rb +17 -17
  110. data/spec/models/punk/session_spec.rb +4 -4
  111. data/spec/models/punk/tenant_spec.rb +3 -3
  112. data/spec/models/punk/tenant_user_metadata_spec.rb +2 -2
  113. data/spec/models/punk/user_spec.rb +9 -9
  114. data/spec/routes/groups/get_groups_spec.rb +4 -4
  115. data/spec/routes/plivo/get_plivo_spec.rb +1 -1
  116. data/spec/routes/sessions/delete_session_spec.rb +1 -1
  117. data/spec/routes/sessions/get_sessions_spec.rb +5 -5
  118. data/spec/routes/sessions/patch_session_spec.rb +1 -1
  119. data/spec/routes/sessions/post_session_spec.rb +1 -1
  120. data/spec/routes/swagger/get_swagger_spec.rb +1 -1
  121. data/spec/routes/tenants/get_tenants_spec.rb +5 -5
  122. data/spec/routes/users/get_users_spec.rb +6 -6
  123. data/spec/services/punk/challenge_claim_service_spec.rb +2 -2
  124. data/spec/services/punk/create_identities_service_spec.rb +1 -1
  125. data/spec/services/punk/generate_swagger_service_spec.rb +2 -2
  126. data/spec/services/punk/prove_claim_service_spec.rb +2 -2
  127. data/spec/services/punk/secret_service_spec.rb +2 -2
  128. data/spec/spec_helper.rb +27 -27
  129. data/spec/views/punk/plivo_store_spec.rb +2 -2
  130. data/spec/views/sessions/punk/list_sessions_view_spec.rb +2 -2
  131. data/spec/views/sessions/punk/pending_session_view_spec.rb +2 -2
  132. data/spec/views/tenants/punk/list_tenants_view_spec.rb +2 -2
  133. data/spec/views/users/punk/list_groups_view_spec.rb +2 -2
  134. data/spec/views/users/punk/list_users_view_spec.rb +2 -2
  135. data/spec/workers/punk/geocode_session_worker_spec.rb +2 -2
  136. data/spec/workers/punk/identify_session_worker_spec.rb +3 -3
  137. data/spec/workers/punk/send_email_worker_spec.rb +1 -1
  138. metadata +24 -22
@@ -8,7 +8,7 @@ describe PUNK::Session do
8
8
  it "is assigned a uuid on save" do
9
9
  session = build(:session)
10
10
  expect(session.id).to be_nil
11
- session.save
11
+ session.save_changes
12
12
  expect(valid_uuid?(session.id)).to be(true)
13
13
  end
14
14
 
@@ -21,7 +21,7 @@ describe PUNK::Session do
21
21
  it "must belong to an identity" do
22
22
  session = build(:session, identity: nil)
23
23
  expect(session.valid?).to be(false)
24
- expect(session.errors[:identity].first).to eq('is not present')
24
+ expect(session.errors[:identity].first).to eq("is not present")
25
25
  end
26
26
 
27
27
  it "may have a user" do
@@ -32,8 +32,8 @@ describe PUNK::Session do
32
32
  end
33
33
 
34
34
  it "can contain client data" do
35
- identity = create(:session, data: { foo: 'bar' })
36
- expect(identity.data[:foo]).to eq('bar')
35
+ identity = create(:session, data: {foo: "bar"})
36
+ expect(identity.data[:foo]).to eq("bar")
37
37
  end
38
38
 
39
39
  it "permits only three validation attempts" do
@@ -8,7 +8,7 @@ describe PUNK::Tenant do
8
8
  it "is assigned a uuid on save" do
9
9
  tenant = build(:tenant)
10
10
  expect(tenant.id).to be_nil
11
- tenant.save
11
+ tenant.save_changes
12
12
  expect(valid_uuid?(tenant.id)).to be(true)
13
13
  end
14
14
 
@@ -21,7 +21,7 @@ describe PUNK::Tenant do
21
21
  it "is invalid without a name" do
22
22
  tenant = build(:tenant, name: nil)
23
23
  expect(tenant.valid?).to be(false)
24
- expect(tenant.errors[:name].first).to eq('is not present')
24
+ expect(tenant.errors[:name].first).to eq("is not present")
25
25
  end
26
26
 
27
27
  it "is valid without an icon" do
@@ -32,7 +32,7 @@ describe PUNK::Tenant do
32
32
  it "is invalid if the icon is not a URL" do
33
33
  tenant = build(:tenant, icon: Faker::Alphanumeric.alpha)
34
34
  expect(tenant.valid?).to be(false)
35
- expect(tenant.errors[:icon].first).to eq('is not a URL')
35
+ expect(tenant.errors[:icon].first).to eq("is not a URL")
36
36
  end
37
37
 
38
38
  it "can have multiple users" do
@@ -8,13 +8,13 @@ describe PUNK::TenantUserMetadata do
8
8
  it "is invalid without a tenant" do
9
9
  tenant_user_metadata = build(:tenant_user_metadata, tenant: nil)
10
10
  expect(tenant_user_metadata.valid?).to be(false)
11
- expect(tenant_user_metadata.errors[:tenant].first).to eq('is not present')
11
+ expect(tenant_user_metadata.errors[:tenant].first).to eq("is not present")
12
12
  end
13
13
 
14
14
  it "is invalid without a user" do
15
15
  tenant_user_metadata = build(:tenant_user_metadata, user: nil)
16
16
  expect(tenant_user_metadata.valid?).to be(false)
17
- expect(tenant_user_metadata.errors[:user].first).to eq('is not present')
17
+ expect(tenant_user_metadata.errors[:user].first).to eq("is not present")
18
18
  end
19
19
 
20
20
  it "displays as the two IDs concatenated" do
@@ -8,7 +8,7 @@ describe PUNK::User do
8
8
  it "is assigned a uuid on save" do
9
9
  user = build(:user)
10
10
  expect(user.id).to be_nil
11
- user.save
11
+ user.save_changes
12
12
  expect(valid_uuid?(user.id)).to be(true)
13
13
  end
14
14
 
@@ -21,7 +21,7 @@ describe PUNK::User do
21
21
  it "is invalid without a name" do
22
22
  user = build(:user, name: nil)
23
23
  expect(user.valid?).to be(false)
24
- expect(user.errors[:name].first).to eq('is not present')
24
+ expect(user.errors[:name].first).to eq("is not present")
25
25
  end
26
26
 
27
27
  it "validates name presence in the database" do
@@ -37,7 +37,7 @@ describe PUNK::User do
37
37
  it "is invalid if the icon is not a URL" do
38
38
  user = build(:user, icon: Faker::Alphanumeric.alpha)
39
39
  expect(user.valid?).to be(false)
40
- expect(user.errors[:icon].first).to eq('is not a URL')
40
+ expect(user.errors[:icon].first).to eq("is not a URL")
41
41
  end
42
42
 
43
43
  it "is valid without an email" do
@@ -48,14 +48,14 @@ describe PUNK::User do
48
48
  it "is invalid if the email is not an email address" do
49
49
  user = build(:user, email: Faker::Alphanumeric.alpha)
50
50
  expect(user.valid?).to be(false)
51
- expect(user.errors[:email].first).to eq('is not an email address')
51
+ expect(user.errors[:email].first).to eq("is not an email address")
52
52
  end
53
53
 
54
54
  it "has a unique email" do
55
55
  email = create(:user).email
56
56
  user = build(:user, email: email)
57
57
  expect(user.valid?).to be(false)
58
- expect(user.errors[:email].first).to eq('is already taken')
58
+ expect(user.errors[:email].first).to eq("is already taken")
59
59
  end
60
60
 
61
61
  it "validates email uniqueness in the database" do
@@ -72,14 +72,14 @@ describe PUNK::User do
72
72
  it "is invalid if the phone is not a phone number" do
73
73
  user = build(:user, phone: Faker::Alphanumeric.alpha)
74
74
  expect(user.valid?).to be(false)
75
- expect(user.errors[:phone].first).to eq('is not a phone number')
75
+ expect(user.errors[:phone].first).to eq("is not a phone number")
76
76
  end
77
77
 
78
78
  it "has a unique phone" do
79
79
  phone = create(:user).phone
80
80
  user = build(:user, phone: phone)
81
81
  expect(user.valid?).to be(false)
82
- expect(user.errors[:phone].first).to eq('is already taken')
82
+ expect(user.errors[:phone].first).to eq("is already taken")
83
83
  end
84
84
 
85
85
  it "validates phone uniqueness in the database" do
@@ -91,8 +91,8 @@ describe PUNK::User do
91
91
  it "is invalid without either an email or a phone" do
92
92
  user = build(:user, email: nil, phone: nil)
93
93
  user.valid?
94
- expect(user.errors[:email].first).to eq('is not present')
95
- expect(user.errors[:phone].first).to eq('is not present')
94
+ expect(user.errors[:email].first).to eq("is not present")
95
+ expect(user.errors[:phone].first).to eq("is not present")
96
96
  end
97
97
 
98
98
  it "can belong to multiple tenants" do
@@ -3,17 +3,17 @@
3
3
  describe PUNK, "GET /groups" do
4
4
  include_context "Punk"
5
5
 
6
- context 'when the user is not authenticated' do
6
+ context "when the user is not authenticated" do
7
7
  before do
8
- get '/groups'
8
+ get "/groups"
9
9
  end
10
10
 
11
11
  it { is_expected.not_to be_successful }
12
12
  end
13
13
 
14
- context 'when the user is authenticated' do
14
+ context "when the user is authenticated" do
15
15
  let(:tenant) { create(:tenant) }
16
- let(:identity) { create(:identity, claim_type: 'phone') }
16
+ let(:identity) { create(:identity, claim_type: "phone") }
17
17
  let(:group) { create(:group, tenant: tenant) }
18
18
 
19
19
  before do
@@ -4,7 +4,7 @@ describe PUNK, "GET /plivo" do
4
4
  include_context "Punk"
5
5
 
6
6
  before do
7
- get '/plivo.html'
7
+ get "/plivo.html"
8
8
  end
9
9
 
10
10
  it { is_expected.to be_successful }
@@ -4,7 +4,7 @@ describe PUNK, "DELETE /sessions" do
4
4
  include_context "Punk"
5
5
 
6
6
  before do
7
- delete '/sessions'
7
+ delete "/sessions"
8
8
  end
9
9
 
10
10
  it { is_expected.not_to be_successful }
@@ -3,21 +3,21 @@
3
3
  describe PUNK, "GET /sessions" do
4
4
  include_context "Punk"
5
5
 
6
- context 'when the user is not authenticated' do
6
+ context "when the user is not authenticated" do
7
7
  before do
8
- get '/sessions'
8
+ get "/sessions"
9
9
  end
10
10
 
11
11
  it { is_expected.not_to be_successful }
12
12
  end
13
13
 
14
- context 'when the user is authenticated' do
14
+ context "when the user is authenticated" do
15
15
  let(:user) { create(:user) }
16
- let(:identity) { create(:identity, user: user, claim_type: 'phone') }
16
+ let(:identity) { create(:identity, user: user, claim_type: "phone") }
17
17
 
18
18
  before do
19
19
  login(identity.claim)
20
- get '/sessions'
20
+ get "/sessions"
21
21
  end
22
22
 
23
23
  after do
@@ -4,7 +4,7 @@ describe PUNK, "PATCH /sessions" do
4
4
  include_context "Punk"
5
5
 
6
6
  before do
7
- patch '/sessions'
7
+ patch "/sessions"
8
8
  end
9
9
 
10
10
  it { is_expected.not_to be_successful }
@@ -4,7 +4,7 @@ describe PUNK, "POST /sessions" do
4
4
  include_context "Punk"
5
5
 
6
6
  before do
7
- post '/sessions'
7
+ post "/sessions"
8
8
  end
9
9
 
10
10
  it { is_expected.not_to be_successful }
@@ -4,7 +4,7 @@ describe PUNK, "GET /swagger" do
4
4
  include_context "Punk"
5
5
 
6
6
  before do
7
- get '/swagger'
7
+ get "/swagger"
8
8
  end
9
9
 
10
10
  it { is_expected.to be_successful }
@@ -3,22 +3,22 @@
3
3
  describe PUNK, "GET /tenants" do
4
4
  include_context "Punk"
5
5
 
6
- context 'when the user is not authenticated' do
6
+ context "when the user is not authenticated" do
7
7
  before do
8
- get '/tenants'
8
+ get "/tenants"
9
9
  end
10
10
 
11
11
  it { is_expected.not_to be_successful }
12
12
  end
13
13
 
14
- context 'when the user is authenticated' do
14
+ context "when the user is authenticated" do
15
15
  let(:tenant) { create(:tenant) }
16
- let(:identity) { create(:identity, claim_type: 'phone') }
16
+ let(:identity) { create(:identity, claim_type: "phone") }
17
17
 
18
18
  before do
19
19
  identity.user.add_tenant(tenant)
20
20
  login(identity.claim)
21
- get '/tenants'
21
+ get "/tenants"
22
22
  end
23
23
 
24
24
  after do
@@ -3,17 +3,17 @@
3
3
  describe PUNK, "GET /users" do
4
4
  include_context "Punk"
5
5
 
6
- context 'when the user is not authenticated' do
6
+ context "when the user is not authenticated" do
7
7
  before do
8
- get '/users'
8
+ get "/users"
9
9
  end
10
10
 
11
11
  it { is_expected.not_to be_successful }
12
12
  end
13
13
 
14
- context 'when the user is authenticated' do
14
+ context "when the user is authenticated" do
15
15
  let(:tenant) { create(:tenant) }
16
- let(:identity) { create(:identity, claim_type: 'phone') }
16
+ let(:identity) { create(:identity, claim_type: "phone") }
17
17
  let(:group) { create(:group, tenant: tenant) }
18
18
  let(:tenant_user) { create(:user) }
19
19
  let(:group_user) { create(:user) }
@@ -31,7 +31,7 @@ describe PUNK, "GET /users" do
31
31
  logout
32
32
  end
33
33
 
34
- context 'without a group' do
34
+ context "without a group" do
35
35
  before do
36
36
  get "/users?tenant_id=#{tenant.id}"
37
37
  end
@@ -44,7 +44,7 @@ describe PUNK, "GET /users" do
44
44
  end
45
45
  end
46
46
 
47
- context 'with a group' do
47
+ context "with a group" do
48
48
  before do
49
49
  get "/users?tenant_id=#{tenant.id}&group_id=#{group.id}"
50
50
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  describe PUNK::ChallengeClaimService do
4
- context 'with no specs written' do
5
- it 'displays a warning'
4
+ context "with no specs written" do
5
+ it "displays a warning"
6
6
  end
7
7
  end
@@ -6,7 +6,7 @@ describe PUNK::CreateIdentitiesService do
6
6
  create(:user, email: nil)
7
7
  end
8
8
 
9
- it 'creates identities for users that are missing them' do
9
+ it "creates identities for users that are missing them" do
10
10
  expect(PUNK::Identity.count).to eq(0)
11
11
  described_class.run
12
12
  expect(PUNK::Identity.count).to eq(2)
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  describe PUNK::GenerateSwaggerService do
4
- context 'with no specs written' do
5
- it 'displays a warning'
4
+ context "with no specs written" do
5
+ it "displays a warning"
6
6
  end
7
7
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  describe PUNK::ProveClaimService do
4
- context 'with no specs written' do
5
- it 'displays a warning'
4
+ context "with no specs written" do
5
+ it "displays a warning"
6
6
  end
7
7
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  describe PUNK::SecretService do
4
- context 'with no specs written' do
5
- it 'displays a warning'
4
+ context "with no specs written" do
5
+ it "displays a warning"
6
6
  end
7
7
  end
data/spec/spec_helper.rb CHANGED
@@ -1,46 +1,46 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'simplecov'
4
- require 'coveralls'
3
+ require "simplecov"
4
+ require "coveralls"
5
5
  SimpleCov.start do
6
- add_filter 'spec'
7
- add_filter 'lib/punk/commands/auth.rb'
8
- add_filter 'lib/punk/commands/generate.rb'
9
- add_filter 'lib/punk/commands/http.rb'
10
- add_filter 'lib/punk/commands/list.rb'
11
- add_filter 'lib/punk/core/commands.rb'
12
- add_filter 'lib/punk/framework/command.rb'
13
- add_filter 'lib/punk/plugins/cors.rb'
14
- add_filter 'lib/punk/plugins/ssl.rb'
15
- add_filter 'lib/punk/startup/logger.rb'
6
+ add_filter "spec"
7
+ add_filter "lib/punk/commands/auth.rb"
8
+ add_filter "lib/punk/commands/generate.rb"
9
+ add_filter "lib/punk/commands/http.rb"
10
+ add_filter "lib/punk/commands/list.rb"
11
+ add_filter "lib/punk/core/commands.rb"
12
+ add_filter "lib/punk/framework/command.rb"
13
+ add_filter "lib/punk/plugins/cors.rb"
14
+ add_filter "lib/punk/plugins/ssl.rb"
15
+ add_filter "lib/punk/startup/logger.rb"
16
16
  end
17
17
  Coveralls.wear!
18
18
 
19
- require_relative '../lib/punk'
19
+ require_relative "../lib/punk"
20
20
 
21
- require 'factory_bot'
22
- require 'faker'
23
- require 'timecop'
24
- require 'securerandom'
25
- require 'vcr'
26
- require 'rack/test'
21
+ require "factory_bot"
22
+ require "faker"
23
+ require "timecop"
24
+ require "securerandom"
25
+ require "vcr"
26
+ require "rack/test"
27
27
 
28
- Faker::Config.locale = 'en-US'
28
+ Faker::Config.locale = "en-US"
29
29
 
30
30
  FactoryBot.use_parent_strategy = false
31
31
 
32
32
  VCR.configure do |c|
33
33
  c.ignore_localhost = true
34
- c.cassette_library_dir = 'spec/vcr_cassettes'
34
+ c.cassette_library_dir = "spec/vcr_cassettes"
35
35
  c.hook_into :webmock
36
36
  c.configure_rspec_metadata!
37
37
  end
38
38
 
39
- PUNK.init(task: 'spec', config: { app: { name: 'Punk Test' } }).exec
39
+ PUNK.init(task: "spec", config: {app: {name: "Punk Test"}}).exec
40
40
 
41
- Sidekiq.logger = SemanticLogger['PUNK::SKQ']
41
+ Sidekiq.logger = SemanticLogger["PUNK::SKQ"]
42
42
 
43
- RSpec.shared_context 'Punk' do # rubocop:disable RSpec/ContextWording
43
+ RSpec.shared_context "Punk" do # rubocop:disable RSpec/ContextWording
44
44
  include Rack::Test::Methods
45
45
 
46
46
  subject { last_response }
@@ -57,7 +57,7 @@ RSpec.shared_context 'Punk' do # rubocop:disable RSpec/ContextWording
57
57
  "PATH_INFO" => "/sessions",
58
58
  "CONTENT_TYPE" => "text/json",
59
59
  "SCRIPT_NAME" => "",
60
- "rack.input" => StringIO.new({ claim: claim }.to_json)
60
+ "rack.input" => StringIO.new({claim: claim}.to_json)
61
61
  )
62
62
  response = ActiveSupport::JSON.decode(response[-1].first).deep_symbolize_keys
63
63
  slug = response[:slug]
@@ -68,7 +68,7 @@ RSpec.shared_context 'Punk' do # rubocop:disable RSpec/ContextWording
68
68
  "PATH_INFO" => "/sessions/#{slug}",
69
69
  "CONTENT_TYPE" => "text/json",
70
70
  "SCRIPT_NAME" => "",
71
- "rack.input" => StringIO.new({ secret: sms[:body][-7..-2] }.to_json)
71
+ "rack.input" => StringIO.new({secret: sms[:body][-7..-2]}.to_json)
72
72
  )
73
73
  end
74
74
 
@@ -84,7 +84,7 @@ end
84
84
 
85
85
  module Helpers
86
86
  def valid_uuid?(data)
87
- data.split('-').map { |s| Integer(s, 16) }.length == 5
87
+ data.split("-").map { |s| Integer(s, 16) }.length == 5
88
88
  end
89
89
  end
90
90