approval 0.3.2 → 0.3.3

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 (87) hide show
  1. checksums.yaml +4 -4
  2. data/config/locales/en.yml +21 -0
  3. data/config/locales/ja.yml +21 -0
  4. data/lib/approval/version.rb +1 -1
  5. metadata +5 -166
  6. data/Rakefile +0 -12
  7. data/spec/lib/config_spec.rb +0 -10
  8. data/spec/lib/version_spec.rb +0 -7
  9. data/spec/models/book_spec.rb +0 -30
  10. data/spec/models/comment_spec.rb +0 -9
  11. data/spec/models/item_spec.rb +0 -114
  12. data/spec/models/request_form/base_spec.rb +0 -54
  13. data/spec/models/request_form/create_spec.rb +0 -23
  14. data/spec/models/request_form/destroy_spec.rb +0 -23
  15. data/spec/models/request_form/update_spec.rb +0 -33
  16. data/spec/models/request_form_spec.rb +0 -4
  17. data/spec/models/request_spec.rb +0 -39
  18. data/spec/models/respond_form/approve_spec.rb +0 -4
  19. data/spec/models/respond_form/base_spec.rb +0 -84
  20. data/spec/models/respond_form/cancel_spec.rb +0 -4
  21. data/spec/models/respond_form/reject_spec.rb +0 -4
  22. data/spec/models/respond_form_spec.rb +0 -4
  23. data/spec/models/user_spec.rb +0 -48
  24. data/spec/rails/rails-5.1.2/README.md +0 -24
  25. data/spec/rails/rails-5.1.2/Rakefile +0 -6
  26. data/spec/rails/rails-5.1.2/app/assets/config/manifest.js +0 -3
  27. data/spec/rails/rails-5.1.2/app/assets/javascripts/application.js +0 -15
  28. data/spec/rails/rails-5.1.2/app/assets/javascripts/cable.js +0 -13
  29. data/spec/rails/rails-5.1.2/app/assets/stylesheets/application.css +0 -15
  30. data/spec/rails/rails-5.1.2/app/channels/application_cable/channel.rb +0 -4
  31. data/spec/rails/rails-5.1.2/app/channels/application_cable/connection.rb +0 -4
  32. data/spec/rails/rails-5.1.2/app/controllers/application_controller.rb +0 -3
  33. data/spec/rails/rails-5.1.2/app/helpers/application_helper.rb +0 -2
  34. data/spec/rails/rails-5.1.2/app/jobs/application_job.rb +0 -2
  35. data/spec/rails/rails-5.1.2/app/mailers/application_mailer.rb +0 -4
  36. data/spec/rails/rails-5.1.2/app/models/application_record.rb +0 -3
  37. data/spec/rails/rails-5.1.2/app/models/book.rb +0 -3
  38. data/spec/rails/rails-5.1.2/app/models/user.rb +0 -2
  39. data/spec/rails/rails-5.1.2/app/views/layouts/application.html.erb +0 -14
  40. data/spec/rails/rails-5.1.2/app/views/layouts/mailer.html.erb +0 -13
  41. data/spec/rails/rails-5.1.2/app/views/layouts/mailer.text.erb +0 -1
  42. data/spec/rails/rails-5.1.2/bin/bundle +0 -3
  43. data/spec/rails/rails-5.1.2/bin/rails +0 -4
  44. data/spec/rails/rails-5.1.2/bin/rake +0 -4
  45. data/spec/rails/rails-5.1.2/bin/setup +0 -38
  46. data/spec/rails/rails-5.1.2/bin/update +0 -29
  47. data/spec/rails/rails-5.1.2/bin/yarn +0 -11
  48. data/spec/rails/rails-5.1.2/config/application.rb +0 -31
  49. data/spec/rails/rails-5.1.2/config/boot.rb +0 -3
  50. data/spec/rails/rails-5.1.2/config/cable.yml +0 -10
  51. data/spec/rails/rails-5.1.2/config/database.yml +0 -25
  52. data/spec/rails/rails-5.1.2/config/environment.rb +0 -8
  53. data/spec/rails/rails-5.1.2/config/environments/development.rb +0 -47
  54. data/spec/rails/rails-5.1.2/config/environments/production.rb +0 -83
  55. data/spec/rails/rails-5.1.2/config/environments/test.rb +0 -42
  56. data/spec/rails/rails-5.1.2/config/initializers/application_controller_renderer.rb +0 -6
  57. data/spec/rails/rails-5.1.2/config/initializers/approval.rb +0 -10
  58. data/spec/rails/rails-5.1.2/config/initializers/backtrace_silencers.rb +0 -7
  59. data/spec/rails/rails-5.1.2/config/initializers/cookies_serializer.rb +0 -5
  60. data/spec/rails/rails-5.1.2/config/initializers/filter_parameter_logging.rb +0 -4
  61. data/spec/rails/rails-5.1.2/config/initializers/inflections.rb +0 -16
  62. data/spec/rails/rails-5.1.2/config/initializers/mime_types.rb +0 -4
  63. data/spec/rails/rails-5.1.2/config/initializers/wrap_parameters.rb +0 -14
  64. data/spec/rails/rails-5.1.2/config/locales/en.yml +0 -33
  65. data/spec/rails/rails-5.1.2/config/puma.rb +0 -56
  66. data/spec/rails/rails-5.1.2/config/routes.rb +0 -3
  67. data/spec/rails/rails-5.1.2/config/secrets.yml +0 -32
  68. data/spec/rails/rails-5.1.2/config.ru +0 -5
  69. data/spec/rails/rails-5.1.2/db/migrate/20170816102906_create_approval_requests.rb +0 -19
  70. data/spec/rails/rails-5.1.2/db/migrate/20170816102907_create_approval_comments.rb +0 -14
  71. data/spec/rails/rails-5.1.2/db/migrate/20170816102908_create_approval_items.rb +0 -17
  72. data/spec/rails/rails-5.1.2/db/migrate/20170816102909_create_users.rb +0 -9
  73. data/spec/rails/rails-5.1.2/db/migrate/20170816102910_create_books.rb +0 -9
  74. data/spec/rails/rails-5.1.2/db/schema.rb +0 -64
  75. data/spec/rails/rails-5.1.2/db/seeds.rb +0 -7
  76. data/spec/rails/rails-5.1.2/db/test.sqlite3 +0 -0
  77. data/spec/rails/rails-5.1.2/log/test.log +0 -695
  78. data/spec/rails/rails-5.1.2/package.json +0 -5
  79. data/spec/rails/rails-5.1.2/public/404.html +0 -67
  80. data/spec/rails/rails-5.1.2/public/422.html +0 -67
  81. data/spec/rails/rails-5.1.2/public/500.html +0 -66
  82. data/spec/rails/rails-5.1.2/public/apple-touch-icon-precomposed.png +0 -0
  83. data/spec/rails/rails-5.1.2/public/apple-touch-icon.png +0 -0
  84. data/spec/rails/rails-5.1.2/public/favicon.ico +0 -0
  85. data/spec/rails/rails-5.1.2/public/robots.txt +0 -1
  86. data/spec/spec_helper.rb +0 -117
  87. data/spec/support/rails_template.rb +0 -23
