volt 0.8.15 → 0.8.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +11 -0
- data/CHANGELOG.md +11 -0
- data/Gemfile +1 -1
- data/Guardfile +2 -3
- data/Rakefile +1 -4
- data/VERSION +1 -1
- data/app/volt/controllers/notices_controller.rb +1 -1
- data/app/volt/tasks/live_query/data_store.rb +7 -7
- data/app/volt/tasks/live_query/live_query.rb +7 -9
- data/app/volt/tasks/live_query/live_query_pool.rb +13 -12
- data/app/volt/tasks/live_query/query_tracker.rb +4 -5
- data/app/volt/tasks/query_tasks.rb +9 -11
- data/app/volt/tasks/store_tasks.rb +4 -4
- data/app/volt/tasks/user_tasks.rb +1 -1
- data/bin/volt +2 -2
- data/lib/volt.rb +3 -7
- data/lib/volt/assets/test.rb +1 -2
- data/lib/volt/benchmark/benchmark.rb +3 -3
- data/lib/volt/boot.rb +1 -1
- data/lib/volt/cli.rb +18 -18
- data/lib/volt/cli/asset_compile.rb +8 -10
- data/lib/volt/cli/generate.rb +9 -11
- data/lib/volt/cli/new_gem.rb +51 -51
- data/lib/volt/config.rb +2 -3
- data/lib/volt/console.rb +1 -1
- data/lib/volt/controllers/model_controller.rb +6 -6
- data/lib/volt/data_stores/data_store.rb +1 -1
- data/lib/volt/data_stores/mongo_driver.rb +1 -1
- data/lib/volt/extra_core/array.rb +2 -2
- data/lib/volt/extra_core/blank.rb +1 -2
- data/lib/volt/extra_core/extra_core.rb +1 -1
- data/lib/volt/extra_core/inflector/methods.rb +0 -1
- data/lib/volt/extra_core/logger.rb +13 -7
- data/lib/volt/extra_core/numeric.rb +1 -1
- data/lib/volt/extra_core/string.rb +7 -7
- data/lib/volt/extra_core/stringify_keys.rb +5 -5
- data/lib/volt/models.rb +2 -2
- data/lib/volt/models/array_model.rb +18 -19
- data/lib/volt/models/cursor.rb +0 -1
- data/lib/volt/models/model.rb +17 -35
- data/lib/volt/models/model_hash_behaviour.rb +0 -2
- data/lib/volt/models/model_state.rb +1 -1
- data/lib/volt/models/model_wrapper.rb +1 -1
- data/lib/volt/models/persistors/array_store.rb +26 -13
- data/lib/volt/models/persistors/base.rb +1 -1
- data/lib/volt/models/persistors/flash.rb +2 -2
- data/lib/volt/models/persistors/local_store.rb +2 -3
- data/lib/volt/models/persistors/model_store.rb +7 -6
- data/lib/volt/models/persistors/params.rb +2 -2
- data/lib/volt/models/persistors/query/query_listener.rb +2 -0
- data/lib/volt/models/persistors/query/query_listener_pool.rb +1 -1
- data/lib/volt/models/persistors/store.rb +1 -2
- data/lib/volt/models/persistors/store_state.rb +2 -3
- data/lib/volt/models/url.rb +17 -16
- data/lib/volt/models/validations.rb +11 -14
- data/lib/volt/models/validators/length_validator.rb +3 -3
- data/lib/volt/models/validators/presence_validator.rb +2 -2
- data/lib/volt/page/bindings/attribute_binding.rb +2 -3
- data/lib/volt/page/bindings/base_binding.rb +1 -1
- data/lib/volt/page/bindings/each_binding.rb +8 -9
- data/lib/volt/page/bindings/event_binding.rb +2 -3
- data/lib/volt/page/bindings/template_binding.rb +8 -7
- data/lib/volt/page/bindings/template_binding/grouped_controllers.rb +2 -1
- data/lib/volt/page/channel.rb +10 -10
- data/lib/volt/page/channel_stub.rb +1 -1
- data/lib/volt/page/document.rb +0 -1
- data/lib/volt/page/document_events.rb +4 -4
- data/lib/volt/page/page.rb +26 -19
- data/lib/volt/page/string_template_renderer.rb +2 -2
- data/lib/volt/page/sub_context.rb +10 -4
- data/lib/volt/page/targets/attribute_section.rb +1 -1
- data/lib/volt/page/targets/attribute_target.rb +1 -2
- data/lib/volt/page/targets/base_section.rb +4 -4
- data/lib/volt/page/targets/binding_document/base_node.rb +0 -1
- data/lib/volt/page/targets/binding_document/component_node.rb +4 -5
- data/lib/volt/page/targets/dom_section.rb +21 -22
- data/lib/volt/page/targets/dom_target.rb +1 -1
- data/lib/volt/page/targets/dom_template.rb +11 -12
- data/lib/volt/page/targets/helpers/comment_searchers.rb +7 -8
- data/lib/volt/page/tasks.rb +0 -1
- data/lib/volt/page/template_renderer.rb +1 -1
- data/lib/volt/page/url_tracker.rb +3 -3
- data/lib/volt/reactive/computation.rb +5 -11
- data/lib/volt/reactive/dependency.rb +1 -3
- data/lib/volt/reactive/eventable.rb +17 -4
- data/lib/volt/reactive/hash_dependency.rb +1 -0
- data/lib/volt/reactive/reactive_accessors.rb +0 -1
- data/lib/volt/reactive/reactive_array.rb +20 -25
- data/lib/volt/reactive/reactive_hash.rb +3 -3
- data/lib/volt/router/routes.rb +11 -13
- data/lib/volt/server.rb +17 -17
- data/lib/volt/server/component_handler.rb +2 -2
- data/lib/volt/server/component_templates.rb +8 -8
- data/lib/volt/server/html_parser/attribute_scope.rb +9 -10
- data/lib/volt/server/html_parser/if_view_scope.rb +2 -2
- data/lib/volt/server/html_parser/sandlebars_parser.rb +14 -14
- data/lib/volt/server/html_parser/textarea_scope.rb +1 -2
- data/lib/volt/server/html_parser/view_handler.rb +1 -1
- data/lib/volt/server/html_parser/view_parser.rb +1 -1
- data/lib/volt/server/html_parser/view_scope.rb +10 -10
- data/lib/volt/server/rack/asset_files.rb +15 -16
- data/lib/volt/server/rack/component_code.rb +2 -2
- data/lib/volt/server/rack/component_html_renderer.rb +0 -1
- data/lib/volt/server/rack/component_paths.rb +13 -10
- data/lib/volt/server/rack/index_files.rb +4 -4
- data/lib/volt/server/rack/opal_files.rb +4 -5
- data/lib/volt/server/rack/source_map_server.rb +3 -3
- data/lib/volt/server/socket_connection_handler.rb +3 -4
- data/lib/volt/server/socket_connection_handler_stub.rb +1 -1
- data/lib/volt/spec/setup.rb +3 -3
- data/lib/volt/store/mongo.rb +2 -2
- data/lib/volt/tasks/task_handler.rb +3 -3
- data/lib/volt/utils/generic_counting_pool.rb +2 -2
- data/lib/volt/utils/generic_pool.rb +7 -8
- data/lib/volt/utils/local_storage.rb +4 -4
- data/lib/volt/volt/environment.rb +1 -1
- data/spec/apps/file_loading/app/shared/config/dependencies.rb +1 -1
- data/spec/apps/kitchen_sink/Gemfile +0 -2
- data/spec/apps/kitchen_sink/app/main/config/routes.rb +5 -5
- data/spec/apps/kitchen_sink/app/main/controllers/main_controller.rb +7 -6
- data/spec/apps/kitchen_sink/app/main/controllers/todos_controller.rb +3 -4
- data/spec/controllers/reactive_accessors_spec.rb +4 -4
- data/spec/extra_core/inflector_spec.rb +1 -1
- data/spec/extra_core/string_transformation_test_cases.rb +23 -24
- data/spec/extra_core/string_transformations_spec.rb +11 -12
- data/spec/integration/bindings_spec.rb +15 -15
- data/spec/integration/list_spec.rb +12 -13
- data/spec/integration/templates_spec.rb +3 -3
- data/spec/models/model_spec.rb +74 -80
- data/spec/models/persistors/params_spec.rb +2 -2
- data/spec/models/persistors/store_spec.rb +4 -4
- data/spec/models/validations_spec.rb +14 -23
- data/spec/page/bindings/content_binding_spec.rb +7 -8
- data/spec/page/bindings/template_binding_spec.rb +22 -24
- data/spec/page/sub_context_spec.rb +2 -2
- data/spec/reactive/computation_spec.rb +3 -3
- data/spec/reactive/reactive_array_spec.rb +12 -12
- data/spec/router/routes_spec.rb +45 -48
- data/spec/server/html_parser/sandlebars_parser_spec.rb +42 -42
- data/spec/server/html_parser/view_parser_spec.rb +132 -153
- data/spec/server/rack/asset_files_spec.rb +9 -8
- data/spec/server/rack/component_paths_spec.rb +5 -5
- data/spec/server/rack/rack_requests_spec.rb +3 -3
- data/spec/spec_helper.rb +1 -1
- data/spec/tasks/live_query_spec.rb +4 -5
- data/spec/tasks/query_tasks.rb +2 -4
- data/spec/tasks/query_tracker_spec.rb +29 -29
- data/spec/templates/targets/binding_document/component_node_spec.rb +1 -1
- data/spec/utils/generic_counting_pool_spec.rb +4 -4
- data/spec/utils/generic_pool_spec.rb +12 -12
- data/templates/component/config/routes.rb +2 -2
- data/templates/component/controllers/main_controller.rb +7 -6
- data/templates/newgem/app/newgem/config/dependencies.rb +1 -1
- data/templates/newgem/app/newgem/config/routes.rb +1 -1
- data/templates/project/app/main/config/routes.rb +2 -2
- data/templates/project/app/main/controllers/main_controller.rb +7 -6
- data/templates/project/spec/sample_spec.rb +2 -2
- data/volt.gemspec +32 -33
- metadata +3 -4
- data/lib/volt/extra_core/log.rb +0 -56
- data/lib/volt/extra_core/try.rb +0 -31
@@ -21,12 +21,11 @@ module Volt
|
|
21
21
|
|
22
22
|
# TODO: This is to work around opal issue #500
|
23
23
|
if RUBY_PLATFORM == 'opal'
|
24
|
-
args.pop if args.last
|
24
|
+
args.pop if args.last.nil?
|
25
25
|
end
|
26
26
|
|
27
|
-
|
28
27
|
args.each_with_index do |arg, index|
|
29
|
-
last = (args.size-1) == index
|
28
|
+
last = (args.size - 1) == index
|
30
29
|
|
31
30
|
if last
|
32
31
|
# return, creating if needed
|
@@ -48,7 +47,7 @@ module Volt
|
|
48
47
|
new_item = create(*args)
|
49
48
|
end
|
50
49
|
|
51
|
-
|
50
|
+
transform_item(new_item)
|
52
51
|
end
|
53
52
|
|
54
53
|
# Allow other pools to override how the created item gets stored.
|
@@ -77,19 +76,19 @@ module Volt
|
|
77
76
|
args.each_with_index do |arg, index|
|
78
77
|
stack << section
|
79
78
|
|
80
|
-
if args.size-1 == index
|
79
|
+
if args.size - 1 == index
|
81
80
|
section.delete(arg)
|
82
81
|
else
|
83
82
|
section = section[arg]
|
84
83
|
end
|
85
84
|
end
|
86
85
|
|
87
|
-
(stack.size-1).downto(1) do |index|
|
86
|
+
(stack.size - 1).downto(1) do |index|
|
88
87
|
node = stack[index]
|
89
|
-
parent = stack[index-1]
|
88
|
+
parent = stack[index - 1]
|
90
89
|
|
91
90
|
if node.size == 0
|
92
|
-
parent.delete(args[index-1])
|
91
|
+
parent.delete(args[index - 1])
|
93
92
|
end
|
94
93
|
end
|
95
94
|
end
|
@@ -2,10 +2,10 @@ if RUBY_PLATFORM == 'opal'
|
|
2
2
|
module Volt
|
3
3
|
module LocalStorage
|
4
4
|
def self.[](key)
|
5
|
-
|
5
|
+
`
|
6
6
|
var val = localStorage.getItem(key);
|
7
7
|
return val === null ? nil : val;
|
8
|
-
|
8
|
+
`
|
9
9
|
end
|
10
10
|
|
11
11
|
def self.[]=(key, value)
|
@@ -18,11 +18,11 @@ if RUBY_PLATFORM == 'opal'
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def self.delete(key)
|
21
|
-
|
21
|
+
`
|
22
22
|
var val = localStorage.getItem(key);
|
23
23
|
localStorage.removeItem(key);
|
24
24
|
return val === null ? nil : val;
|
25
|
-
|
25
|
+
`
|
26
26
|
end
|
27
27
|
end
|
28
28
|
end
|
@@ -1 +1 @@
|
|
1
|
-
component 'bootstrap'
|
1
|
+
component 'bootstrap'
|
@@ -10,7 +10,6 @@ gem 'volt-bootstrap'
|
|
10
10
|
# Simple theme for bootstrap, remove to theme yourself.
|
11
11
|
gem 'volt-bootstrap-jumbotron-theme'
|
12
12
|
|
13
|
-
|
14
13
|
# Server for MRI
|
15
14
|
platform :mri do
|
16
15
|
gem 'thin', '~> 1.6.0'
|
@@ -22,7 +21,6 @@ platform :jruby do
|
|
22
21
|
gem 'jubilee'
|
23
22
|
end
|
24
23
|
|
25
|
-
|
26
24
|
#---------------------
|
27
25
|
# Needed at the moment
|
28
26
|
gem 'volt-sockjs', require: false, platforms: :mri
|
@@ -1,9 +1,9 @@
|
|
1
1
|
# See https://github.com/voltrb/volt#routes for more info on routes
|
2
2
|
|
3
|
-
get
|
4
|
-
get
|
5
|
-
get
|
6
|
-
get
|
3
|
+
get '/bindings/{{_route_test}}', _action: 'bindings'
|
4
|
+
get '/bindings', _action: 'bindings'
|
5
|
+
get '/store', _action: 'store'
|
6
|
+
get '/todos', _controller: 'todos'
|
7
7
|
|
8
8
|
# The main route, this should be last. It will match any params not previously matched.
|
9
|
-
get '/', {}
|
9
|
+
get '/', {}
|
@@ -2,10 +2,11 @@ class MainController < Volt::ModelController
|
|
2
2
|
model :page
|
3
3
|
|
4
4
|
private
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
5
|
+
|
6
|
+
# the main template contains a #template binding that shows another
|
7
|
+
# template. This is the path to that template. It may change based
|
8
|
+
# on the params._controller and params._action values.
|
9
|
+
def main_path
|
10
|
+
params._controller.or('main') + '/' + params._action.or('index')
|
11
|
+
end
|
11
12
|
end
|
@@ -2,16 +2,15 @@ class TodosController < Volt::ModelController
|
|
2
2
|
model :page
|
3
3
|
|
4
4
|
def add_todo
|
5
|
-
|
5
|
+
_todos << { name: _new_todo }
|
6
6
|
self._new_todo = ''
|
7
7
|
end
|
8
8
|
|
9
9
|
def remove_todo(todo)
|
10
|
-
|
10
|
+
_todos.delete(todo)
|
11
11
|
end
|
12
12
|
|
13
13
|
def completed
|
14
|
-
|
14
|
+
_todos.count(&:_completed)
|
15
15
|
end
|
16
|
-
|
17
16
|
end
|
@@ -8,14 +8,14 @@ class TestReactiveAccessors
|
|
8
8
|
end
|
9
9
|
|
10
10
|
describe Volt::ReactiveAccessors do
|
11
|
-
it
|
11
|
+
it 'should assign a reactive value' do
|
12
12
|
inst = TestReactiveAccessors.new
|
13
13
|
|
14
14
|
inst._name = 'Ryan'
|
15
15
|
expect(inst._name).to eq('Ryan')
|
16
16
|
end
|
17
17
|
|
18
|
-
it
|
18
|
+
it 'should start nil' do
|
19
19
|
inst = TestReactiveAccessors.new
|
20
20
|
|
21
21
|
expect(inst._name).to eq(nil)
|
@@ -31,10 +31,10 @@ describe Volt::ReactiveAccessors do
|
|
31
31
|
|
32
32
|
inst._name = 'Ryan'
|
33
33
|
Volt::Computation.flush!
|
34
|
-
expect(values).to eq([nil,'Ryan'])
|
34
|
+
expect(values).to eq([nil, 'Ryan'])
|
35
35
|
|
36
36
|
inst._name = 'Stout'
|
37
37
|
Volt::Computation.flush!
|
38
|
-
expect(values).to eq([nil,'Ryan','Stout'])
|
38
|
+
expect(values).to eq([nil, 'Ryan', 'Stout'])
|
39
39
|
end
|
40
40
|
end
|
@@ -1,41 +1,40 @@
|
|
1
1
|
CamelToUnderscore = {
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
2
|
+
'Product' => 'product',
|
3
|
+
'SpecialGuest' => 'special_guest',
|
4
|
+
'ApplicationController' => 'application_controller',
|
5
|
+
'Area51Controller' => 'area51_controller'
|
6
6
|
}
|
7
7
|
|
8
8
|
UnderscoreToLowerCamel = {
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
9
|
+
'product' => 'product',
|
10
|
+
'special_guest' => 'specialGuest',
|
11
|
+
'application_controller' => 'applicationController',
|
12
|
+
'area51_controller' => 'area51Controller'
|
13
13
|
}
|
14
14
|
|
15
15
|
SymbolToLowerCamel = {
|
16
|
-
:
|
17
|
-
:
|
18
|
-
:
|
19
|
-
:
|
16
|
+
product: 'product',
|
17
|
+
special_guest: 'specialGuest',
|
18
|
+
application_controller: 'applicationController',
|
19
|
+
area51_controller: 'area51Controller'
|
20
20
|
}
|
21
21
|
|
22
22
|
CamelToUnderscoreWithoutReverse = {
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
23
|
+
'HTMLTidy' => 'html_tidy',
|
24
|
+
'HTMLTidyGenerator' => 'html_tidy_generator',
|
25
|
+
'FreeBSD' => 'free_bsd',
|
26
|
+
'HTML' => 'html',
|
27
|
+
'ForceXMLController' => 'force_xml_controller'
|
28
28
|
}
|
29
29
|
|
30
30
|
CamelWithModuleToUnderscoreWithSlash = {
|
31
|
-
|
32
|
-
|
33
|
-
|
31
|
+
'Admin::Product' => 'admin/product',
|
32
|
+
'Users::Commission::Department' => 'users/commission/department',
|
33
|
+
'UsersSection::CommissionDepartment' => 'users_section/commission_department'
|
34
34
|
}
|
35
35
|
|
36
36
|
UnderscoresToDashes = {
|
37
|
-
|
38
|
-
|
39
|
-
|
37
|
+
'street' => 'street',
|
38
|
+
'street_address' => 'street-address',
|
39
|
+
'person_street_address' => 'person-street-address'
|
40
40
|
}
|
41
|
-
|
@@ -3,47 +3,46 @@ require 'spec_helper'
|
|
3
3
|
require 'extra_core/string_transformation_test_cases'
|
4
4
|
require 'volt/extra_core/string'
|
5
5
|
|
6
|
-
describe
|
6
|
+
describe '#camelize' do
|
7
7
|
CamelToUnderscore.each do |camel, underscore|
|
8
|
-
it
|
8
|
+
it 'camelizes' do
|
9
9
|
expect(underscore.camelize).to eq(camel)
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
|
-
it
|
13
|
+
it 'camelizes lower' do
|
14
14
|
expect('capital_city'.camelize(:lower)).to eq('capitalCity')
|
15
15
|
end
|
16
16
|
|
17
|
-
it
|
17
|
+
it 'camelizes upper' do
|
18
18
|
expect('capital_city'.camelize(:upper)).to eq('CapitalCity')
|
19
19
|
end
|
20
20
|
|
21
|
-
it
|
21
|
+
it 'camelizes upper default' do
|
22
22
|
expect('capital_city'.camelize).to eq('CapitalCity')
|
23
23
|
end
|
24
24
|
|
25
25
|
UnderscoreToLowerCamel.each do |underscored, lower_camel|
|
26
|
-
it
|
26
|
+
it 'camelizes lower' do
|
27
27
|
expect(underscored.camelize(:lower)).to eq(lower_camel)
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
31
31
|
UnderscoresToDashes.each do |underscored, dasherized|
|
32
|
-
it
|
32
|
+
it 'dasherizes' do
|
33
33
|
expect(underscored.dasherize).to eq(dasherized)
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
37
|
CamelToUnderscore.each do |camel, underscore|
|
38
|
-
it
|
38
|
+
it 'underscores' do
|
39
39
|
expect(camel.underscore).to eq(underscore)
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
43
|
-
it
|
44
|
-
expect(
|
45
|
-
expect(
|
43
|
+
it 'underscores acronyms' do
|
44
|
+
expect('HTMLTidy'.underscore).to eq('html_tidy')
|
45
|
+
expect('HTMLTidyGenerator'.underscore).to eq('html_tidy_generator')
|
46
46
|
end
|
47
47
|
|
48
48
|
end
|
49
|
-
|
@@ -1,26 +1,26 @@
|
|
1
1
|
if ENV['BROWSER']
|
2
2
|
require 'spec_helper'
|
3
3
|
|
4
|
-
describe
|
5
|
-
it
|
4
|
+
describe 'bindings test', type: :feature do
|
5
|
+
it 'should load the page' do
|
6
6
|
visit '/'
|
7
7
|
|
8
8
|
expect(page).to have_content('Kitchen Sink')
|
9
9
|
end
|
10
10
|
|
11
|
-
describe
|
11
|
+
describe 'text/fields' do
|
12
12
|
it 'should load the bindings page and update bindings' do
|
13
13
|
visit '/'
|
14
14
|
|
15
15
|
click_link 'Bindings'
|
16
16
|
|
17
17
|
# Fill in one field and see if it updates the rest
|
18
|
-
fill_in('pageName1', :
|
18
|
+
fill_in('pageName1', with: 'Page bindings')
|
19
19
|
expect(find('#pageName1').value).to eq('Page bindings')
|
20
20
|
expect(find('#pageName2').value).to eq('Page bindings')
|
21
21
|
expect(find('#pageName3')).to have_content('Page bindings')
|
22
22
|
|
23
|
-
fill_in('pageName2', :
|
23
|
+
fill_in('pageName2', with: 'Update everywhere')
|
24
24
|
expect(find('#pageName1').value).to eq('Update everywhere')
|
25
25
|
expect(find('#pageName2').value).to eq('Update everywhere')
|
26
26
|
expect(find('#pageName3')).to have_content('Update everywhere')
|
@@ -38,12 +38,12 @@ if ENV['BROWSER']
|
|
38
38
|
end
|
39
39
|
|
40
40
|
# Fill in one field and see if it updates the rest
|
41
|
-
fill_in('paramsName1', :
|
41
|
+
fill_in('paramsName1', with: 'Params bindings')
|
42
42
|
expect(find('#paramsName1').value).to eq('Params bindings')
|
43
43
|
expect(find('#paramsName2').value).to eq('Params bindings')
|
44
44
|
expect(find('#paramsName3')).to have_content('Params bindings')
|
45
45
|
|
46
|
-
fill_in('paramsName2', :
|
46
|
+
fill_in('paramsName2', with: 'Update everywhere')
|
47
47
|
expect(find('#paramsName1').value).to eq('Update everywhere')
|
48
48
|
expect(find('#paramsName2').value).to eq('Update everywhere')
|
49
49
|
expect(find('#paramsName3')).to have_content('Update everywhere')
|
@@ -65,12 +65,12 @@ if ENV['BROWSER']
|
|
65
65
|
end
|
66
66
|
|
67
67
|
# Fill in one field and see if it updates the rest
|
68
|
-
fill_in('routesName1', :
|
68
|
+
fill_in('routesName1', with: 'Routes bindings')
|
69
69
|
expect(find('#routesName1').value).to eq('Routes bindings')
|
70
70
|
expect(find('#routesName2').value).to eq('Routes bindings')
|
71
71
|
expect(find('#routesName3')).to have_content('Routes bindings')
|
72
72
|
|
73
|
-
fill_in('routesName2', :
|
73
|
+
fill_in('routesName2', with: 'bound_url')
|
74
74
|
expect(find('#routesName1').value).to eq('bound_url')
|
75
75
|
expect(find('#routesName2').value).to eq('bound_url')
|
76
76
|
expect(find('#routesName3')).to have_content('bound_url')
|
@@ -93,12 +93,12 @@ if ENV['BROWSER']
|
|
93
93
|
click_link 'Bindings'
|
94
94
|
|
95
95
|
# Fill in one field and see if it updates the rest
|
96
|
-
fill_in('textareaName1', :
|
96
|
+
fill_in('textareaName1', with: 'Page bindings')
|
97
97
|
expect(find('#textareaName1').value).to eq('Page bindings')
|
98
98
|
expect(find('#textareaName2').value).to eq('Page bindings')
|
99
99
|
expect(find('#textareaName3')).to have_content('Page bindings')
|
100
100
|
|
101
|
-
fill_in('textareaName2', :
|
101
|
+
fill_in('textareaName2', with: 'Update everywhere')
|
102
102
|
expect(find('#textareaName1').value).to eq('Update everywhere')
|
103
103
|
expect(find('#textareaName2').value).to eq('Update everywhere')
|
104
104
|
expect(find('#textareaName3')).to have_content('Update everywhere')
|
@@ -110,12 +110,12 @@ if ENV['BROWSER']
|
|
110
110
|
click_link 'Bindings'
|
111
111
|
|
112
112
|
# Fill in one field and see if it updates the rest
|
113
|
-
fill_in('localstoreName1', :
|
113
|
+
fill_in('localstoreName1', with: 'Page bindings')
|
114
114
|
expect(find('#localstoreName1').value).to eq('Page bindings')
|
115
115
|
expect(find('#localstoreName2').value).to eq('Page bindings')
|
116
116
|
expect(find('#localstoreName3')).to have_content('Page bindings')
|
117
117
|
|
118
|
-
fill_in('localstoreName2', :
|
118
|
+
fill_in('localstoreName2', with: 'Update everywhere')
|
119
119
|
expect(find('#localstoreName1').value).to eq('Update everywhere')
|
120
120
|
expect(find('#localstoreName2').value).to eq('Update everywhere')
|
121
121
|
expect(find('#localstoreName3')).to have_content('Update everywhere')
|
@@ -143,7 +143,7 @@ if ENV['BROWSER']
|
|
143
143
|
# end
|
144
144
|
end
|
145
145
|
|
146
|
-
describe
|
146
|
+
describe 'check boxes' do
|
147
147
|
it 'should load the bindings page and update checkboxes' do
|
148
148
|
visit '/'
|
149
149
|
|
@@ -193,7 +193,7 @@ if ENV['BROWSER']
|
|
193
193
|
end
|
194
194
|
end
|
195
195
|
|
196
|
-
describe
|
196
|
+
describe 'content escaping' do
|
197
197
|
it 'should escape in a tripple stash' do
|
198
198
|
visit '/'
|
199
199
|
|