qa 0.2.1 → 0.3.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.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +32 -13
  3. data/lib/generators/qa/install/USAGE +2 -0
  4. data/lib/generators/qa/install/install_generator.rb +2 -1
  5. data/lib/generators/qa/local/USAGE +5 -0
  6. data/lib/generators/qa/local/local_generator.rb +9 -0
  7. data/lib/generators/qa/local/templates/config/authorities.yml +1 -0
  8. data/lib/generators/qa/local/templates/config/authorities/states.yml +101 -0
  9. data/lib/qa/authorities/local.rb +3 -1
  10. data/lib/qa/version.rb +1 -1
  11. data/spec/controllers/terms_controller_spec.rb +13 -3
  12. data/spec/internal/Gemfile +11 -16
  13. data/spec/internal/Gemfile.lock +51 -44
  14. data/spec/internal/Rakefile +1 -1
  15. data/spec/internal/app/assets/stylesheets/application.css +5 -3
  16. data/spec/internal/app/views/layouts/application.html.erb +2 -2
  17. data/spec/internal/bin/rails +4 -0
  18. data/spec/internal/bin/rake +4 -0
  19. data/spec/internal/bin/spring +18 -0
  20. data/spec/internal/config/authorities.yml +1 -0
  21. data/spec/internal/config/authorities/authority_A.yml +10 -0
  22. data/spec/internal/config/authorities/authority_B.yml +7 -0
  23. data/spec/internal/config/authorities/authority_C.yml +4 -0
  24. data/spec/internal/config/authorities/authority_D.yml +4 -0
  25. data/spec/internal/config/authorities/states.yml +101 -0
  26. data/spec/internal/config/database.yml +8 -8
  27. data/spec/internal/config/environment.rb +1 -1
  28. data/spec/internal/config/environments/development.rb +10 -2
  29. data/spec/internal/config/environments/production.rb +6 -3
  30. data/spec/internal/config/environments/test.rb +5 -2
  31. data/spec/internal/config/initializers/cookies_serializer.rb +3 -0
  32. data/spec/internal/config/initializers/mime_types.rb +0 -1
  33. data/spec/internal/config/initializers/session_store.rb +1 -1
  34. data/spec/internal/config/routes.rb +1 -1
  35. data/spec/internal/config/secrets.yml +22 -0
  36. data/spec/internal/db/development.sqlite3 +0 -0
  37. data/spec/internal/db/migrate/{20140611161143_create_qa_subject_mesh_terms.qa.rb → 20140620210534_create_qa_subject_mesh_terms.qa.rb} +0 -0
  38. data/spec/internal/db/migrate/{20140611161144_create_qa_mesh_tree.qa.rb → 20140620210535_create_qa_mesh_tree.qa.rb} +0 -0
  39. data/spec/internal/db/migrate/{20140611161145_add_term_lower_to_qa_subject_mesh_terms.qa.rb → 20140620210536_add_term_lower_to_qa_subject_mesh_terms.qa.rb} +0 -0
  40. data/spec/internal/db/schema.rb +1 -1
  41. data/spec/internal/db/test.sqlite3 +0 -0
  42. data/spec/internal/lib/generators/test_app_generator.rb +9 -1
  43. data/spec/internal/log/development.log +339 -206
  44. data/spec/internal/public/404.html +20 -11
  45. data/spec/internal/public/422.html +20 -11
  46. data/spec/internal/public/500.html +19 -10
  47. data/spec/internal/test/test_helper.rb +1 -3
  48. data/spec/lib/authorities_local_spec.rb +0 -4
  49. data/spec/spec_helper.rb +0 -4
  50. data/spec/test_app_templates/lib/generators/test_app_generator.rb +9 -1
  51. metadata +40 -14
  52. data/spec/internal/config/initializers/secret_token.rb +0 -12
@@ -2,17 +2,23 @@
2
2
  <html>
3
3
  <head>
4
4
  <title>The page you were looking for doesn't exist (404)</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
5
6
  <style>