@@ -1,5 +0,0 @@
1
- {
2
- "name": "rails-5_1_2",
3
- "private": true,
4
- "dependencies": {}
5
- }
@@ -1,67 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>The page you were looking for doesn't exist (404)</title>
5
- <meta name="viewport" content="width=device-width,initial-scale=1">
6
- <style>
7
- .rails-default-error-page {
8
- background-color: #EFEFEF;
9
- color: #2E2F30;
10
- text-align: center;
11
- font-family: arial, sans-serif;
12
- margin: 0;
13
- }
14
-
15
- .rails-default-error-page div.dialog {
16
- width: 95%;
17
- max-width: 33em;
18
- margin: 4em auto 0;
19
- }
20
-
21
- .rails-default-error-page div.dialog > div {
22
- border: 1px solid #CCC;
23
- border-right-color: #999;
24
- border-left-color: #999;
25
- border-bottom-color: #BBB;
26
- border-top: #B00100 solid 4px;
27
- border-top-left-radius: 9px;
28
- border-top-right-radius: 9px;
29
- background-color: white;
30
- padding: 7px 12% 0;
31
- box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
- }
33
-
34
- .rails-default-error-page h1 {
35
- font-size: 100%;
36
- color: #730E15;
37
- line-height: 1.5em;
38
- }
39
-
40
- .rails-default-error-page div.dialog > p {
41
- margin: 0 0 1em;
42
- padding: 1em;
43
- background-color: #F7F7F7;
44
- border: 1px solid #CCC;
45
- border-right-color: #999;
46
- border-left-color: #999;
47
- border-bottom-color: #999;
48
- border-bottom-left-radius: 4px;
49
- border-bottom-right-radius: 4px;
50
- border-top-color: #DADADA;
51
- color: #666;
52
- box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
- }
54
- </style>
55
- </head>
56
-
57
- <body class="rails-default-error-page">
58
- <!-- This file lives in public/404.html -->
59
- <div class="dialog">
60
- <div>
61
- <h1>The page you were looking for doesn't exist.</h1>
62
- <p>You may have mistyped the address or the page may have moved.</p>
63
- </div>
64
- <p>If you are the application owner check the logs for more information.</p>
65
- </div>
66
- </body>
67
- </html>
@@ -1,67 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>The change you wanted was rejected (422)</title>
5
- <meta name="viewport" content="width=device-width,initial-scale=1">
6
- <style>
7
- .rails-default-error-page {
8
- background-color: #EFEFEF;
9
- color: #2E2F30;
10
- text-align: center;
11
- font-family: arial, sans-serif;
12
- margin: 0;
13
- }
14
-
15
- .rails-default-error-page div.dialog {
16
- width: 95%;
17
- max-width: 33em;
18
- margin: 4em auto 0;
19
- }
20
-
21
- .rails-default-error-page div.dialog > div {
22
- border: 1px solid #CCC;
23
- border-right-color: #999;
24
- border-left-color: #999;
25
- border-bottom-color: #BBB;
26
- border-top: #B00100 solid 4px;
27
- border-top-left-radius: 9px;
28
- border-top-right-radius: 9px;
29
- background-color: white;
30
- padding: 7px 12% 0;
31
- box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
- }
33
-
34
- .rails-default-error-page h1 {
35
- font-size: 100%;
36
- color: #730E15;
37
- line-height: 1.5em;
38
- }
39
-
40
- .rails-default-error-page div.dialog > p {
41
- margin: 0 0 1em;
42
- padding: 1em;
43
- background-color: #F7F7F7;
44
- border: 1px solid #CCC;
45
- border-right-color: #999;
46
- border-left-color: #999;
47
- border-bottom-color: #999;
48
- border-bottom-left-radius: 4px;
49
- border-bottom-right-radius: 4px;
50
- border-top-color: #DADADA;
51
- color: #666;
52
- box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
- }
54
- </style>
55
- </head>
56
-
57
- <body class="rails-default-error-page">
58
- <!-- This file lives in public/422.html -->
59
- <div class="dialog">
60
- <div>
61
- <h1>The change you wanted was rejected.</h1>
62
- <p>Maybe you tried to change something you didn't have access to.</p>
63
- </div>
64
- <p>If you are the application owner check the logs for more information.</p>
65
- </div>
66
- </body>
67
- </html>
@@ -1,66 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>We're sorry, but something went wrong (500)</title>
5
- <meta name="viewport" content="width=device-width,initial-scale=1">
6
- <style>
7
- .rails-default-error-page {
8
- background-color: #EFEFEF;
9
- color: #2E2F30;
10
- text-align: center;
11
- font-family: arial, sans-serif;
12
- margin: 0;
13
- }
14
-
15
- .rails-default-error-page div.dialog {
16
- width: 95%;
17
- max-width: 33em;
18
- margin: 4em auto 0;
19
- }
20
-
21
- .rails-default-error-page div.dialog > div {
22
- border: 1px solid #CCC;
23
- border-right-color: #999;
24
- border-left-color: #999;
25
- border-bottom-color: #BBB;
26
- border-top: #B00100 solid 4px;
27
- border-top-left-radius: 9px;
28
- border-top-right-radius: 9px;
29
- background-color: white;
30
- padding: 7px 12% 0;
31
- box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
- }
33
-
34
- .rails-default-error-page h1 {
35
- font-size: 100%;
36
- color: #730E15;
37
- line-height: 1.5em;
38
- }
39
-
40
- .rails-default-error-page div.dialog > p {
41
- margin: 0 0 1em;
42
- padding: 1em;
43
- background-color: #F7F7F7;
44
- border: 1px solid #CCC;
45
- border-right-color: #999;
46
- border-left-color: #999;
47
- border-bottom-color: #999;
48
- border-bottom-left-radius: 4px;
49
- border-bottom-right-radius: 4px;
50
- border-top-color: #DADADA;
51
- color: #666;
52
- box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
- }
54
- </style>
55
- </head>
56
-
57
- <body class="rails-default-error-page">
58
- <!-- This file lives in public/500.html -->
59
- <div class="dialog">
60
- <div>
61
- <h1>We're sorry, but something went wrong.</h1>
62
- </div>
63
- <p>If you are the application owner check the logs for more information.</p>
64
- </div>
65
- </body>
66
- </html>
File without changes
File without changes
@@ -1 +0,0 @@
1
- # See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file
data/spec/spec_helper.rb DELETED
@@ -1,117 +0,0 @@
1
- $LOAD_PATH.unshift(File.dirname(__FILE__))
2
- $LOAD_PATH << File.expand_path("support", __dir__)
3
-
4
- ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
5
- require "bundler/setup"
6
-
7
- ENV["RAILS_ENV"] ||= "test"
8
-
9
- require "rails"
10
-
11
- ENV["RAILS"] = Rails.version
12
- ENV["RAILS_ROOT"] = File.expand_path("../rails/rails-#{ENV["RAILS"]}", __FILE__)
13
-
14
- # Create the test app if it doesn't exists
15
- system "rake setup" unless File.exist?(ENV["RAILS_ROOT"])
16
-
17
- # load test app
18
- require ENV["RAILS_ROOT"] + "/config/environment.rb"
19
-
20
- # load RSpec
21
- require "rspec/rails"
22
-
23
- RSpec.configure do |config|
24
- config.include FactoryGirl::Syntax::Methods
25
-
26
- config.expect_with :rspec do |expectations|
27
- expectations.syntax = [:should, :expect]
28
- end
29
-
30
- config.mock_with :rspec do |mocks|
31
- mocks.syntax = [:should, :expect]
32
- end
33
-
34
- config.order = :random
35
- config.use_transactional_fixtures = true
36
- end
37
-
38
- FactoryGirl.define do
39
- factory :user do
40
- sequence(:name) { |n| "name#{n}" }
41
- end
42
-
43
- factory :book do
44
- sequence(:name) { |n| "name#{n}" }
45
- end
46
-
47
- factory :request, class: "Approval::Request" do
48
- association :request_user, factory: :user
49
-
50
- trait :pending do
51
- state { :pending }
52
- end
53
-
54
- trait :cancelled do
55
- state { :cancelled }
56
- requested_at { Time.current }
57
- cancelled_at { Time.current }
58
- end
59
-
60
- trait :approved do
61
- association :respond_user, factory: :user
62
- state { :approved }
63
- requested_at { Time.current }
64
- approved_at { Time.current }
65
- end
66
-
67
- trait :rejected do
68
- association :respond_user, factory: :user
69
- state { :rejected }
70
- requested_at { Time.current }
71
- rejected_at { Time.current }
72
- end
73
- end
74
-
75
- factory :comment, class: "Approval::Comment" do
76
- sequence(:content) { |n| "content#{n}" }
77
- request_id 1
78
- end
79
-
80
- factory :item, class: "Approval::Item" do
81
- request_id 1
82
-
83
- trait :create do
84
- event { "create" }
85
- resource_type { "Book" }
86
- params { { name: "created_name" } }
87
- end
88
-
89
- trait :update do
90
- after(:build) do |item|
91
- book = create(:book)
92
- item.resource_id = book.id
93
- item.params = { name: "updated_name" }
94
- end
95
-
96
- event { "update" }
97
- resource_type { "Book" }
98
- end
99
-
100
- trait :destroy do
101
- after(:build) do |item|
102
- book = create(:book)
103
- item.resource_id = book.id
104
- end
105
-
106
- event { "destroy" }
107
- resource_type { "Book" }
108
- end
109
- end
110
- end
111
-
112
- Shoulda::Matchers.configure do |config|
113
- config.integrate do |with|
114
- with.test_framework :rspec
115
- with.library :rails
116
- end
117
- end
@@ -1,23 +0,0 @@
1
- rails_major_version = Rails::VERSION::STRING[0].to_i
2
-
3
- # Add our local pubsub_notifier to the load path
4
- inject_into_file "config/environment.rb",
5
- "\n$LOAD_PATH.unshift('#{File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "lib"))}')\nrequire \"approval\"\n",
6
- after: (rails_major_version >= 5) ? "require_relative 'application'" : "require File.expand_path('../application', __FILE__)"
7
-
8
- run "rm Gemfile"
9
-
10
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
11
-
12
- # Install
13
- generate :'approval:install'
14
-
15
- # Generate ActiveRecord Models
16
- generate :model, "User name:string"
17
-
18
- generate :model, "Book name:string"
19
- inject_into_file "app/models/book.rb", " acts_as_approval_resource\n", before: "end"
20
-
21
- run "rm -r spec"
22
-
23
- rake "db:migrate"