openstax_accounts 5.0.1 → 5.1.0
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.
- checksums.yaml +4 -4
- data/app/representers/openstax/accounts/api/v1/unclaimed_account_representer.rb +16 -0
- data/app/routines/openstax/accounts/create_temp_account.rb +36 -0
- data/lib/openstax/accounts/version.rb +1 -1
- data/spec/cassettes/OpenStax_Accounts_CreateTempAccount/can_create_temp_users.yml +261 -0
- data/spec/dummy/config/environments/development.rb +3 -0
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/schema.rb +7 -7
- data/spec/dummy/log/development.log +1032 -0
- data/spec/dummy/log/test.log +78859 -0
- data/spec/routines/openstax/accounts/create_temp_account_spec.rb +37 -0
- data/spec/vcr_helper.rb +13 -0
- metadata +40 -2
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'vcr_helper'
|
3
|
+
|
4
|
+
module OpenStax
|
5
|
+
module Accounts
|
6
|
+
|
7
|
+
describe CreateTempAccount, vcr: VCR_OPTS do
|
8
|
+
|
9
|
+
before(:all) do
|
10
|
+
OpenStax::Accounts.configuration.openstax_accounts_url = "http://localhost:2999/"
|
11
|
+
OpenStax::Accounts::Api.client.site = "http://localhost:2999/"
|
12
|
+
end
|
13
|
+
|
14
|
+
it 'can create temp users' do
|
15
|
+
account_1 = CreateTempAccount.call(email: 'alice@example.com').outputs.account
|
16
|
+
expect(account_1).to be_persisted
|
17
|
+
|
18
|
+
account_2 = CreateTempAccount.call(username: 'alice').outputs.account
|
19
|
+
expect(account_2).to be_persisted
|
20
|
+
expect(account_1).not_to eq(account_2)
|
21
|
+
|
22
|
+
account_3 = CreateTempAccount.call(username: 'alice2',
|
23
|
+
password: 'abcdefghijklmnop').outputs.account
|
24
|
+
expect(account_3).to be_persisted
|
25
|
+
expect(account_1).not_to eq(account_3)
|
26
|
+
expect(account_2).not_to eq(account_3)
|
27
|
+
end
|
28
|
+
|
29
|
+
after(:all) do
|
30
|
+
OpenStax::Accounts.configuration.openstax_accounts_url = "http://localhost:#{CAPYBARA_SERVER.port}/"
|
31
|
+
OpenStax::Accounts::Api.client.site = "http://localhost:#{CAPYBARA_SERVER.port}/"
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
37
|
+
end
|
data/spec/vcr_helper.rb
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'vcr'
|
2
|
+
|
3
|
+
VCR.configure do |c|
|
4
|
+
c.cassette_library_dir = 'spec/cassettes'
|
5
|
+
c.hook_into :webmock
|
6
|
+
c.configure_rspec_metadata!
|
7
|
+
c.allow_http_connections_when_no_cassette = true
|
8
|
+
end
|
9
|
+
|
10
|
+
VCR_OPTS = {
|
11
|
+
record: :none, # This should be :none before pushing
|
12
|
+
allow_unused_http_interactions: false
|
13
|
+
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: openstax_accounts
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0
|
4
|
+
version: 5.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- JP Slavinsky
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-04-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -276,6 +276,34 @@ dependencies:
|
|
276
276
|
- - ">="
|
277
277
|
- !ruby/object:Gem::Version
|
278
278
|
version: '0'
|
279
|
+
- !ruby/object:Gem::Dependency
|
280
|
+
name: webmock
|
281
|
+
requirement: !ruby/object:Gem::Requirement
|
282
|
+
requirements:
|
283
|
+
- - ">="
|
284
|
+
- !ruby/object:Gem::Version
|
285
|
+
version: '0'
|
286
|
+
type: :development
|
287
|
+
prerelease: false
|
288
|
+
version_requirements: !ruby/object:Gem::Requirement
|
289
|
+
requirements:
|
290
|
+
- - ">="
|
291
|
+
- !ruby/object:Gem::Version
|
292
|
+
version: '0'
|
293
|
+
- !ruby/object:Gem::Dependency
|
294
|
+
name: vcr
|
295
|
+
requirement: !ruby/object:Gem::Requirement
|
296
|
+
requirements:
|
297
|
+
- - ">="
|
298
|
+
- !ruby/object:Gem::Version
|
299
|
+
version: '0'
|
300
|
+
type: :development
|
301
|
+
prerelease: false
|
302
|
+
version_requirements: !ruby/object:Gem::Requirement
|
303
|
+
requirements:
|
304
|
+
- - ">="
|
305
|
+
- !ruby/object:Gem::Version
|
306
|
+
version: '0'
|
279
307
|
description: This gem allows Rails apps to easily access the API's and login infrastructure
|
280
308
|
of OpenStax Accounts.
|
281
309
|
email:
|
@@ -317,6 +345,8 @@ files:
|
|
317
345
|
- app/representers/openstax/accounts/api/v1/group_nesting_representer.rb
|
318
346
|
- app/representers/openstax/accounts/api/v1/group_representer.rb
|
319
347
|
- app/representers/openstax/accounts/api/v1/group_user_representer.rb
|
348
|
+
- app/representers/openstax/accounts/api/v1/unclaimed_account_representer.rb
|
349
|
+
- app/routines/openstax/accounts/create_temp_account.rb
|
320
350
|
- app/routines/openstax/accounts/dev/create_account.rb
|
321
351
|
- app/routines/openstax/accounts/search_accounts.rb
|
322
352
|
- app/routines/openstax/accounts/search_local_accounts.rb
|
@@ -348,6 +378,7 @@ files:
|
|
348
378
|
- lib/openstax/accounts/has_many_through_groups/active_record/base.rb
|
349
379
|
- lib/openstax/accounts/version.rb
|
350
380
|
- lib/openstax_accounts.rb
|
381
|
+
- spec/cassettes/OpenStax_Accounts_CreateTempAccount/can_create_temp_users.yml
|
351
382
|
- spec/controllers/openstax/accounts/dev/accounts_controller_spec.rb
|
352
383
|
- spec/controllers/openstax/accounts/sessions_controller_spec.rb
|
353
384
|
- spec/dummy/README.md
|
@@ -391,6 +422,7 @@ files:
|
|
391
422
|
- spec/dummy/config/locales/en.yml
|
392
423
|
- spec/dummy/config/routes.rb
|
393
424
|
- spec/dummy/config/secrets.yml
|
425
|
+
- spec/dummy/db/development.sqlite3
|
394
426
|
- spec/dummy/db/migrate/5_create_users.rb
|
395
427
|
- spec/dummy/db/migrate/6_create_ownerships.rb
|
396
428
|
- spec/dummy/db/schema.rb
|
@@ -415,10 +447,12 @@ files:
|
|
415
447
|
- spec/models/openstax/accounts/account_spec.rb
|
416
448
|
- spec/models/openstax/accounts/anonymous_account_spec.rb
|
417
449
|
- spec/models/openstax/accounts/group_spec.rb
|
450
|
+
- spec/routines/openstax/accounts/create_temp_account_spec.rb
|
418
451
|
- spec/routines/openstax/accounts/search_accounts_spec.rb
|
419
452
|
- spec/routines/openstax/accounts/sync_accounts_spec.rb
|
420
453
|
- spec/routines/openstax/accounts/sync_groups_spec.rb
|
421
454
|
- spec/spec_helper.rb
|
455
|
+
- spec/vcr_helper.rb
|
422
456
|
homepage: http://github.com/openstax/accounts-rails
|
423
457
|
licenses: []
|
424
458
|
metadata: {}
|
@@ -443,6 +477,7 @@ signing_key:
|
|
443
477
|
specification_version: 4
|
444
478
|
summary: Rails common code and bindings for the 'accounts' API
|
445
479
|
test_files:
|
480
|
+
- spec/cassettes/OpenStax_Accounts_CreateTempAccount/can_create_temp_users.yml
|
446
481
|
- spec/controllers/openstax/accounts/dev/accounts_controller_spec.rb
|
447
482
|
- spec/controllers/openstax/accounts/sessions_controller_spec.rb
|
448
483
|
- spec/dummy/app/access_policies/account_access_policy.rb
|
@@ -484,6 +519,7 @@ test_files:
|
|
484
519
|
- spec/dummy/config/routes.rb
|
485
520
|
- spec/dummy/config/secrets.yml
|
486
521
|
- spec/dummy/config.ru
|
522
|
+
- spec/dummy/db/development.sqlite3
|
487
523
|
- spec/dummy/db/migrate/5_create_users.rb
|
488
524
|
- spec/dummy/db/migrate/6_create_ownerships.rb
|
489
525
|
- spec/dummy/db/schema.rb
|
@@ -510,7 +546,9 @@ test_files:
|
|
510
546
|
- spec/models/openstax/accounts/account_spec.rb
|
511
547
|
- spec/models/openstax/accounts/anonymous_account_spec.rb
|
512
548
|
- spec/models/openstax/accounts/group_spec.rb
|
549
|
+
- spec/routines/openstax/accounts/create_temp_account_spec.rb
|
513
550
|
- spec/routines/openstax/accounts/search_accounts_spec.rb
|
514
551
|
- spec/routines/openstax/accounts/sync_accounts_spec.rb
|
515
552
|
- spec/routines/openstax/accounts/sync_groups_spec.rb
|
516
553
|
- spec/spec_helper.rb
|
554
|
+
- spec/vcr_helper.rb
|