punk 0.3.6 → 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 (136) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test.yml +1 -1
  3. data/.rubocop.yml +1091 -93
  4. data/.standard.yml +2 -0
  5. data/Gemfile +60 -60
  6. data/Gemfile.lock +22 -17
  7. data/README.md +7 -3
  8. data/Rakefile +9 -7
  9. data/VERSION +1 -1
  10. data/app/migrations/001_lets_punk.rb +1 -1
  11. data/app/routes/hello.rb +1 -1
  12. data/bin/punk +5 -5
  13. data/lib/punk.rb +7 -7
  14. data/lib/punk/actions/sessions/create.rb +3 -3
  15. data/lib/punk/actions/sessions/verify.rb +2 -2
  16. data/lib/punk/commands/auth.rb +4 -4
  17. data/lib/punk/commands/generate.rb +5 -5
  18. data/lib/punk/commands/http.rb +4 -4
  19. data/lib/punk/commands/list.rb +10 -10
  20. data/lib/punk/core/app.rb +41 -41
  21. data/lib/punk/core/boot.rb +5 -5
  22. data/lib/punk/core/cli.rb +3 -3
  23. data/lib/punk/core/commander.rb +28 -28
  24. data/lib/punk/core/commands.rb +8 -8
  25. data/lib/punk/core/env.rb +27 -27
  26. data/lib/punk/core/exec.rb +8 -8
  27. data/lib/punk/core/interface.rb +19 -19
  28. data/lib/punk/core/load.rb +2 -2
  29. data/lib/punk/core/logger.rb +3 -3
  30. data/lib/punk/core/monkey.rb +1 -1
  31. data/lib/punk/core/pry.rb +2 -2
  32. data/lib/punk/core/settings.rb +4 -4
  33. data/lib/punk/core/version.rb +1 -1
  34. data/lib/punk/core/worker.rb +6 -6
  35. data/lib/punk/framework/all.rb +8 -8
  36. data/lib/punk/framework/model.rb +6 -5
  37. data/lib/punk/framework/plugins/all.rb +1 -1
  38. data/lib/punk/framework/plugins/validation.rb +8 -8
  39. data/lib/punk/framework/service.rb +5 -3
  40. data/lib/punk/framework/worker.rb +3 -3
  41. data/lib/punk/helpers/all.rb +5 -5
  42. data/lib/punk/helpers/loggable.rb +3 -3
  43. data/lib/punk/helpers/publishable.rb +1 -1
  44. data/lib/punk/helpers/renderable.rb +10 -10
  45. data/lib/punk/helpers/validatable.rb +7 -6
  46. data/lib/punk/migrations/001_punk.rb +12 -12
  47. data/lib/punk/models/group.rb +1 -1
  48. data/lib/punk/models/identity.rb +1 -1
  49. data/lib/punk/models/session.rb +7 -7
  50. data/lib/punk/models/tenant.rb +1 -1
  51. data/lib/punk/models/user.rb +2 -2
  52. data/lib/punk/plugins/all.rb +2 -2
  53. data/lib/punk/plugins/cors.rb +2 -2
  54. data/lib/punk/plugins/ssl.rb +1 -1
  55. data/lib/punk/routes/groups.rb +1 -1
  56. data/lib/punk/routes/plivo.rb +1 -1
  57. data/lib/punk/routes/sessions.rb +2 -2
  58. data/lib/punk/routes/swagger.rb +2 -2
  59. data/lib/punk/routes/tenants.rb +1 -1
  60. data/lib/punk/routes/users.rb +1 -1
  61. data/lib/punk/services/challenge_claim.rb +5 -5
  62. data/lib/punk/services/generate_swagger.rb +6 -6
  63. data/lib/punk/services/prove_claim.rb +1 -1
  64. data/lib/punk/startup/cache.rb +3 -3
  65. data/lib/punk/startup/database.rb +4 -4
  66. data/lib/punk/startup/environment.rb +6 -6
  67. data/lib/punk/startup/logger.rb +2 -2
  68. data/lib/punk/startup/task.rb +5 -5
  69. data/lib/punk/views/fail.rb +2 -2
  70. data/lib/punk/views/groups/list.rb +2 -2
  71. data/lib/punk/views/info.rb +2 -2
  72. data/lib/punk/views/plivo_store.rb +2 -2
  73. data/lib/punk/views/sessions/list.rb +2 -2
  74. data/lib/punk/views/sessions/pending.rb +2 -2
  75. data/lib/punk/views/tenants/list.rb +2 -2
  76. data/lib/punk/views/users/list.rb +2 -2
  77. data/lib/punk/views/users/show.rb +2 -2
  78. data/lib/punk/workers/geocode_session_worker.rb +3 -3
  79. data/lib/punk/workers/identify_session_worker.rb +1 -1
  80. data/lib/punk/workers/send_email_worker.rb +3 -3
  81. data/lib/punk/workers/send_sms_worker.rb +3 -3
  82. data/punk.gemspec +8 -4
  83. data/spec/actions/groups/punk/list_groups_action_spec.rb +9 -9
  84. data/spec/actions/sessions/punk/clear_session_action_spec.rb +11 -11
  85. data/spec/actions/sessions/punk/create_session_action_spec.rb +9 -9
  86. data/spec/actions/sessions/punk/list_sessions_action_spec.rb +8 -8
  87. data/spec/actions/sessions/punk/verify_session_action_spec.rb +24 -24
  88. data/spec/actions/tenants/punk/list_tenants_action_spec.rb +6 -6
  89. data/spec/actions/users/punk/list_group_users_action_spec.rb +6 -6
  90. data/spec/actions/users/punk/list_tenant_users_action_spec.rb +6 -6
  91. data/spec/factories/group.rb +1 -1
  92. data/spec/factories/group_user_metadata.rb +1 -1
  93. data/spec/factories/identity.rb +4 -4
  94. data/spec/factories/session.rb +1 -1
  95. data/spec/factories/tenant.rb +1 -1
  96. data/spec/factories/tenant_user_metadata.rb +1 -1
  97. data/spec/factories/user.rb +1 -1
  98. data/spec/lib/commands/generate_spec.rb +2 -2
  99. data/spec/lib/commands/list_spec.rb +2 -2
  100. data/spec/lib/commands/swagger_spec.rb +2 -2
  101. data/spec/lib/engine/punk_env_spec.rb +4 -4
  102. data/spec/lib/engine/punk_exec_spec.rb +2 -2
  103. data/spec/lib/engine/punk_init_spec.rb +2 -2
  104. data/spec/lib/engine/punk_store_spec.rb +2 -2
  105. data/spec/models/punk/group_spec.rb +4 -4
  106. data/spec/models/punk/group_user_metadata_spec.rb +2 -2
  107. data/spec/models/punk/identity_spec.rb +17 -17
  108. data/spec/models/punk/session_spec.rb +4 -4
  109. data/spec/models/punk/tenant_spec.rb +3 -3
  110. data/spec/models/punk/tenant_user_metadata_spec.rb +2 -2
  111. data/spec/models/punk/user_spec.rb +9 -9
  112. data/spec/routes/groups/get_groups_spec.rb +4 -4
  113. data/spec/routes/plivo/get_plivo_spec.rb +1 -1
  114. data/spec/routes/sessions/delete_session_spec.rb +1 -1
  115. data/spec/routes/sessions/get_sessions_spec.rb +5 -5
  116. data/spec/routes/sessions/patch_session_spec.rb +1 -1
  117. data/spec/routes/sessions/post_session_spec.rb +1 -1
  118. data/spec/routes/swagger/get_swagger_spec.rb +1 -1
  119. data/spec/routes/tenants/get_tenants_spec.rb +5 -5
  120. data/spec/routes/users/get_users_spec.rb +6 -6
  121. data/spec/services/punk/challenge_claim_service_spec.rb +2 -2
  122. data/spec/services/punk/create_identities_service_spec.rb +1 -1
  123. data/spec/services/punk/generate_swagger_service_spec.rb +2 -2
  124. data/spec/services/punk/prove_claim_service_spec.rb +2 -2
  125. data/spec/services/punk/secret_service_spec.rb +2 -2
  126. data/spec/spec_helper.rb +27 -27
  127. data/spec/views/punk/plivo_store_spec.rb +2 -2
  128. data/spec/views/sessions/punk/list_sessions_view_spec.rb +2 -2
  129. data/spec/views/sessions/punk/pending_session_view_spec.rb +2 -2
  130. data/spec/views/tenants/punk/list_tenants_view_spec.rb +2 -2
  131. data/spec/views/users/punk/list_groups_view_spec.rb +2 -2
  132. data/spec/views/users/punk/list_users_view_spec.rb +2 -2
  133. data/spec/workers/punk/geocode_session_worker_spec.rb +2 -2
  134. data/spec/workers/punk/identify_session_worker_spec.rb +3 -3
  135. data/spec/workers/punk/send_email_worker_spec.rb +1 -1
  136. metadata +18 -3