6
7
  body {
7
8
  background-color: #EFEFEF;
8
9
  color: #2E2F30;
9
10
  text-align: center;
10
11
  font-family: arial, sans-serif;
12
+ margin: 0;
11
13
  }
12
14
 
13
15
  div.dialog {
14
- width: 25em;
15
- margin: 4em auto 0 auto;
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ div.dialog > div {
16
22
  border: 1px solid #CCC;
17
23
  border-right-color: #999;
18
24
  border-left-color: #999;
@@ -21,7 +27,8 @@
21
27
  border-top-left-radius: 9px;
22
28
  border-top-right-radius: 9px;
23
29
  background-color: white;
24
- padding: 7px 4em 0 4em;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
25
32
  }
26
33
 
27
34
  h1 {
@@ -30,19 +37,19 @@
30
37
  line-height: 1.5em;
31
38
  }
32
39
 
33
- body > p {
34
- width: 33em;
35
- margin: 0 auto 1em;
36
- padding: 1em 0;
40
+ div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
37
43
  background-color: #F7F7F7;
38
44
  border: 1px solid #CCC;
39
45
  border-right-color: #999;
46
+ border-left-color: #999;
40
47
  border-bottom-color: #999;
41
48
  border-bottom-left-radius: 4px;
42
49
  border-bottom-right-radius: 4px;
43
50
  border-top-color: #DADADA;
44
51
  color: #666;
45
- box-shadow:0 3px 8px rgba(50, 50, 50, 0.17);
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
46
53
  }
47
54
  </style>
48
55
  </head>
@@ -50,9 +57,11 @@
50
57
  <body>
51
58
  <!-- This file lives in public/404.html -->
52
59
  <div class="dialog">
53
- <h1>The page you were looking for doesn't exist.</h1>
54
- <p>You may have mistyped the address or the page may have moved.</p>
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>
55
65
  </div>
56
- <p>If you are the application owner check the logs for more information.</p>
57
66
  </body>
58
67
  </html>
@@ -2,17 +2,23 @@
2
2
  <html>
3
3
  <head>
4
4
  <title>The change you wanted was rejected (422)</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
5
6
  <style>
6
7
  body {
7
8
  background-color: #EFEFEF;
8
9
  color: #2E2F30;
9
10
  text-align: center;
10
11
  font-family: arial, sans-serif;
12
+ margin: 0;
11
13
  }
12
14
 
13
15
  div.dialog {
14
- width: 25em;
15
- margin: 4em auto 0 auto;
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ div.dialog > div {
16
22
  border: 1px solid #CCC;
17
23
  border-right-color: #999;
18
24
  border-left-color: #999;
@@ -21,7 +27,8 @@
21
27
  border-top-left-radius: 9px;
22
28
  border-top-right-radius: 9px;
23
29
  background-color: white;
24
- padding: 7px 4em 0 4em;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
25
32
  }
26
33
 
27
34
  h1 {
@@ -30,19 +37,19 @@
30
37
  line-height: 1.5em;
31
38
  }
32
39
 
33
- body > p {
34
- width: 33em;
35
- margin: 0 auto 1em;
36
- padding: 1em 0;
40
+ div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
37
43
  background-color: #F7F7F7;
38
44
  border: 1px solid #CCC;
39
45
  border-right-color: #999;
46
+ border-left-color: #999;
40
47
  border-bottom-color: #999;
41
48
  border-bottom-left-radius: 4px;
42
49
  border-bottom-right-radius: 4px;
43
50
  border-top-color: #DADADA;
44
51
  color: #666;
45
- box-shadow:0 3px 8px rgba(50, 50, 50, 0.17);
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
46
53
  }
47
54
  </style>
48
55
  </head>
@@ -50,9 +57,11 @@
50
57
  <body>
51
58
  <!-- This file lives in public/422.html -->
52
59
  <div class="dialog">
53
- <h1>The change you wanted was rejected.</h1>
54
- <p>Maybe you tried to change something you didn't have access to.</p>
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>
55
65
  </div>
56
- <p>If you are the application owner check the logs for more information.</p>
57
66
  </body>
58
67
  </html>
@@ -2,17 +2,23 @@
2
2
  <html>
3
3
  <head>
4
4
  <title>We're sorry, but something went wrong (500)</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
5
6
  <style>
6
7
  body {
7
8
  background-color: #EFEFEF;
8
9
  color: #2E2F30;
9
10
  text-align: center;
10
11
  font-family: arial, sans-serif;
12
+ margin: 0;
11
13
  }
12
14
 
13
15
  div.dialog {
14
- width: 25em;
15
- margin: 4em auto 0 auto;
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ div.dialog > div {
16
22
  border: 1px solid #CCC;
17
23
  border-right-color: #999;
18
24
  border-left-color: #999;
@@ -21,7 +27,8 @@
21
27
  border-top-left-radius: 9px;
22
28
  border-top-right-radius: 9px;
23
29
  background-color: white;
24
- padding: 7px 4em 0 4em;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
25
32
  }
26
33
 
27
34
  h1 {
@@ -30,19 +37,19 @@
30
37
  line-height: 1.5em;
31
38
  }
32
39
 
33
- body > p {
34
- width: 33em;
35
- margin: 0 auto 1em;
36
- padding: 1em 0;
40
+ div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
37
43
  background-color: #F7F7F7;
38
44
  border: 1px solid #CCC;
39
45
  border-right-color: #999;
46
+ border-left-color: #999;
40
47
  border-bottom-color: #999;
41
48
  border-bottom-left-radius: 4px;
42
49
  border-bottom-right-radius: 4px;
43
50
  border-top-color: #DADADA;
44
51
  color: #666;
45
- box-shadow:0 3px 8px rgba(50, 50, 50, 0.17);
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
46
53
  }
47
54
  </style>
48
55
  </head>
@@ -50,8 +57,10 @@
50
57
  <body>
51
58
  <!-- This file lives in public/500.html -->
52
59
  <div class="dialog">
53
- <h1>We're sorry, but something went wrong.</h1>
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>
54
64
  </div>
55
- <p>If you are the application owner check the logs for more information.</p>
56
65
  </body>
57
66
  </html>
@@ -1,10 +1,8 @@
1
- ENV["RAILS_ENV"] ||= "test"
1
+ ENV['RAILS_ENV'] ||= 'test'
2
2
  require File.expand_path('../../config/environment', __FILE__)
3
3
  require 'rails/test_help'
4
4
 
5
5
  class ActiveSupport::TestCase
6
- ActiveRecord::Migration.check_pending!
7
-
8
6
  # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
9
7
  #
10
8
  # Note: You'll currently still have to declare fixtures explicitly in integration tests
@@ -2,10 +2,6 @@ require 'spec_helper'
2
2
 
3
3
  describe Qa::Authorities::Local do
4
4
 
5
- before do
6
- AUTHORITIES_CONFIG[:local_path] = local_authorities_path
7
- end
8
-
9
5
  context "valid local sub_authorities" do
10
6
  it "should validate the sub_authority" do
11
7
  Qa::Authorities::Local.sub_authorities.should include "authority_A"
data/spec/spec_helper.rb CHANGED
@@ -59,10 +59,6 @@ def webmock_fixture fixture
59
59
  File.new File.expand_path(File.join("../fixtures", fixture), __FILE__)
60
60
  end
61
61
 
62
- def local_authorities_path
63
- File.expand_path(File.join("../fixtures/authorities"), __FILE__)
64
- end
65
-
66
62
  # returns the file contents
67
63
  def load_fixture_file(fname)
68
64
  File.open(Rails.root.join("spec/fixtures", fname)) do |f|
@@ -1,7 +1,7 @@
1
1
  require 'rails/generators'
2
2
 
3
3
  class TestAppGenerator < Rails::Generators::Base
4
- source_root "./spec/test_app_templates"
4
+ source_root Rails.root
5
5
 
6
6
  def update_app
7
7
  Bundler.with_clean_env do
@@ -13,6 +13,14 @@ class TestAppGenerator < Rails::Generators::Base
13
13
  generate "qa:install"
14
14
  end
15
15
 
16
+ def run_local_authority_installer
17
+ generate "qa:local"
18
+ end
19
+
20
+ def copy_local_authority_fixtures
21
+ directory "../fixtures/authorities", "config/authorities"
22
+ end
23
+
16
24
  def run_migrations
17
25
  rake "qa:install:migrations"
18
26
  rake "db:migrate"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen Anderson
@@ -15,22 +15,28 @@ authors:
15
15
  autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
- date: 2014-06-11 00:00:00.000000000 Z
18
+ date: 2014-06-20 00:00:00.000000000 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: rails
22
22
  requirement: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 3.2.13
27
+ - - "<"
25
28
  - !ruby/object:Gem::Version
26
- version: 4.0.0
29
+ version: '5.0'
27
30
  type: :runtime
28
31
  prerelease: false
29
32
  version_requirements: !ruby/object:Gem::Requirement
30
33
  requirements:
31
- - - "~>"
34
+ - - ">="
35
+ - !ruby/object:Gem::Version
36
+ version: 3.2.13
37
+ - - "<"
32
38
  - !ruby/object:Gem::Version
33
- version: 4.0.0
39
+ version: '5.0'
34
40
  - !ruby/object:Gem::Dependency
35
41
  name: rest-client
36
42
  requirement: !ruby/object:Gem::Requirement
@@ -187,6 +193,10 @@ files:
187
193
  - lib/generators/qa/install/USAGE
188
194
  - lib/generators/qa/install/install_generator.rb
189
195
  - lib/generators/qa/install/templates/config/oclcts-authorities.yml
196
+ - lib/generators/qa/local/USAGE
197
+ - lib/generators/qa/local/local_generator.rb
198
+ - lib/generators/qa/local/templates/config/authorities.yml
199
+ - lib/generators/qa/local/templates/config/authorities/states.yml
190
200
  - lib/qa.rb
191
201
  - lib/qa/authorities.rb
192
202
  - lib/qa/authorities/base.rb
@@ -229,8 +239,15 @@ files:
229
239
  - spec/internal/bin/bundle
230
240
  - spec/internal/bin/rails
231
241
  - spec/internal/bin/rake
242
+ - spec/internal/bin/spring
232
243
  - spec/internal/config.ru
233
244
  - spec/internal/config/application.rb
245
+ - spec/internal/config/authorities.yml
246
+ - spec/internal/config/authorities/authority_A.yml
247
+ - spec/internal/config/authorities/authority_B.yml
248
+ - spec/internal/config/authorities/authority_C.yml
249
+ - spec/internal/config/authorities/authority_D.yml
250
+ - spec/internal/config/authorities/states.yml
234
251
  - spec/internal/config/boot.rb
235
252
  - spec/internal/config/database.yml
236
253
  - spec/internal/config/environment.rb
@@ -238,19 +255,20 @@ files:
238
255
  - spec/internal/config/environments/production.rb
239
256
  - spec/internal/config/environments/test.rb
240
257
  - spec/internal/config/initializers/backtrace_silencers.rb
258
+ - spec/internal/config/initializers/cookies_serializer.rb
241
259
  - spec/internal/config/initializers/filter_parameter_logging.rb
242
260
  - spec/internal/config/initializers/inflections.rb
243
261
  - spec/internal/config/initializers/mime_types.rb
244
- - spec/internal/config/initializers/secret_token.rb
245
262
  - spec/internal/config/initializers/session_store.rb
246
263
  - spec/internal/config/initializers/wrap_parameters.rb
247
264
  - spec/internal/config/locales/en.yml
248
265
  - spec/internal/config/oclcts-authorities.yml
249
266
  - spec/internal/config/routes.rb
267
+ - spec/internal/config/secrets.yml
250
268
  - spec/internal/db/development.sqlite3
251
- - spec/internal/db/migrate/20140611161143_create_qa_subject_mesh_terms.qa.rb
252
- - spec/internal/db/migrate/20140611161144_create_qa_mesh_tree.qa.rb
253
- - spec/internal/db/migrate/20140611161145_add_term_lower_to_qa_subject_mesh_terms.qa.rb
269
+ - spec/internal/db/migrate/20140620210534_create_qa_subject_mesh_terms.qa.rb
270
+ - spec/internal/db/migrate/20140620210535_create_qa_mesh_tree.qa.rb
271
+ - spec/internal/db/migrate/20140620210536_add_term_lower_to_qa_subject_mesh_terms.qa.rb
254
272
  - spec/internal/db/schema.rb
255
273
  - spec/internal/db/seeds.rb
256
274
  - spec/internal/db/test.sqlite3
@@ -317,7 +335,14 @@ test_files:
317
335
  - spec/internal/bin/bundle
318
336
  - spec/internal/bin/rails
319
337
  - spec/internal/bin/rake
338
+ - spec/internal/bin/spring
320
339
  - spec/internal/config/application.rb
340
+ - spec/internal/config/authorities/authority_A.yml
341
+ - spec/internal/config/authorities/authority_B.yml
342
+ - spec/internal/config/authorities/authority_C.yml
343
+ - spec/internal/config/authorities/authority_D.yml
344
+ - spec/internal/config/authorities/states.yml
345
+ - spec/internal/config/authorities.yml
321
346
  - spec/internal/config/boot.rb
322
347
  - spec/internal/config/database.yml
323
348
  - spec/internal/config/environment.rb
@@ -325,20 +350,21 @@ test_files:
325
350
  - spec/internal/config/environments/production.rb
326
351
  - spec/internal/config/environments/test.rb
327
352
  - spec/internal/config/initializers/backtrace_silencers.rb
353
+ - spec/internal/config/initializers/cookies_serializer.rb
328
354
  - spec/internal/config/initializers/filter_parameter_logging.rb
329
355
  - spec/internal/config/initializers/inflections.rb
330
356
  - spec/internal/config/initializers/mime_types.rb
331
- - spec/internal/config/initializers/secret_token.rb
332
357
  - spec/internal/config/initializers/session_store.rb
333
358
  - spec/internal/config/initializers/wrap_parameters.rb
334
359
  - spec/internal/config/locales/en.yml
335
360
  - spec/internal/config/oclcts-authorities.yml
336
361
  - spec/internal/config/routes.rb
362
+ - spec/internal/config/secrets.yml
337
363
  - spec/internal/config.ru
338
364
  - spec/internal/db/development.sqlite3
339
- - spec/internal/db/migrate/20140611161143_create_qa_subject_mesh_terms.qa.rb
340
- - spec/internal/db/migrate/20140611161144_create_qa_mesh_tree.qa.rb
341
- - spec/internal/db/migrate/20140611161145_add_term_lower_to_qa_subject_mesh_terms.qa.rb
365
+ - spec/internal/db/migrate/20140620210534_create_qa_subject_mesh_terms.qa.rb
366
+ - spec/internal/db/migrate/20140620210535_create_qa_mesh_tree.qa.rb
367
+ - spec/internal/db/migrate/20140620210536_add_term_lower_to_qa_subject_mesh_terms.qa.rb
342
368
  - spec/internal/db/schema.rb
343
369
  - spec/internal/db/seeds.rb
344
370
  - spec/internal/db/test.sqlite3
@@ -1,12 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Your secret key is used for verifying the integrity of signed cookies.
4
- # If you change this key, all old signed cookies will become invalid!
5
-
6
- # Make sure the secret is at least 30 characters and all random,
7
- # no regular words or you'll be exposed to dictionary attacks.
8
- # You can use `rake secret` to generate a secure secret key.
9
-
10
- # Make sure your secret_key_base is kept private
11
- # if you're sharing your code publicly.
12
- Internal::Application.config.secret_key_base = 'ac3130ff074153869235aade642f0cab7fb3aa43cae4e302b75cb577542e2b5f74f6e5ff105065d1a1f3692ec8307ac0242f11e60c91b8749fe2262ed7460fae'