doop 0.0.2 → 0.0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/.gitignore +1 -0
- data/README.md +15 -5
- data/doop.gemspec +1 -0
- data/lib/doop/version.rb +1 -1
- data/lib/generators/doopgovuk/doopgovuk_generator.rb +19 -1
- data/lib/generators/doopgovuk/templates/app/controllers/demo_controller.rb +12 -5
- data/lib/generators/doopgovuk/templates/app/views/demo/harness.html.erb +6 -0
- data/lib/generators/doopgovuk/templates/app/views/doop/_question.html.erb +2 -2
- data/lib/generators/doopgovuk/templates/app/views/doop/_question_form.html.erb +2 -2
- data/lib/generators/doopgovuk/templates/spec/features/demo_spec.rb +70 -0
- data/lib/generators/doopgovuk/templates/spec/rails_helper.rb +142 -0
- data/lib/generators/doopgovuk/templates/spec/spec_helper.rb +87 -0
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YTJlNzA0M2EyMWRkMGNhNjIwMzc5YWM2ZmQzNTBiYWFhOGFiYjE4ZA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NWMzODdlOWE2ZWMyMWJiZmEwODg2Zjk4MzM3NDNiZjk1NTdmOTM4ZA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YmVhODM2ZjRmNDJiMTllYjM4MjQyMzZkM2ViMGVmYmQzZjE1MzQ3YzA5NjVj
|
10
|
+
MjYzZjAxYTEwNTJkZTc0N2VmNzliYmMwNDRkMDY0MjM0YjgzZTFiOTI3Mjc0
|
11
|
+
YjI5N2JhZjgwYjMyZjQ2NThkZDI1MTA0ZTNiZWVhYWUxM2YwZjg=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MDZmNzBlYzBjMDk0Zjk4OGI2OGExMjEwMDQ0MDIxNjkzOGM1MjlmMzNmMzYx
|
14
|
+
NDlmZDRmOGRlZTQ0YTdhY2MwMjRkZWI0OTA5YjUwNDI0OTIzYThhOTAwY2E0
|
15
|
+
NDE2NWMxODFlNTA4NzNmMzk2YWViM2Y4ZTg5YTg0MjMwZDVmYjU=
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -10,6 +10,10 @@ Try out a demo... it's hosted on heroku so there may be a initial pause while he
|
|
10
10
|
|
11
11
|
Assuming ruby, rails and nodejs is installed:
|
12
12
|
|
13
|
+
$ sudo apt-get install qt4-dev-tools libqt4-dev libqt4-core libqt4-gui xvfb
|
14
|
+
|
15
|
+
These are needed to support the headless capybara test suite.
|
16
|
+
|
13
17
|
$ rails new govsite
|
14
18
|
$ cd govsite
|
15
19
|
$ echo "gem 'doop'" >> Gemfile
|
@@ -17,13 +21,11 @@ Assuming ruby, rails and nodejs is installed:
|
|
17
21
|
$ rails generate doopgovuk demo
|
18
22
|
$ rails s
|
19
23
|
|
20
|
-
Navigate to http://localhost:3000
|
24
|
+
Navigate to http://localhost:3000/demo/index
|
21
25
|
|
22
26
|
This is still in development, so if you want the latest, then add `gem 'doop', git: 'git://github.com/coder36/doop.git'` to your Gemfile.
|
23
27
|
|
24
28
|
|
25
|
-
|
26
|
-
|
27
29
|
## Background
|
28
30
|
Whilst working with the Student Loans company and GDS we discovered that the best way to get a student to fill a form in was to progressively ask questions, one after the other rather than as one big form. User experience testing showed this was a far less intimidating experience, and they would more likely stick at it. Furthermore, based on pevious answers, we can choose which questions to ask. This makes each questionaire effectively tailored to the individual student.
|
29
31
|
|
@@ -58,12 +60,13 @@ If your govuk site requires any kind of questionaire, doop is the answer.
|
|
58
60
|
Make sure that the gemfile contains gem 'doop'. Then run
|
59
61
|
|
60
62
|
$ rails generate doopgovuk demo
|
63
|
+
$ rspec
|
64
|
+
$ rails s
|
61
65
|
|
62
|
-
Navigate to http://localhost:3000 and you will see the demo questionaire.
|
66
|
+
Navigate to http://localhost:3000/demo/index and you will see the demo questionaire.
|
63
67
|
|
64
68
|
See the [demo rails controller](https://github.com/coder36/doop/blob/master/lib/generators/doopgovuk/templates/app/controllers/demo_controller.rb) to get a feel for the DSL.
|
65
69
|
|
66
|
-
|
67
70
|
## Yaml
|
68
71
|
|
69
72
|
Doop is initiated with a Yaml data structure:
|
@@ -191,6 +194,13 @@ Don't forget to deal with database drivers. In your Gemfile, you will need to u
|
|
191
194
|
end
|
192
195
|
```
|
193
196
|
|
197
|
+
## Creating and publishing doop gem
|
198
|
+
|
199
|
+
git submodule init <-- to load doop_demo
|
200
|
+
gem build doop.gemspec
|
201
|
+
gem push doop-<version>.gem
|
202
|
+
|
203
|
+
|
194
204
|
|
195
205
|
## TODO
|
196
206
|
|
data/doop.gemspec
CHANGED
@@ -13,6 +13,7 @@ if !Dir['doop_demo/*'].empty?
|
|
13
13
|
FileUtils.cp "doop_demo/app/views/layouts/application.html.erb", "#{dest}/app/views/layouts/application.html.erb"
|
14
14
|
FileUtils.cp_r "doop_demo/app/views/doop", "#{dest}/app/views"
|
15
15
|
FileUtils.cp_r "doop_demo/app/views/demo", "#{dest}/app/views"
|
16
|
+
FileUtils.cp_r "doop_demo/spec", "#{dest}"
|
16
17
|
end
|
17
18
|
|
18
19
|
Gem::Specification.new do |spec|
|
data/lib/doop/version.rb
CHANGED
@@ -12,14 +12,32 @@ class DoopgovukGenerator < Rails::Generators::Base
|
|
12
12
|
directory "app/views/demo", "app/views/#{name}"
|
13
13
|
gsub_file "app/controllers/#{name}_controller.rb", /DemoController/, "#{name.capitalize}Controller"
|
14
14
|
|
15
|
+
copy_file "spec/rails_helper.rb"
|
16
|
+
copy_file "spec/spec_helper.rb"
|
17
|
+
copy_file "spec/features/demo_spec.rb", "spec/features/#{name}_spec.rb"
|
18
|
+
gsub_file "spec/features/#{name}_spec.rb", /\/demo\/harness/, "/#{name}/harness"
|
19
|
+
gsub_file "spec/features/#{name}_spec.rb", /\/demo\/index/, "/#{name}/index"
|
15
20
|
|
16
|
-
route "root '#{name}#index'"
|
17
21
|
route "get '#{name}/index'"
|
22
|
+
route "post '#{name}/index'"
|
18
23
|
route "post '#{name}/answer'"
|
24
|
+
route "get '#{name}/harness'"
|
19
25
|
|
20
26
|
gem 'govuk_frontend_toolkit'
|
21
27
|
gem 'govuk_template'
|
22
28
|
|
29
|
+
gem_group :development do
|
30
|
+
gem 'rspec-rails'
|
31
|
+
gem 'guard-rspec'
|
32
|
+
gem 'capybara'
|
33
|
+
gem 'pry'
|
34
|
+
gem 'pry-nav'
|
35
|
+
gem 'capybara-webkit'
|
36
|
+
gem 'headless'
|
37
|
+
gem 'capybara-screenshot'
|
38
|
+
gem 'selenium-webdriver'
|
39
|
+
end
|
40
|
+
|
23
41
|
Bundler.with_clean_env do
|
24
42
|
run "bundle install"
|
25
43
|
end
|
@@ -13,8 +13,11 @@ class DemoController < ApplicationController
|
|
13
13
|
load_yaml do
|
14
14
|
data = params["doop_data"]
|
15
15
|
if data != nil
|
16
|
-
|
17
|
-
|
16
|
+
if Rails.env.development? || Rails.env.test?
|
17
|
+
next data
|
18
|
+
else
|
19
|
+
next ActiveSupport::MessageEncryptor.new(Rails.application.secrets.secret_key_base).decrypt_and_verify data if !Rails.env.development?
|
20
|
+
end
|
18
21
|
end
|
19
22
|
|
20
23
|
<<-EOS
|
@@ -66,9 +69,13 @@ class DemoController < ApplicationController
|
|
66
69
|
end
|
67
70
|
|
68
71
|
save_yaml do |yaml|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
+
if Rails.env.development? || Rails.env.test?
|
73
|
+
request["doop_data"] = yaml
|
74
|
+
else
|
75
|
+
crypt = ActiveSupport::MessageEncryptor.new(Rails.application.secrets.secret_key_base)
|
76
|
+
data = crypt.encrypt_and_sign(yaml)
|
77
|
+
request["doop_data"] = data
|
78
|
+
end
|
72
79
|
end
|
73
80
|
|
74
81
|
debug_on do
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<% if root["_open"] %>
|
2
2
|
<% if indent %><div class="indent"><% end %>
|
3
3
|
<div class="question-open">
|
4
|
-
<h2><%=title != nil ? title : root["_question"]%></h2>
|
4
|
+
<h2 class="question_title"><%=title != nil ? title : root["_question"]%></h2>
|
5
5
|
<% content.call(root, answer) %>
|
6
6
|
</div>
|
7
7
|
<% if indent %> </div"><% end %>
|
@@ -10,7 +10,7 @@
|
|
10
10
|
<% if !root["_open"] && root["_answered"] %>
|
11
11
|
<% if indent %><div class="indent"><% end %>
|
12
12
|
<div class="question-closed">
|
13
|
-
<div class="title"><%=title != nil ? title : root["_question"]%></div>
|
13
|
+
<div class="title question_title"><%=title != nil ? title : root["_question"]%></div>
|
14
14
|
<div class="answer">
|
15
15
|
<a href="#" class="button" onclick="$('#change_answer_path').val('<%=path %>').click(); return false"><%=root['_summary']%></a>
|
16
16
|
</div>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<%=form_tag( {action: "answer"}, :authenticity_token => true, :remote => true ) do %>
|
2
2
|
<div class="question_form">
|
3
3
|
<%=render "doop/navbar", :res => res, :doop => doop %>
|
4
|
-
<h1><%=res[:page_title]%></h1>
|
4
|
+
<h1 id="page_title"><%=res[:page_title]%></h1>
|
5
5
|
<% content.call %>
|
6
6
|
</div>
|
7
7
|
|
@@ -11,5 +11,5 @@
|
|
11
11
|
<button id="nav_path" style="display: none;" name="nav_path"></button>
|
12
12
|
<button id="back_a_page" name="back_a_page" style="display: none;"></button>
|
13
13
|
<button id="change_answer_path" style="display: none;" name="change_answer_path"></button>
|
14
|
-
<input type="hidden" name="doop_data" value="<%=request["doop_data"]%>"/>
|
14
|
+
<input type="hidden" id="doop_data" name="doop_data" value="<%=request["doop_data"]%>"/>
|
15
15
|
<% end %>
|
@@ -0,0 +1,70 @@
|
|
1
|
+
require 'rails_helper'
|
2
|
+
require 'pry'
|
3
|
+
|
4
|
+
|
5
|
+
feature "Doop questionnaire" do
|
6
|
+
|
7
|
+
scenario "Quick run through", :js => true do
|
8
|
+
load_completed_form
|
9
|
+
end
|
10
|
+
|
11
|
+
scenario "Changing an answer, causes change_answer_tool_tip_text to appear", :js => true do
|
12
|
+
load_completed_form
|
13
|
+
change_page( "Apply Online" )
|
14
|
+
change_question( "Have you enrolled for this service before") do
|
15
|
+
expect(change_answer_tooltip_text).to match /additional questions may be asked/
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
scenario "Answering a question results in a tooltip appearing", :js => true do
|
20
|
+
load_completed_form
|
21
|
+
change_page( "Apply Online" )
|
22
|
+
change_question( "Turn debug on") do
|
23
|
+
click_button "No"
|
24
|
+
expect(tooltip_text).to match /Are you sure/
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
scenario "Answering a question results in a new question being asked", :js => true do
|
29
|
+
load_completed_form
|
30
|
+
change_page( "Apply Online" )
|
31
|
+
change_question( "Have you enrolled for this service before") { click_button "Yes" }
|
32
|
+
expect( question "What year did you last apply" ).to be_enabled
|
33
|
+
change_question( "Have you enrolled for this service before") { click_button "No" }
|
34
|
+
expect( question "What year did you last apply" ).to be_disabled
|
35
|
+
end
|
36
|
+
|
37
|
+
def load_completed_form
|
38
|
+
|
39
|
+
if $completed_form_yaml != nil
|
40
|
+
visit '/demo/harness'
|
41
|
+
fill_in( "doop_data", :with => $completed_form_yaml )
|
42
|
+
click_button "Render"
|
43
|
+
return
|
44
|
+
end
|
45
|
+
|
46
|
+
visit '/demo/index'
|
47
|
+
wait_for_page( "Apply Online" )
|
48
|
+
answer_question( "Turn debug on") { click_button "Yes" }
|
49
|
+
answer_question( "Have you enrolled for this service before") { click_button "Yes" }
|
50
|
+
answer_question( "What year did you last apply") { select( '2012', :from => 'b_answer' ); click_button "Continue" }
|
51
|
+
answer_question( "Why are you applying") { fill_in( 'b_answer', :with => "My circumstances have changed" ); click_button "Continue"}
|
52
|
+
click_button "Continue and Save"
|
53
|
+
|
54
|
+
wait_for_page( "Your Details" )
|
55
|
+
answer_question( "What is your name") do
|
56
|
+
b_fill_in( "firstname" => "mark", "surname" => "middleton" )
|
57
|
+
click_button "Continue"
|
58
|
+
expect(rollup_text).to be == "Mark Middleton"
|
59
|
+
end
|
60
|
+
address = { "address1" => "1 Runswick Avenue", "address2" => "Telford", "address3" => "Shropshire", "postcode" => "T56 HDJ" }
|
61
|
+
answer_question( "Address 1") { b_fill_in( address); click_button "Continue" }
|
62
|
+
click_button "Continue"
|
63
|
+
click_button "Continue and Save"
|
64
|
+
|
65
|
+
wait_for_page( "Summary" )
|
66
|
+
answer_question( "Terms and conditions") { click_button "I have read" }
|
67
|
+
$completed_form_yaml = page.find_by_id( "doop_data", :visible => false).value
|
68
|
+
end
|
69
|
+
|
70
|
+
end
|
@@ -0,0 +1,142 @@
|
|
1
|
+
# This file is copied to spec/ when you run 'rails generate rspec:install'
|
2
|
+
ENV["RAILS_ENV"] ||= 'test'
|
3
|
+
require 'spec_helper'
|
4
|
+
require File.expand_path("../../config/environment", __FILE__)
|
5
|
+
require 'capybara'
|
6
|
+
require 'capybara/rails'
|
7
|
+
require 'capybara/rspec'
|
8
|
+
require 'capybara-webkit'
|
9
|
+
require 'headless'
|
10
|
+
require 'capybara-screenshot/rspec'
|
11
|
+
|
12
|
+
|
13
|
+
Capybara.javascript_driver = :webkit
|
14
|
+
|
15
|
+
# Add additional requires below this line. Rails is not loaded until this point!
|
16
|
+
|
17
|
+
# Requires supporting ruby files with custom matchers and macros, etc, in
|
18
|
+
# spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
|
19
|
+
# run as spec files by default. This means that files in spec/support that end
|
20
|
+
# in _spec.rb will both be required and run as specs, causing the specs to be
|
21
|
+
# run twice. It is recommended that you do not name files matching this glob to
|
22
|
+
# end with _spec.rb. You can configure this pattern with the --pattern
|
23
|
+
# option on the command line or in ~/.rspec, .rspec or `.rspec-local`.
|
24
|
+
#
|
25
|
+
# The following line is provided for convenience purposes. It has the downside
|
26
|
+
# of increasing the boot-up time by auto-requiring all files in the support
|
27
|
+
# directory. Alternatively, in the individual `*_spec.rb` files, manually
|
28
|
+
# require only the support files necessary.
|
29
|
+
#
|
30
|
+
# Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
|
31
|
+
|
32
|
+
# Checks for pending migrations before tests are run.
|
33
|
+
# If you are not using ActiveRecord, you can remove this line.
|
34
|
+
ActiveRecord::Migration.maintain_test_schema!
|
35
|
+
|
36
|
+
RSpec.configure do |config|
|
37
|
+
|
38
|
+
config.before(:suite) do
|
39
|
+
@headless = Headless.new
|
40
|
+
@headless.start
|
41
|
+
end
|
42
|
+
|
43
|
+
config.after(:suite) do
|
44
|
+
@headless.destroy
|
45
|
+
end
|
46
|
+
|
47
|
+
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
|
48
|
+
#config.fixture_path = "#{::Rails.root}/spec/fixtures"
|
49
|
+
|
50
|
+
# If you're not using ActiveRecord, or you'd prefer not to run each of your
|
51
|
+
# examples within a transaction, remove the following line or assign false
|
52
|
+
# instead of true.
|
53
|
+
#config.use_transactional_fixtures = true
|
54
|
+
|
55
|
+
# RSpec Rails can automatically mix in different behaviours to your tests
|
56
|
+
# based on their file location, for example enabling you to call `get` and
|
57
|
+
# `post` in specs under `spec/controllers`.
|
58
|
+
#
|
59
|
+
# You can disable this behaviour by removing the line below, and instead
|
60
|
+
# explicitly tag your specs with their type, e.g.:
|
61
|
+
#
|
62
|
+
# RSpec.describe UsersController, :type => :controller do
|
63
|
+
# # ...
|
64
|
+
# end
|
65
|
+
#
|
66
|
+
# The different available types are documented in the features, such as in
|
67
|
+
# https://relishapp.com/rspec/rspec-rails/docs
|
68
|
+
#config.infer_spec_type_from_file_location!
|
69
|
+
end
|
70
|
+
|
71
|
+
RSpec::Matchers.define :be_asked do
|
72
|
+
match do |q_title|
|
73
|
+
page.has_css?( '.question-open h2', :text => q_title )
|
74
|
+
end
|
75
|
+
|
76
|
+
failure_message do |q_title|
|
77
|
+
actual = page.all( '.question-open h2', ).last.text
|
78
|
+
"Expected question to be asked: #{q_title}, but was asked #{actual}"
|
79
|
+
end
|
80
|
+
|
81
|
+
end
|
82
|
+
|
83
|
+
RSpec::Matchers.define :be_enabled do
|
84
|
+
match do |q_title|
|
85
|
+
page.has_css?( '.question_title', :text => q_title )
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
RSpec::Matchers.define :be_disabled do
|
90
|
+
match do |q_title|
|
91
|
+
page.has_no_css?( '.question_title', :text => q_title )
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
def question text
|
96
|
+
text
|
97
|
+
end
|
98
|
+
|
99
|
+
def change_question q_title, &block
|
100
|
+
@q_title = q_title
|
101
|
+
page.find( '.question-closed div.title', :text => q_title ).find(:xpath, "..").find( 'div.answer a' ).click
|
102
|
+
expect( question q_title ).to be_asked
|
103
|
+
yield block
|
104
|
+
end
|
105
|
+
|
106
|
+
def answer_question q_title, &block
|
107
|
+
@q_title = q_title
|
108
|
+
expect( question q_title ).to be_asked
|
109
|
+
yield block
|
110
|
+
page.find( '.question-closed div.title', :text => q_title )
|
111
|
+
end
|
112
|
+
|
113
|
+
def rollup_text
|
114
|
+
page.find( '.question-closed div.title', :text => @q_title ).find(:xpath, '..').find( 'div.answer').text
|
115
|
+
end
|
116
|
+
|
117
|
+
def tooltip_text
|
118
|
+
page.find( '.tooltip' ).text
|
119
|
+
end
|
120
|
+
|
121
|
+
def change_answer_tooltip_text
|
122
|
+
page.find( '.change_answer_tooltip' ).text
|
123
|
+
end
|
124
|
+
|
125
|
+
def wait_for_page p_title
|
126
|
+
page.find_by_id( "page_title", :text=>p_title)
|
127
|
+
end
|
128
|
+
|
129
|
+
def page_title
|
130
|
+
page.find_by_id( "page_title").text
|
131
|
+
end
|
132
|
+
|
133
|
+
def b_fill_in options = {}
|
134
|
+
options.keys.each do |key|
|
135
|
+
page.fill_in( "b_#{key}", :with => options[key] )
|
136
|
+
end
|
137
|
+
end
|
138
|
+
|
139
|
+
def change_page page_name
|
140
|
+
page.find_link( page_name ).click
|
141
|
+
wait_for_page page_name
|
142
|
+
end
|
@@ -0,0 +1,87 @@
|
|
1
|
+
require 'capybara/rspec'
|
2
|
+
#
|
3
|
+
# This file was generated by the `rails generate rspec:install` command. Conventionally, all
|
4
|
+
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
5
|
+
# The generated `.rspec` file contains `--require spec_helper` which will cause this
|
6
|
+
# file to always be loaded, without a need to explicitly require it in any files.
|
7
|
+
#
|
8
|
+
# Given that it is always loaded, you are encouraged to keep this file as
|
9
|
+
# light-weight as possible. Requiring heavyweight dependencies from this file
|
10
|
+
# will add to the boot time of your test suite on EVERY test run, even for an
|
11
|
+
# individual file that may not need all of that loaded. Instead, consider making
|
12
|
+
# a separate helper file that requires the additional dependencies and performs
|
13
|
+
# the additional setup, and require it from the spec files that actually need it.
|
14
|
+
#
|
15
|
+
# The `.rspec` file also contains a few flags that are not defaults but that
|
16
|
+
# users commonly want.
|
17
|
+
#
|
18
|
+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
19
|
+
RSpec.configure do |config|
|
20
|
+
# rspec-expectations config goes here. You can use an alternate
|
21
|
+
# assertion/expectation library such as wrong or the stdlib/minitest
|
22
|
+
# assertions if you prefer.
|
23
|
+
config.expect_with :rspec do |expectations|
|
24
|
+
# This option will default to `true` in RSpec 4. It makes the `description`
|
25
|
+
# and `failure_message` of custom matchers include text for helper methods
|
26
|
+
# defined using `chain`, e.g.:
|
27
|
+
# be_bigger_than(2).and_smaller_than(4).description
|
28
|
+
# # => "be bigger than 2 and smaller than 4"
|
29
|
+
# ...rather than:
|
30
|
+
# # => "be bigger than 2"
|
31
|
+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
32
|
+
end
|
33
|
+
|
34
|
+
# rspec-mocks config goes here. You can use an alternate test double
|
35
|
+
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
36
|
+
config.mock_with :rspec do |mocks|
|
37
|
+
# Prevents you from mocking or stubbing a method that does not exist on
|
38
|
+
# a real object. This is generally recommended, and will default to
|
39
|
+
# `true` in RSpec 4.
|
40
|
+
mocks.verify_partial_doubles = true
|
41
|
+
end
|
42
|
+
|
43
|
+
# The settings below are suggested to provide a good initial experience
|
44
|
+
# with RSpec, but feel free to customize to your heart's content.
|
45
|
+
=begin
|
46
|
+
# These two settings work together to allow you to limit a spec run
|
47
|
+
# to individual examples or groups you care about by tagging them with
|
48
|
+
# `:focus` metadata. When nothing is tagged with `:focus`, all examples
|
49
|
+
# get run.
|
50
|
+
config.filter_run :focus
|
51
|
+
config.run_all_when_everything_filtered = true
|
52
|
+
|
53
|
+
# Limits the available syntax to the non-monkey patched syntax that is recommended.
|
54
|
+
# For more details, see:
|
55
|
+
# - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
|
56
|
+
# - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
57
|
+
# - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching
|
58
|
+
config.disable_monkey_patching!
|
59
|
+
|
60
|
+
# Many RSpec users commonly either run the entire suite or an individual
|
61
|
+
# file, and it's useful to allow more verbose output when running an
|
62
|
+
# individual spec file.
|
63
|
+
if config.files_to_run.one?
|
64
|
+
# Use the documentation formatter for detailed output,
|
65
|
+
# unless a formatter has already been configured
|
66
|
+
# (e.g. via a command-line flag).
|
67
|
+
config.default_formatter = 'doc'
|
68
|
+
end
|
69
|
+
|
70
|
+
# Print the 10 slowest examples and example groups at the
|
71
|
+
# end of the spec run, to help surface which specs are running
|
72
|
+
# particularly slow.
|
73
|
+
config.profile_examples = 10
|
74
|
+
|
75
|
+
# Run specs in random order to surface order dependencies. If you find an
|
76
|
+
# order dependency and want to debug it, you can fix the order by providing
|
77
|
+
# the seed, which is printed after each run.
|
78
|
+
# --seed 1234
|
79
|
+
config.order = :random
|
80
|
+
|
81
|
+
# Seed global randomization in this process using the `--seed` CLI option.
|
82
|
+
# Setting this allows you to use `--seed` to deterministically reproduce
|
83
|
+
# test failures related to randomization by passing the same `--seed` value
|
84
|
+
# as the one that triggered the failure.
|
85
|
+
Kernel.srand config.seed
|
86
|
+
=end
|
87
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: doop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Middleton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-11-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -98,6 +98,7 @@ files:
|
|
98
98
|
- lib/generators/doopgovuk/templates/app/views/demo/_preamble.html.erb
|
99
99
|
- lib/generators/doopgovuk/templates/app/views/demo/_summary.html.erb
|
100
100
|
- lib/generators/doopgovuk/templates/app/views/demo/_your_details.html.erb
|
101
|
+
- lib/generators/doopgovuk/templates/app/views/demo/harness.html.erb
|
101
102
|
- lib/generators/doopgovuk/templates/app/views/demo/index.html.erb
|
102
103
|
- lib/generators/doopgovuk/templates/app/views/demo/index.js.erb
|
103
104
|
- lib/generators/doopgovuk/templates/app/views/doop/_change_answer_tooltip.html.erb
|
@@ -108,6 +109,9 @@ files:
|
|
108
109
|
- lib/generators/doopgovuk/templates/app/views/doop/_question_form.html.erb
|
109
110
|
- lib/generators/doopgovuk/templates/app/views/doop/_tooltip.html.erb
|
110
111
|
- lib/generators/doopgovuk/templates/app/views/layouts/application.html.erb
|
112
|
+
- lib/generators/doopgovuk/templates/spec/features/demo_spec.rb
|
113
|
+
- lib/generators/doopgovuk/templates/spec/rails_helper.rb
|
114
|
+
- lib/generators/doopgovuk/templates/spec/spec_helper.rb
|
111
115
|
- spec/doop_spec.rb
|
112
116
|
- spec/spec_helper.rb
|
113
117
|
homepage: https://github.com/coder36/doop
|