@@ -1,12 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  describe PUNK do
4
- describe '.env' do
5
- it 'loads environment' do
6
- expect(described_class.get.trace).to eq('spec_test')
4
+ describe ".env" do
5
+ it "loads environment" do
6
+ expect(described_class.get.trace).to eq("spec_test")
7
7
  end
8
8
 
9
- it 'loads configuration' do
9
+ it "loads configuration" do
10
10
  expect(described_class.env.to_sym).to eq(:test)
11
11
  end
12
12
  end
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  describe PUNK do
4
- describe '.exec' do
5
- it 'starts the PUNK engine' do
4
+ describe ".exec" do
5
+ it "starts the PUNK engine" do
6
6
  expect(described_class.store.state).to eq(:started)
7
7
  end
8
8
  end
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  describe PUNK do
4
- describe '.init' do
5
- it 'cannot be called twice' do
4
+ describe ".init" do
5
+ it "cannot be called twice" do
6
6
  expect { described_class.init }.to raise_error(PUNK::InternalServerError, "Cannot call PUNK.init multiple times!")
7
7
  end
8
8
  end
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  describe PUNK do
4
- describe '.store' do
5
- it 'acts like a dotted hash' do
4
+ describe ".store" do
5
+ it "acts like a dotted hash" do
6
6
  described_class.store["foo"] = "bar"
