doop 0.0.4.2 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (101) hide show
  1. checksums.yaml +8 -8
  2. data/README.md +126 -12
  3. data/app/helpers/doop_helper.rb +4 -0
  4. data/demo/.gitignore +19 -0
  5. data/demo/.rspec +2 -0
  6. data/demo/Gemfile +70 -0
  7. data/demo/Gemfile.lock +237 -0
  8. data/demo/README.md +50 -0
  9. data/demo/Rakefile +6 -0
  10. data/demo/app/assets/images/.keep +0 -0
  11. data/demo/app/assets/images/cert_sample.jpg +0 -0
  12. data/demo/app/assets/javascripts/application.js +16 -0
  13. data/{lib/generators/doopgovuk/templates → demo}/app/assets/javascripts/demo.js.coffee +0 -0
  14. data/{lib/generators/doopgovuk/templates → demo}/app/assets/javascripts/demo/analytics.js.erb +0 -0
  15. data/demo/app/assets/javascripts/demo/application.js +8 -0
  16. data/demo/app/assets/stylesheets/application.css +15 -0
  17. data/{lib/generators/doopgovuk/templates → demo}/app/assets/stylesheets/demo.css.scss +39 -0
  18. data/{lib/generators/doopgovuk/templates → demo}/app/assets/stylesheets/demo/application.css +1 -0
  19. data/demo/app/controllers/application_controller.rb +5 -0
  20. data/demo/app/controllers/concerns/.keep +0 -0
  21. data/{lib/generators/doopgovuk/templates → demo}/app/controllers/demo_controller.rb +84 -53
  22. data/demo/app/helpers/application_helper.rb +2 -0
  23. data/demo/app/helpers/demo_helper.rb +2 -0
  24. data/demo/app/mailers/.keep +0 -0
  25. data/demo/app/models/.keep +0 -0
  26. data/demo/app/models/concerns/.keep +0 -0
  27. data/{lib/generators/doopgovuk/templates → demo}/app/views/demo/_about_you.html.erb +0 -0
  28. data/{lib/generators/doopgovuk/templates → demo}/app/views/demo/_before_you_begin.html.erb +3 -3
  29. data/{lib/generators/doopgovuk/templates → demo}/app/views/demo/_children.html.erb +8 -6
  30. data/{lib/generators/doopgovuk/templates → demo}/app/views/demo/_declaration.html.erb +0 -0
  31. data/{lib/generators/doopgovuk/templates → demo}/app/views/demo/_preamble.html.erb +10 -0
  32. data/demo/app/views/demo/harness.html.erb +6 -0
  33. data/{lib/generators/doopgovuk/templates → demo}/app/views/demo/index.html.erb +0 -0
  34. data/{lib/generators/doopgovuk/templates → demo}/app/views/demo/index.js.erb +0 -0
  35. data/{lib/generators/doopgovuk/templates → demo}/app/views/doop/_change_answer_tooltip.html.erb +0 -0
  36. data/{lib/generators/doopgovuk/templates → demo}/app/views/doop/_debug.html.erb +1 -1
  37. data/{lib/generators/doopgovuk/templates → demo}/app/views/doop/_error.html.erb +0 -0
  38. data/demo/app/views/doop/_file_uploader.html.erb +58 -0
  39. data/{lib/generators/doopgovuk/templates → demo}/app/views/doop/_info_box.html.erb +0 -0
  40. data/{lib/generators/doopgovuk/templates → demo}/app/views/doop/_navbar.html.erb +0 -0
  41. data/{lib/generators/doopgovuk/templates → demo}/app/views/doop/_question.html.erb +0 -0
  42. data/{lib/generators/doopgovuk/templates → demo}/app/views/doop/_question_form.html.erb +1 -1
  43. data/{lib/generators/doopgovuk/templates → demo}/app/views/doop/_textfield.html.erb +0 -0
  44. data/{lib/generators/doopgovuk/templates → demo}/app/views/doop/_tooltip.html.erb +0 -0
  45. data/{lib/generators/doopgovuk/templates → demo}/app/views/layouts/application.html.erb +0 -0
  46. data/demo/bin/bundle +3 -0
  47. data/demo/bin/rails +8 -0
  48. data/demo/bin/rake +8 -0
  49. data/demo/bin/rspec +16 -0
  50. data/demo/bin/spring +18 -0
  51. data/demo/config.ru +4 -0
  52. data/demo/config/application.rb +23 -0
  53. data/demo/config/boot.rb +4 -0
  54. data/demo/config/database.yml +26 -0
  55. data/demo/config/environment.rb +5 -0
  56. data/demo/config/environments/development.rb +37 -0
  57. data/demo/config/environments/production.rb +78 -0
  58. data/demo/config/environments/test.rb +39 -0
  59. data/demo/config/initializers/assets.rb +8 -0
  60. data/demo/config/initializers/backtrace_silencers.rb +7 -0
  61. data/demo/config/initializers/cookies_serializer.rb +3 -0
  62. data/demo/config/initializers/filter_parameter_logging.rb +4 -0
  63. data/demo/config/initializers/inflections.rb +16 -0
  64. data/demo/config/initializers/mime_types.rb +4 -0
  65. data/demo/config/initializers/session_store.rb +3 -0
  66. data/demo/config/initializers/wrap_parameters.rb +14 -0
  67. data/demo/config/locales/en.yml +23 -0
  68. data/demo/config/routes.rb +63 -0
  69. data/demo/config/secrets.yml +22 -0
  70. data/demo/db/seeds.rb +7 -0
  71. data/demo/lib/assets/.keep +0 -0
  72. data/demo/lib/tasks/.keep +0 -0
  73. data/demo/log/.keep +0 -0
  74. data/demo/notes.txt +3 -0
  75. data/demo/public/404.html +67 -0
  76. data/demo/public/422.html +67 -0
  77. data/demo/public/500.html +66 -0
  78. data/demo/public/favicon.ico +0 -0
  79. data/demo/public/robots.txt +5 -0
  80. data/{lib/generators/doopgovuk/templates → demo}/spec/features/demo_spec.rb +24 -5
  81. data/{lib/generators/doopgovuk/templates → demo}/spec/rails_helper.rb +0 -0
  82. data/{lib/generators/doopgovuk/templates → demo}/spec/spec_helper.rb +0 -0
  83. data/demo/test/controllers/.keep +0 -0
  84. data/demo/test/fixtures/.keep +0 -0
  85. data/demo/test/helpers/.keep +0 -0
  86. data/demo/test/integration/.keep +0 -0
  87. data/demo/test/mailers/.keep +0 -0
  88. data/demo/test/models/.keep +0 -0
  89. data/demo/test/test_helper.rb +10 -0
  90. data/demo/vendor/assets/javascripts/.keep +0 -0
  91. data/demo/vendor/assets/stylesheets/.keep +0 -0
  92. data/doop.gemspec +1 -17
  93. data/lib/doop-rspec.rb +4 -0
  94. data/lib/doop/version.rb +1 -1
  95. data/lib/doop_controller.rb +19 -24
  96. data/lib/generators/doopgovuk/doopgovuk_generator.rb +23 -13
  97. data/lib/generators/doopgovuk/templates/.keep +0 -0
  98. data/notes/screenshots/doop_1.png +0 -0
  99. metadata +94 -31
  100. data/lib/generators/doopgovuk/templates/app/assets/javascripts/demo/application.js +0 -3
  101. data/lib/generators/doopgovuk/templates/app/views/demo/harness.html.erb +0 -6
