tests_doc 0.0.3 → 0.0.6

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 (63) hide show
  1. checksums.yaml +5 -5
  2. data/.ruby-version +1 -1
  3. data/CHANGELOG.md +19 -0
  4. data/lib/tests_doc/version.rb +1 -1
  5. data/tests_doc.gemspec +2 -2
  6. metadata +17 -68
  7. data/examples/rails-4.2.5/.gitignore +0 -21
  8. data/examples/rails-4.2.5/.rspec +0 -3
  9. data/examples/rails-4.2.5/Gemfile +0 -35
  10. data/examples/rails-4.2.5/Gemfile.lock +0 -143
  11. data/examples/rails-4.2.5/README.md +0 -3
  12. data/examples/rails-4.2.5/Rakefile +0 -6
  13. data/examples/rails-4.2.5/app/assets/images/.keep +0 -0
  14. data/examples/rails-4.2.5/app/controllers/application_controller.rb +0 -2
  15. data/examples/rails-4.2.5/app/controllers/concerns/.keep +0 -0
  16. data/examples/rails-4.2.5/app/controllers/posts_controller.rb +0 -61
  17. data/examples/rails-4.2.5/app/controllers/users_controller.rb +0 -59
  18. data/examples/rails-4.2.5/app/mailers/.keep +0 -0
  19. data/examples/rails-4.2.5/app/models/.keep +0 -0
  20. data/examples/rails-4.2.5/app/models/concerns/.keep +0 -0
  21. data/examples/rails-4.2.5/app/models/post.rb +0 -3
  22. data/examples/rails-4.2.5/app/models/user.rb +0 -2
  23. data/examples/rails-4.2.5/bin/bundle +0 -3
  24. data/examples/rails-4.2.5/bin/rails +0 -9
  25. data/examples/rails-4.2.5/bin/rake +0 -9
  26. data/examples/rails-4.2.5/bin/setup +0 -29
  27. data/examples/rails-4.2.5/bin/spring +0 -15
  28. data/examples/rails-4.2.5/config/application.rb +0 -26
  29. data/examples/rails-4.2.5/config/boot.rb +0 -3
  30. data/examples/rails-4.2.5/config/database.yml +0 -25
  31. data/examples/rails-4.2.5/config/environment.rb +0 -5
  32. data/examples/rails-4.2.5/config/environments/development.rb +0 -41
  33. data/examples/rails-4.2.5/config/environments/production.rb +0 -79
  34. data/examples/rails-4.2.5/config/environments/test.rb +0 -42
  35. data/examples/rails-4.2.5/config/initializers/filter_parameter_logging.rb +0 -4
  36. data/examples/rails-4.2.5/config/initializers/secret_token.rb +0 -19
  37. data/examples/rails-4.2.5/config/initializers/wrap_parameters.rb +0 -13
  38. data/examples/rails-4.2.5/config/locales/en.yml +0 -23
  39. data/examples/rails-4.2.5/config/routes.rb +0 -60
  40. data/examples/rails-4.2.5/config/secrets.yml +0 -22
  41. data/examples/rails-4.2.5/config.ru +0 -4
  42. data/examples/rails-4.2.5/db/migrate/20151119010359_create_users.rb +0 -11
  43. data/examples/rails-4.2.5/db/migrate/20151119010415_create_posts.rb +0 -11
  44. data/examples/rails-4.2.5/db/schema.rb +0 -34
  45. data/examples/rails-4.2.5/db/seeds.rb +0 -7
  46. data/examples/rails-4.2.5/lib/assets/.keep +0 -0
  47. data/examples/rails-4.2.5/lib/tasks/.keep +0 -0
  48. data/examples/rails-4.2.5/log/.keep +0 -0
  49. data/examples/rails-4.2.5/public/404.html +0 -67
  50. data/examples/rails-4.2.5/public/422.html +0 -67
  51. data/examples/rails-4.2.5/public/500.html +0 -66
  52. data/examples/rails-4.2.5/public/favicon.ico +0 -0
  53. data/examples/rails-4.2.5/public/robots.txt +0 -5
  54. data/examples/rails-4.2.5/spec/rails_helper.rb +0 -62
  55. data/examples/rails-4.2.5/spec/requests/posts_spec.rb +0 -30
  56. data/examples/rails-4.2.5/spec/requests/users_spec.rb +0 -22
  57. data/examples/rails-4.2.5/spec/spec_helper.rb +0 -89
  58. data/examples/rails-4.2.5/tests-doc/README.md +0 -32
  59. data/examples/rails-4.2.5/tests-doc/api/posts/@id.md +0 -29
  60. data/examples/rails-4.2.5/tests-doc/api/posts.md +0 -39
  61. data/examples/rails-4.2.5/tests-doc/api/posts@with-filter.md +0 -40
  62. data/examples/rails-4.2.5/tests-doc/api/users/@id/posts.md +0 -24
  63. data/examples/rails-4.2.5/tests-doc/api/users.md +0 -39