7
7
  expect(described_class.store.foo).to eq("bar")
8
8
  end
@@ -8,7 +8,7 @@ describe PUNK::Group do
8
8
  it "is assigned a uuid on save" do
9
9
  group = build(:group)
10
10
  expect(group.id).to be_nil
11
- group.save
11
+ group.save_changes
12
12
  expect(valid_uuid?(group.id)).to be(true)
13
13
  end
14
14
 
@@ -21,7 +21,7 @@ describe PUNK::Group do
21
21
  it "is invalid without a name" do
22
22
  group = build(:group, name: nil)
23
23
  expect(group.valid?).to be(false)
24
- expect(group.errors[:name].first).to eq('is not present')
24
+ expect(group.errors[:name].first).to eq("is not present")
25
25
  end
26
26
 
27
27
  it "is valid without an icon" do
@@ -32,13 +32,13 @@ describe PUNK::Group do
32
32
  it "is invalid if the icon is not a URL" do
33
33
  group = build(:group, icon: Faker::Alphanumeric.alpha)
34
34
  expect(group.valid?).to be(false)
35
- expect(group.errors[:icon].first).to eq('is not a URL')
35
+ expect(group.errors[:icon].first).to eq("is not a URL")
36
36
  end
37
37
 
38
38
  it "must belong to a tenant" do
39
39
  group = build(:group, tenant: nil)
40
40
  expect(group.valid?).to be(false)
41
- expect(group.errors[:tenant].first).to eq('is not present')
41
+ expect(group.errors[:tenant].first).to eq("is not present")
42
42
  end
43
43
 
44
44
  it "can have multiple members" do
@@ -8,13 +8,13 @@ describe PUNK::GroupUserMetadata do
8
8
  it "is invalid without a group" do
9
9
  group_user_metadata = build(:group_user_metadata, group: nil)