@@ -0,0 +1,3 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Rails.application.config.session_store :cookie_store, key: '_doop_demo_session'
@@ -0,0 +1,14 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # This file contains settings for ActionController::ParamsWrapper which
4
+ # is enabled by default.
5
+
6
+ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
+ ActiveSupport.on_load(:action_controller) do
8
+ wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
9
+ end
10
+
11
+ # To enable root element in JSON for ActiveRecord objects.
12
+ # ActiveSupport.on_load(:active_record) do
13
+ # self.include_root_in_json = true
14
+ # end
@@ -0,0 +1,23 @@
1
+ # Files in the config/locales directory are used for internationalization
2
+ # and are automatically loaded by Rails. If you want to use locales other
3
+ # than English, add the necessary files in this directory.
4
+ #
5
+ # To use the locales, use `I18n.t`:
6
+ #
7
+ # I18n.t 'hello'
8
+ #
9
+ # In views, this is aliased to just `t`:
10
+ #
11
+ # <%= t('hello') %>
12
+ #
13
+ # To use a different locale, set it with `I18n.locale`:
14
+ #
15
+ # I18n.locale = :es
16
+ #
17
+ # This would use the information in config/locales/es.yml.
18
+ #
19
+ # To learn more, please read the Rails Internationalization guide
20
+ # available at http://guides.rubyonrails.org/i18n.html.
21
+
22
+ en:
23
+ hello: "Hello world"
@@ -0,0 +1,63 @@
1
+ Rails.application.routes.draw do
2
+ post 'demo/answer'
3
+ get 'demo/index'
4
+ post 'demo/index'
5
+ post 'demo/harness'
6
+ post 'demo/upload_image'
7
+ get 'demo/harness'
8
+ root 'demo#index'
9
+ # The priority is based upon order of creation: first created -> highest priority.
10
+ # See how all your routes lay out with "rake routes".
11
+
12
+ # You can have the root of your site routed with "root"
13
+ # root 'welcome#index'
14
+
15
+ # Example of regular route:
16
+ # get 'products/:id' => 'catalog#view'
17
+
18
+ # Example of named route that can be invoked with purchase_url(id: product.id)
19
+ # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase
20
+
21
+ # Example resource route (maps HTTP verbs to controller actions automatically):
22
+ # resources :products
23
+
24
+ # Example resource route with options:
25
+ # resources :products do
26
+ # member do
27
+ # get 'short'
28
+ # post 'toggle'
29
+ # end
30
+ #
31
+ # collection do
32
+ # get 'sold'
33
+ # end
34
+ # end
35
+
36
+ # Example resource route with sub-resources:
37
+ # resources :products do
38
+ # resources :comments, :sales
39
+ # resource :seller
40
+ # end
41
+
42
+ # Example resource route with more complex sub-resources:
43
+ # resources :products do
44
+ # resources :comments
45
+ # resources :sales do
46
+ # get 'recent', on: :collection
47
+ # end
48
+ # end
49
+
50
+ # Example resource route with concerns:
51
+ # concern :toggleable do
52
+ # post 'toggle'
53
+ # end
54
+ # resources :posts, concerns: :toggleable
55
+ # resources :photos, concerns: :toggleable
56
+
57
+ # Example resource route within a namespace:
58
+ # namespace :admin do
59
+ # # Directs /admin/products/* to Admin::ProductsController
60
+ # # (app/controllers/admin/products_controller.rb)
61
+ # resources :products
62
+ # end
63
+ end
@@ -0,0 +1,22 @@
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 the secrets in this file are kept private
11
+ # if you're sharing your code publicly.
12
+
13
+ development:
14
+ secret_key_base: b35314de26d4d0993b24581a448f998e43128d19f92b5a32799371b589c9977cebcf682652c1e35969aecc551e1c6e8c71828ccaa8faf084a01db184397794da
15
+
16
+ test:
17
+ secret_key_base: b20e731f3cee0767826d54f5fe2d9cb772229663740eda5c7ee3c5132e95b527dd8f3332284cc418ae1618367df0cf20c29e9cb093d1145297b5d031703f3684
18
+
19
+ # Do not keep production secrets in the repository,
20
+ # instead read values from the environment.
21
+ production:
22
+ secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
@@ -0,0 +1,7 @@
1
+ # This file should contain all the record creation needed to seed the database with its default values.
2
+ # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
3
+ #
4
+ # Examples:
5
+ #
6
+ # cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
7
+ # Mayor.create(name: 'Emanuel', city: cities.first)
File without changes
File without changes
File without changes
@@ -0,0 +1,3 @@
1
+ On ubuntu, to allow pg to install run
2
+
3
+ sudo apt-get install libpq-dev
@@ -0,0 +1,67 @@
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
+ body {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ 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
+ h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ 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>
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>
@@ -0,0 +1,67 @@
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
+ body {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ 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
+ h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ 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>
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>
@@ -0,0 +1,66 @@
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
+ body {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ 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
+ h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ 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>
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
@@ -0,0 +1,5 @@
1
+ # See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file
2
+ #
3
+ # To ban all spiders from the entire site uncomment the next two lines:
4
+ # User-agent: *
5
+ # Disallow: /
@@ -10,6 +10,8 @@ feature "Child Benefit online form" do
10
10
  about_you
11
11
  children
12
12
  declaration
13
+
14
+ page_navigation
13
15
  end
14
16
 
15
17
  def before_you_begin
@@ -36,6 +38,8 @@ feature "Child Benefit online form" do
36
38
  expect( question "do_you_still_want_to_apply" ).to be_enabled
37
39
 
38
40
  answer_question( "do_you_still_want_to_apply") { click_button "Yes," }
41
+
42
+ answer_question( "proof_of_id" ) { click_button "Continue" }
39
43
  click_button "Continue"
40
44
  end
41
45
 
@@ -101,10 +105,6 @@ feature "Child Benefit online form" do
101
105
  def children
102
106
  wait_for_page( "children" )
103
107
 
104
- answer_question( "how_many_birth_certs" ) do
105
- b_fill_in( "answer" => "1" ); click_button "Continue"
106
- end
107
-
108
108
  # child__1
109
109
  answer_question( "name" ) do
110
110
  b_fill_in( "firstname" => "Padraig", "middlenames" => "Alan", "surname" => "Middleton" ); click_button "Continue"
@@ -113,6 +113,7 @@ feature "Child Benefit online form" do
113
113
  answer_question( "gender" ) { click_button "Male" }
114
114
  answer_question( "dob" ) { b_fill_in( "answer" => "30/09/2006" ); click_button "Continue" }
115
115
  answer_question( "own_child" ) { click_button "Yes," }
116
+ answer_question( "birth_certificate" ) { click_button "Continue" }
116
117
  answer_question( "child__1" ) { click_button "Continue" }
117
118
 
118
119
  # child__2
@@ -124,6 +125,7 @@ feature "Child Benefit online form" do
124
125
  answer_question( "gender" ) { click_button "Female" }
125
126
  answer_question( "dob" ) { b_fill_in( "answer" => "24/02/2008" ); click_button "Continue" }
126
127
  answer_question( "own_child" ) { click_button "Yes," }
128
+ answer_question( "birth_certificate" ) { click_button "Continue" }
127
129
  answer_question( "child__2" ) { click_button "Continue" }
128
130
 
129
131
  # remove child__2
@@ -136,8 +138,25 @@ feature "Child Benefit online form" do
136
138
 
137
139
  end
138
140
 
139
-
140
141
  def declaration
141
142
  wait_for_page( "declaration" )
142
143
  end
144
+
145
+ def page_navigation
146
+ wait_for_page( "declaration" )
147
+ change_page( "about_you" )
148
+ back_a_page
149
+ wait_for_page( "preamble" )
150
+ back_a_page
151
+ wait_for_page( "before_you_begin" )
152
+ click_button "Start"
153
+ wait_for_page( "preamble" )
154
+ click_button "Continue"
155
+ wait_for_page( "about_you" )
156
+ click_button "Continue"
157
+ wait_for_page( "children" )
158
+ click_button "Continue"
159
+ wait_for_page( "declaration" )
160
+ end
161
+
143
162
  end
File without changes
File without changes
File without changes
File without changes