@@ -1,62 +0,0 @@
1
- # This file is copied to spec/ when you run 'rails generate rspec:install'
2
- ENV["RAILS_ENV"] ||= 'test'
3
- require 'spec_helper'
4
-
5
- require File.expand_path("../../config/environment", __FILE__)
6
- require 'rspec/rails'
7
-
8
- require 'tests_doc'
9
-
10
- # Requires supporting ruby files with custom matchers and macros, etc, in
11
- # spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
12
- # run as spec files by default. This means that files in spec/support that end
13
- # in _spec.rb will both be required and run as specs, causing the specs to be
14
- # run twice. It is recommended that you do not name files matching this glob to
15
- # end with _spec.rb. You can configure this pattern with the --pattern
16
- # option on the command line or in ~/.rspec, .rspec or `.rspec-local`.
17
- Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
18
-
19
- # Checks for pending migrations before tests are run.
20
- # If you are not using ActiveRecord, you can remove this line.
21
- ActiveRecord::Migration.maintain_test_schema!
22
-
23
- RSpec.configure do |config|
24
- # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
25
- config.fixture_path = "#{::Rails.root}/spec/fixtures"
26
-
27
- # If you're not using ActiveRecord, or you'd prefer not to run each of your
28
- # examples within a transaction, remove the following line or assign false
29
- # instead of true.
30
- config.use_transactional_fixtures = true
31
-
32
- # RSpec Rails can automatically mix in different behaviours to your tests
33
- # based on their file location, for example enabling you to call `get` and
34
- # `post` in specs under `spec/controllers`.
35
- #
36
- # You can disable this behaviour by removing the line below, and instead
37
- # explicitly tag your specs with their type, e.g.:
38
- #
39
- # RSpec.describe UsersController, :type => :controller do
40
- # # ...
41
- # end
42
- #
43
- # The different available types are documented in the features, such as in
44
- # https://relishapp.com/rspec/rspec-rails/docs
45
- config.infer_spec_type_from_file_location!
46
-
47
- config.include ::TestsDoc::RecordSpecHelper, type: :request
48
-
49
- end
50
-
51
- TestsDoc.configure do |config|
52
- config.changes_whitelist_regexes = [
53
- /\"id\":.*\n/,
54
- /_id\":.*\n/,
55
- /_at\":.*\n/,
56
- /.*_ids":\s\[\s*\w+\s*\]/
57
- ]
58
-
59
- config.add_spec_file_number = true # default: true
60
- config.add_index_timestamps = true # default: true
61
- config.debug = true # default: false
62
- end
@@ -1,30 +0,0 @@
1
- require 'rails_helper'
2
-
3
- RSpec.describe "Posts", :type => :request do
4
- describe "GET /posts" do
5
- it "renders posts" do
6
- recording_api_interaction do
7
- get posts_path
8
- expect(response.status).to be(200)
9
- end
10
- end
11
-
12
- it "renders posts with filter" do
13
- recording_api_interaction do |options|
14
- options.key = 'with-filter'
15
- get posts_path(published: true)
16
- expect(response.status).to be(200)
17
- end
18
- end
19
- end
20
-
21
- describe "GET /posts/:id" do
22
- it "renders posts with id" do
23
- recording_api_interaction do |options|
24
- options.path = 'posts/@id'
25
- get post_path(Post.first)
26
- expect(response.status).to be(200)
27
- end
28
- end
29
- end
30
- end
@@ -1,22 +0,0 @@
1
- require 'rails_helper'
2
-
3
- RSpec.describe "Users", :type => :request do
4
- describe "GET /users" do
5
- it "renders users" do
6
- recording_api_interaction do
7
- get users_path
8
- expect(response.status).to be(200)
9
- end
10
- end
11
- end
12
-
13
- describe "GET /users/:user_id/posts" do
14
- it "renders posts" do
15
- recording_api_interaction do |options|
16
- options.path = 'users/@id/posts'
17
- get user_posts_path(User.first)
18
- expect(response.status).to be(200)
19
- end
20
- end
21
- end
22
- end
@@ -1,89 +0,0 @@
1
- # This file was generated by the `rails generate rspec:install` command. Conventionally, all
2
- # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
3
- # The generated `.rspec` file contains `--require spec_helper` which will cause this
4
- # file to always be loaded, without a need to explicitly require it in any files.
5
- #
6
- # Given that it is always loaded, you are encouraged to keep this file as
7
- # light-weight as possible. Requiring heavyweight dependencies from this file
8
- # will add to the boot time of your test suite on EVERY test run, even for an
9
- # individual file that may not need all of that loaded. Instead, make a
10
- # separate helper file that requires this one and then use it only in the specs
11
- # that actually need it.
12
- #
13
- # The `.rspec` file also contains a few flags that are not defaults but that
14
- # users commonly want.
15
- #
16
- # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
17
- RSpec.configure do |config|
18
- # The settings below are suggested to provide a good initial experience
19
- # with RSpec, but feel free to customize to your heart's content.
20
- =begin
21
- # These two settings work together to allow you to limit a spec run
22
- # to individual examples or groups you care about by tagging them with
23
- # `:focus` metadata. When nothing is tagged with `:focus`, all examples
24
- # get run.
25
- config.filter_run :focus
26
- config.run_all_when_everything_filtered = true
27
-
28
- # Many RSpec users commonly either run the entire suite or an individual
29
- # file, and it's useful to allow more verbose output when running an
30
- # individual spec file.
31
- if config.files_to_run.one?
32
- # Use the documentation formatter for detailed output,
33
- # unless a formatter has already been configured
34
- # (e.g. via a command-line flag).
35
- config.default_formatter = 'doc'
36
- end
37
-
38
- # Print the 10 slowest examples and example groups at the
39
- # end of the spec run, to help surface which specs are running
40
- # particularly slow.
41
- config.profile_examples = 10
42
-
43
- # Run specs in random order to surface order dependencies. If you find an
44
- # order dependency and want to debug it, you can fix the order by providing
45
- # the seed, which is printed after each run.
46
- # --seed 1234
47
- config.order = :random
48
-
49
- # Seed global randomization in this process using the `--seed` CLI option.
50
- # Setting this allows you to use `--seed` to deterministically reproduce
51
- # test failures related to randomization by passing the same `--seed` value
52
- # as the one that triggered the failure.
53
- Kernel.srand config.seed
54
-
55
- # rspec-expectations config goes here. You can use an alternate
56
- # assertion/expectation library such as wrong or the stdlib/minitest
57
- # assertions if you prefer.
58
- config.expect_with :rspec do |expectations|
59
- # Enable only the newer, non-monkey-patching expect syntax.
60
- # For more details, see:
61
- # - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
62
- expectations.syntax = :expect
63
- end
64
-
65
- # rspec-mocks config goes here. You can use an alternate test double
66
- # library (such as bogus or mocha) by changing the `mock_with` option here.
67
- config.mock_with :rspec do |mocks|
68
- # Enable only the newer, non-monkey-patching expect syntax.
69
- # For more details, see:
70
- # - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
71
- mocks.syntax = :expect
72
-
73
- # Prevents you from mocking or stubbing a method that does not exist on
74
- # a real object. This is generally recommended.
75
- mocks.verify_partial_doubles = true
76
- end
77
- =end
78
-
79
- config.after :suite do |test|
80
- # block executed when there is any api interactions were recorded during the rspec
81
- TestsDoc.with_api_interaction do
82
- require 'rake'
83
- require 'tests_doc/tasks'
84
-
85
- Rake::Task["tests_doc:index:build"].invoke(TestsDoc.configuration.root_folder)
86
- end
87
- end
88
-
89
- end
@@ -1,32 +0,0 @@
1
- # Api Interactions
2
-
3
- This document contains a list of api endpoints tested.
4
- If one of the api endpoint is modified during the test suite if its a deletion,
5
- make sure this wont affect any of code consuming the api endpoint.
6
-
7
- Last modified at: 11/20/2015 08:53AM
8
-
9
-
10
- # Endpoints
11
-
12
- ## Api Interactions
13
-
14
- [/README.md](README.md)
15
-
16
- ## GET posts
17
-
18
- [/api/posts.md](api/posts.md)
19
-
20
- [/api/posts@with-filter.md](api/posts@with-filter.md)
21
-
22
- ## GET posts/@id
23
-
24
- [/api/posts/@id.md](api/posts/@id.md)
25
-
26
- ## GET users
27
-
28
- [/api/users.md](api/users.md)
29
-
30
- ## GET users/@id/posts
31
-
32
- [/api/users/@id/posts.md](api/users/@id/posts.md)
@@ -1,29 +0,0 @@
1
- # GET posts/@id
2
-
3
- Rspec description: Posts GET /posts/:id renders posts with id
4
-
5
- [spec/requests/posts_spec.rb:22](/spec/requests/posts_spec.rb#L22)
6
-
7
- # Parameters
8
-
9
- ```json
10
- {
11
- }
12
- ```
13
-
14
- # Response
15
-
16
- ```
17
- HTTP CODE = 200
18
- ```
19
-
20
- ```json
21
- {
22
- "id": 298486374,
23
- "title": "MyString",
24
- "body": "MyText",
25
- "user_id": null,
26
- "created_at": "2015-11-19T01:11:08.000Z",
27
- "updated_at": "2015-11-19T01:11:08.000Z"
28
- }
29
- ```
@@ -1,39 +0,0 @@
1
- # GET posts
2
-
3
- Rspec description: Posts GET /posts renders posts
4
-
5
- [spec/requests/posts_spec.rb:5](/spec/requests/posts_spec.rb#L5)
6
-
7
- # Parameters
8
-
9
- ```json
10
- {
11
- }
12
- ```
13
-
14
- # Response
15
-
16
- ```
17
- HTTP CODE = 200
18
- ```
19
-
20
- ```json
21
- [
22
- {
23
- "id": 298486374,
24
- "title": "MyString",
25
- "body": "MyText",
26
- "user_id": null,
27
- "created_at": "2015-11-19T01:11:08.000Z",
28
- "updated_at": "2015-11-19T01:11:08.000Z"
29
- },
30
- {
31
- "id": 980190962,
32
- "title": "MyString",
33
- "body": "MyText",
34
- "user_id": null,
35
- "created_at": "2015-11-19T01:11:08.000Z",
36
- "updated_at": "2015-11-19T01:11:08.000Z"
37
- }
38
- ]
39
- ```
@@ -1,40 +0,0 @@
1
- # GET posts
2
-
3
- Rspec description: Posts GET /posts renders posts with filter
4
-
5
- [spec/requests/posts_spec.rb:12](/spec/requests/posts_spec.rb#L12)
6
-
7
- # Parameters
8
-
9
- ```json
10
- {
11
- "published": "true"
12
- }
13
- ```
14
-
15
- # Response
16
-
17
- ```
18
- HTTP CODE = 200
19
- ```
20
-
21
- ```json
22
- [
23
- {
24
- "id": 298486374,
25
- "title": "MyString",
26
- "body": "MyText",
27
- "user_id": null,
28
- "created_at": "2015-11-19T01:11:08.000Z",
29
- "updated_at": "2015-11-19T01:11:08.000Z"
30
- },
31
- {
32
- "id": 980190962,
33
- "title": "MyString",
34
- "body": "MyText",
35
- "user_id": null,
36
- "created_at": "2015-11-19T01:11:08.000Z",
37
- "updated_at": "2015-11-19T01:11:08.000Z"
38
- }
39
- ]
40
- ```
@@ -1,24 +0,0 @@
1
- # GET users/@id/posts
2
-
3
- Rspec description: Users GET /users/:user_id/posts renders posts
4
-
5
- [spec/requests/users_spec.rb:14](/spec/requests/users_spec.rb#L14)
6
-
7
- # Parameters
8
-
9
- ```json
10
- {
11
- }
12
- ```
13
-
14
- # Response
15
-
16
- ```
17
- HTTP CODE = 200
18
- ```
19
-
20
- ```json
21
- [
22
-
23
- ]
24
- ```
@@ -1,39 +0,0 @@
1
- # GET users
2
-
3
- Rspec description: Users GET /users renders users
4
-
5
- [spec/requests/users_spec.rb:5](/spec/requests/users_spec.rb#L5)
6
-
7
- # Parameters
8
-
9
- ```json
10
- {
11
- }
12
- ```
13
-
14
- # Response
15
-
16
- ```
17
- HTTP CODE = 200
18
- ```
19
-
20
- ```json
21
- [
22
- {
23
- "id": 298486374,
24
- "email": "MyString",
25
- "first_name": "MyString",
26
- "last_name": "MyString",
27
- "created_at": "2015-11-19T01:11:08.000Z",
28
- "updated_at": "2015-11-19T01:11:08.000Z"
29
- },
30
- {
31
- "id": 980190962,
32
- "email": "MyString",
33
- "first_name": "MyString",
34
- "last_name": "MyString",
35
- "created_at": "2015-11-19T01:11:08.000Z",
36
- "updated_at": "2015-11-19T01:11:08.000Z"
37
- }
38
- ]
39
- ```