10
10
  expect(group_user_metadata.valid?).to be(false)
11
- expect(group_user_metadata.errors[:group].first).to eq('is not present')
11
+ expect(group_user_metadata.errors[:group].first).to eq("is not present")
12
12
  end
13
13
 
14
14
  it "is invalid without a user" do
15
15
  group_user_metadata = build(:group_user_metadata, user: nil)
16
16
  expect(group_user_metadata.valid?).to be(false)
17
- expect(group_user_metadata.errors[:user].first).to eq('is not present')
17
+ expect(group_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
@@ -1,58 +1,58 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  describe PUNK::Identity do
4
- it 'is valid with valid attributes' do
4
+ it "is valid with valid attributes" do
5
5
  expect { create(:identity) }.not_to raise_error
6
6
  end
7
7
 
8
- it 'must claim an email or a phone' do
9
- identity = build(:identity, claim_type: 'zork', claim: 'xyzzy')
8
+ it "must claim an email or a phone" do
9
+ identity = build(:identity, claim_type: "zork", claim: "xyzzy")
10
10
  expect(identity.valid?).to be(false)
11
- expect(identity.errors[:claim_type].first).to eq('is not in range or set: [:email, :phone]')
11
+ expect(identity.errors[:claim_type].first).to eq("is not in range or set: [:email, :phone]")
12
12
  end
13
13
 
14
- it 'is assigned a uuid on save' do
14
+ it "is assigned a uuid on save" do
15
15
  identity = build(:identity)
16
16
  expect(identity.id).to be_nil
17
- identity.save
17
+ identity.save_changes
18
18
  expect(valid_uuid?(identity.id)).to be(true)
19
19
  end
20
20
 
21
- it 'can be saved with a custom uuid' do
21
+ it "can be saved with a custom uuid" do
22
22
  uuid = generate(:uuid)
23
23
  identity = create(:identity, id: uuid)
24
24
  expect(identity.id).to eq(uuid)
25
25
  end
26
26
 
27
- it 'may belong to a user' do
27
+ it "may belong to a user" do
28
28
  identity_with_user = create(:identity)
29
29
  expect(identity_with_user.user).to exist
30
30
  identity_without_user = create(:identity, user: nil)
31
31
  expect(identity_without_user.user).to be_nil
32
32
  end
33
33
 
34
- it 'has an email? accessor' do
35
- identity_with_email = build(:identity, claim_type: 'email')
34
+ it "has an email? accessor" do
35
+ identity_with_email = build(:identity, claim_type: "email")
36
36
  expect(identity_with_email.email?).to be(true)
37
- identity_without_email = build(:identity, claim_type: 'phone')
37
+ identity_without_email = build(:identity, claim_type: "phone")
38
38
  expect(identity_without_email.email?).to be(false)
39
39
  end
40
40
 
41
- it 'has a phone? accessor' do
42
- identity_with_phone = create(:identity, claim_type: 'phone')
41
+ it "has a phone? accessor" do
42
+ identity_with_phone = create(:identity, claim_type: "phone")
43
43
  expect(identity_with_phone.phone?).to be(true)
44
- identity_without_phone = create(:identity, claim_type: 'email')
44
+ identity_without_phone = create(:identity, claim_type: "email")
45
45
  expect(identity_without_phone.phone?).to be(false)
46
46
  end
47
47
 
48
- it 'has a unique claim' do
48
+ it "has a unique claim" do
49
49
  identity = create(:identity)
50
50
  duplicate_identity = build(:identity, claim_type: identity.claim_type, claim: identity.claim)
51
51
  expect(duplicate_identity.valid?).to be(false)
52
- expect(duplicate_identity.errors[:claim].first).to eq('is already taken')
52
+ expect(duplicate_identity.errors[:claim].first).to eq("is already taken")
53
53
  end
54
54
 
55
- it 'can have multiple sessions' do
55
+ it "can have multiple sessions" do
56
56
  identity = create(:identity)
57
57
  expect(identity.sessions.count).to eq(0)
58
58
  create_list(:session, 3, identity: identity)
@@ -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