freeform 2.0.3 → 2.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/Gemfile.lock +120 -107
- data/Rakefile +4 -9
- data/freeform.gemspec +2 -1
- data/lib/freeform/form.rb +0 -2
- data/lib/freeform/form/model.rb +0 -2
- data/lib/freeform/form/property.rb +0 -2
- data/lib/freeform/version.rb +1 -1
- data/spec/acceptance_spec.rb +3 -3
- data/spec/builder/builder_spec.rb +10 -10
- data/spec/dummy/config/environments/test.rb +1 -1
- data/spec/form/persistence_spec.rb +4 -4
- data/spec/form/property_spec.rb +9 -9
- data/spec/javascript_spec.rb +1 -1
- data/spec/spec_helper.rb +4 -1
- metadata +21 -7
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZmI1YTBjNzc4ODg4M2Y3NGU4YTZjNTYxY2Q3ODcxZGJiZTBmM2E3OQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZmMxMzAwZjVjYjkyZTI3ZDk5YTNmZTJiN2I5NDg1OTg0MGFiZjQyMA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ODNiNDVmNGQ1NTQxN2U2ZTQ3Y2Q3ZmQyYzM0MzM4NGU3YTMxNDQ3MDQ4MzJh
|
10
|
+
Yzk2NmE3M2UwZjU1MzFjZDlhNGMxMTFiNTIyMDBmYjZiYzc5MGUyMWExODkx
|
11
|
+
MDY4NDU0M2RhNjc0OTdhMjVmMTU1MmYxMTAxMmIyZjNmOTZhY2M=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NzA2OTNjNzkxZjNhNTZhZmY4ZWM1NTE5MmQzMWU2YjdlYTZjYzYxODFlMzA1
|
14
|
+
MWE4YzJhMDAxN2EwNGYwMTIzZmQxMDZhZWY2Y2FkMzUwYTZlMjUxZGZlOTIw
|
15
|
+
ZDM4YzIyMjEyYWI1MzUyNGFiZTZjMWE0YWI3MjQyMDkzMzZhMGU=
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
freeform (2.0.
|
4
|
+
freeform (2.0.3)
|
5
5
|
activemodel
|
6
6
|
formtastic
|
7
7
|
rails (>= 3.2.0)
|
@@ -10,129 +10,141 @@ PATH
|
|
10
10
|
GEM
|
11
11
|
remote: https://rubygems.org/
|
12
12
|
specs:
|
13
|
-
actionmailer (
|
14
|
-
actionpack (=
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
13
|
+
actionmailer (4.2.1)
|
14
|
+
actionpack (= 4.2.1)
|
15
|
+
actionview (= 4.2.1)
|
16
|
+
activejob (= 4.2.1)
|
17
|
+
mail (~> 2.5, >= 2.5.4)
|
18
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
19
|
+
actionpack (4.2.1)
|
20
|
+
actionview (= 4.2.1)
|
21
|
+
activesupport (= 4.2.1)
|
22
|
+
rack (~> 1.6)
|
23
|
+
rack-test (~> 0.6.2)
|
24
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
25
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.1)
|
26
|
+
actionview (4.2.1)
|
27
|
+
activesupport (= 4.2.1)
|
28
|
+
builder (~> 3.1)
|
20
29
|
erubis (~> 2.7.0)
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
activemodel (
|
27
|
-
activesupport (=
|
28
|
-
builder (~> 3.
|
29
|
-
activerecord (
|
30
|
-
activemodel (=
|
31
|
-
activesupport (=
|
32
|
-
arel (~>
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
capybara (1.1.4)
|
30
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
31
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.1)
|
32
|
+
activejob (4.2.1)
|
33
|
+
activesupport (= 4.2.1)
|
34
|
+
globalid (>= 0.3.0)
|
35
|
+
activemodel (4.2.1)
|
36
|
+
activesupport (= 4.2.1)
|
37
|
+
builder (~> 3.1)
|
38
|
+
activerecord (4.2.1)
|
39
|
+
activemodel (= 4.2.1)
|
40
|
+
activesupport (= 4.2.1)
|
41
|
+
arel (~> 6.0)
|
42
|
+
activesupport (4.2.1)
|
43
|
+
i18n (~> 0.7)
|
44
|
+
json (~> 1.7, >= 1.7.7)
|
45
|
+
minitest (~> 5.1)
|
46
|
+
thread_safe (~> 0.3, >= 0.3.4)
|
47
|
+
tzinfo (~> 1.1)
|
48
|
+
arel (6.0.0)
|
49
|
+
builder (3.2.2)
|
50
|
+
capybara (2.4.4)
|
43
51
|
mime-types (>= 1.16)
|
44
52
|
nokogiri (>= 1.3.3)
|
45
53
|
rack (>= 1.0.0)
|
46
54
|
rack-test (>= 0.5.4)
|
47
|
-
|
48
|
-
|
49
|
-
childprocess (0.5.3)
|
50
|
-
ffi (~> 1.0, >= 1.0.11)
|
55
|
+
xpath (~> 2.0)
|
56
|
+
cliver (0.3.2)
|
51
57
|
diff-lcs (1.2.5)
|
52
58
|
erubis (2.7.0)
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
i18n (0.
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
59
|
+
formtastic (3.1.3)
|
60
|
+
actionpack (>= 3.2.13)
|
61
|
+
globalid (0.3.5)
|
62
|
+
activesupport (>= 4.1.0)
|
63
|
+
i18n (0.7.0)
|
64
|
+
json (1.8.2)
|
65
|
+
loofah (2.0.2)
|
66
|
+
nokogiri (>= 1.5.9)
|
67
|
+
mail (2.6.3)
|
68
|
+
mime-types (>= 1.16, < 3)
|
63
69
|
metaclass (0.0.4)
|
64
|
-
mime-types (
|
65
|
-
mini_portile (0.
|
66
|
-
|
70
|
+
mime-types (2.6.1)
|
71
|
+
mini_portile (0.6.2)
|
72
|
+
minitest (5.7.0)
|
73
|
+
mocha (1.1.0)
|
67
74
|
metaclass (~> 0.0.1)
|
68
|
-
multi_json (1.
|
69
|
-
nokogiri (1.6.
|
70
|
-
mini_portile (~> 0.
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
rack-test (0.6.
|
75
|
+
multi_json (1.11.0)
|
76
|
+
nokogiri (1.6.6.2)
|
77
|
+
mini_portile (~> 0.6.0)
|
78
|
+
poltergeist (1.6.0)
|
79
|
+
capybara (~> 2.1)
|
80
|
+
cliver (~> 0.3.1)
|
81
|
+
multi_json (~> 1.0)
|
82
|
+
websocket-driver (>= 0.2.0)
|
83
|
+
rack (1.6.1)
|
84
|
+
rack-test (0.6.3)
|
78
85
|
rack (>= 1.0)
|
79
|
-
rails (
|
80
|
-
actionmailer (=
|
81
|
-
actionpack (=
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
86
|
+
rails (4.2.1)
|
87
|
+
actionmailer (= 4.2.1)
|
88
|
+
actionpack (= 4.2.1)
|
89
|
+
actionview (= 4.2.1)
|
90
|
+
activejob (= 4.2.1)
|
91
|
+
activemodel (= 4.2.1)
|
92
|
+
activerecord (= 4.2.1)
|
93
|
+
activesupport (= 4.2.1)
|
94
|
+
bundler (>= 1.3.0, < 2.0)
|
95
|
+
railties (= 4.2.1)
|
96
|
+
sprockets-rails
|
97
|
+
rails-deprecated_sanitizer (1.0.3)
|
98
|
+
activesupport (>= 4.2.0.alpha)
|
99
|
+
rails-dom-testing (1.0.6)
|
100
|
+
activesupport (>= 4.2.0.beta, < 5.0)
|
101
|
+
nokogiri (~> 1.6.0)
|
102
|
+
rails-deprecated_sanitizer (>= 1.0.1)
|
103
|
+
rails-html-sanitizer (1.0.2)
|
104
|
+
loofah (~> 2.0)
|
105
|
+
railties (4.2.1)
|
106
|
+
actionpack (= 4.2.1)
|
107
|
+
activesupport (= 4.2.1)
|
91
108
|
rake (>= 0.8.7)
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
rspec-expectations (
|
100
|
-
|
101
|
-
rspec-
|
102
|
-
rspec-expectations (2.14.5)
|
109
|
+
thor (>= 0.18.1, < 2.0)
|
110
|
+
rake (10.4.2)
|
111
|
+
rspec (2.99.0)
|
112
|
+
rspec-core (~> 2.99.0)
|
113
|
+
rspec-expectations (~> 2.99.0)
|
114
|
+
rspec-mocks (~> 2.99.0)
|
115
|
+
rspec-collection_matchers (1.1.2)
|
116
|
+
rspec-expectations (>= 2.99.0.beta1)
|
117
|
+
rspec-core (2.99.2)
|
118
|
+
rspec-expectations (2.99.2)
|
103
119
|
diff-lcs (>= 1.1.3, < 2.0)
|
104
|
-
rspec-mocks (2.
|
105
|
-
rspec-rails (2.
|
120
|
+
rspec-mocks (2.99.3)
|
121
|
+
rspec-rails (2.99.0)
|
106
122
|
actionpack (>= 3.0)
|
107
123
|
activemodel (>= 3.0)
|
108
124
|
activesupport (>= 3.0)
|
109
125
|
railties (>= 3.0)
|
110
|
-
rspec-
|
111
|
-
rspec-
|
112
|
-
rspec-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
websocket (~> 1.0.4)
|
119
|
-
simple_form (2.1.1)
|
120
|
-
actionpack (~> 3.0)
|
121
|
-
activemodel (~> 3.0)
|
122
|
-
sprockets (2.2.2)
|
123
|
-
hike (~> 1.2)
|
124
|
-
multi_json (~> 1.0)
|
126
|
+
rspec-collection_matchers
|
127
|
+
rspec-core (~> 2.99.0)
|
128
|
+
rspec-expectations (~> 2.99.0)
|
129
|
+
rspec-mocks (~> 2.99.0)
|
130
|
+
simple_form (3.1.0)
|
131
|
+
actionpack (~> 4.0)
|
132
|
+
activemodel (~> 4.0)
|
133
|
+
sprockets (3.1.0)
|
125
134
|
rack (~> 1.0)
|
126
|
-
|
127
|
-
|
135
|
+
sprockets-rails (2.3.1)
|
136
|
+
actionpack (>= 3.0)
|
137
|
+
activesupport (>= 3.0)
|
138
|
+
sprockets (>= 2.8, < 4.0)
|
139
|
+
sqlite3 (1.3.10)
|
128
140
|
thor (0.19.1)
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
websocket (1.
|
135
|
-
xpath (0.
|
141
|
+
thread_safe (0.3.5)
|
142
|
+
tzinfo (1.2.2)
|
143
|
+
thread_safe (~> 0.1)
|
144
|
+
websocket-driver (0.5.4)
|
145
|
+
websocket-extensions (>= 0.1.0)
|
146
|
+
websocket-extensions (0.1.2)
|
147
|
+
xpath (2.0.0)
|
136
148
|
nokogiri (~> 1.3)
|
137
149
|
|
138
150
|
PLATFORMS
|
@@ -140,9 +152,10 @@ PLATFORMS
|
|
140
152
|
|
141
153
|
DEPENDENCIES
|
142
154
|
bundler (~> 1.3)
|
143
|
-
capybara
|
155
|
+
capybara
|
144
156
|
freeform!
|
145
157
|
mocha
|
158
|
+
poltergeist
|
146
159
|
rake
|
147
160
|
rspec
|
148
161
|
rspec-rails (~> 2.6)
|
data/Rakefile
CHANGED
@@ -5,6 +5,7 @@ rescue LoadError
|
|
5
5
|
end
|
6
6
|
|
7
7
|
require 'rdoc/task'
|
8
|
+
require 'rspec/core/rake_task'
|
8
9
|
|
9
10
|
RDoc::Task.new(:rdoc) do |rdoc|
|
10
11
|
rdoc.rdoc_dir = 'rdoc'
|
@@ -16,14 +17,8 @@ end
|
|
16
17
|
|
17
18
|
Bundler::GemHelper.install_tasks
|
18
19
|
|
19
|
-
|
20
|
-
|
21
|
-
Rake::TestTask.new(:test) do |t|
|
22
|
-
t.libs << 'lib'
|
23
|
-
t.libs << 'test'
|
24
|
-
t.pattern = 'test/**/*_test.rb'
|
25
|
-
t.verbose = false
|
20
|
+
RSpec::Core::RakeTask.new(:spec) do |t|
|
21
|
+
t.pattern = Dir.glob('spec/**/*_spec.rb')
|
26
22
|
end
|
27
23
|
|
28
|
-
|
29
|
-
task default: :test
|
24
|
+
task default: :spec
|
data/freeform.gemspec
CHANGED
@@ -28,6 +28,7 @@ Gem::Specification.new do |spec|
|
|
28
28
|
spec.add_development_dependency "rspec"
|
29
29
|
spec.add_development_dependency "rspec-rails", "~> 2.6"
|
30
30
|
spec.add_development_dependency "mocha"
|
31
|
-
spec.add_development_dependency "capybara"
|
31
|
+
spec.add_development_dependency "capybara"
|
32
|
+
spec.add_development_dependency "poltergeist"
|
32
33
|
end
|
33
34
|
|
data/lib/freeform/form.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
require 'forwardable'
|
2
1
|
require 'ostruct'
|
3
2
|
require 'active_model'
|
4
3
|
require 'freeform/form/form_input_key'
|
@@ -10,7 +9,6 @@ require 'freeform/form/validation'
|
|
10
9
|
module FreeForm
|
11
10
|
class FormInvalid < StandardError; end
|
12
11
|
class Form
|
13
|
-
extend Forwardable
|
14
12
|
extend ActiveModel::Naming
|
15
13
|
extend ActiveModel::Callbacks
|
16
14
|
include ActiveModel::Conversion
|
data/lib/freeform/form/model.rb
CHANGED
data/lib/freeform/version.rb
CHANGED
data/spec/acceptance_spec.rb
CHANGED
@@ -307,7 +307,7 @@ describe FreeForm::Form do
|
|
307
307
|
|
308
308
|
describe "#save" do
|
309
309
|
it "should return false on 'save'" do
|
310
|
-
form.save.should
|
310
|
+
form.save.should be_falsey
|
311
311
|
end
|
312
312
|
|
313
313
|
it "does not update company model" do
|
@@ -370,7 +370,7 @@ describe FreeForm::Form do
|
|
370
370
|
|
371
371
|
describe "#save" do
|
372
372
|
it "should return true on 'save'" do
|
373
|
-
form.save.should
|
373
|
+
form.save.should be_truthy
|
374
374
|
end
|
375
375
|
|
376
376
|
it "updates company model" do
|
@@ -435,7 +435,7 @@ describe FreeForm::Form do
|
|
435
435
|
|
436
436
|
describe "#save" do
|
437
437
|
it "should return true on 'save'" do
|
438
|
-
form.save.should
|
438
|
+
form.save.should be_truthy
|
439
439
|
end
|
440
440
|
|
441
441
|
it "updates company model" do
|
@@ -51,14 +51,14 @@ require "spec_helper"
|
|
51
51
|
|
52
52
|
context "with no options", :no_options => true do
|
53
53
|
subject do
|
54
|
-
builder.new(:item, form, template, {}
|
54
|
+
builder.new(:item, form, template, {})
|
55
55
|
end
|
56
56
|
|
57
57
|
describe '#link_to_add', :link_to_add => true do
|
58
58
|
it "behaves similar to a Rails link_to" do
|
59
|
-
subject.link_to_add("Add", :tasks).should eq('<a
|
60
|
-
subject.link_to_add("Add", :tasks, :class => "foo", :href => "url").should eq('<a
|
61
|
-
subject.link_to_add(:tasks) { "Add" }.should eq('<a
|
59
|
+
subject.link_to_add("Add", :tasks).should eq('<a class="add_nested_form" data-association="tasks" data-blueprint-id="tasks_fields_blueprint" href="javascript:void(0)">Add</a>')
|
60
|
+
subject.link_to_add("Add", :tasks, :class => "foo", :href => "url").should eq('<a class="foo add_nested_form" data-association="tasks" data-blueprint-id="tasks_fields_blueprint" href="url">Add</a>')
|
61
|
+
subject.link_to_add(:tasks) { "Add" }.should eq('<a class="add_nested_form" data-association="tasks" data-blueprint-id="tasks_fields_blueprint" href="javascript:void(0)">Add</a>')
|
62
62
|
end
|
63
63
|
|
64
64
|
it 'raises ArgumentError when missing association is provided' do
|
@@ -76,16 +76,16 @@ require "spec_helper"
|
|
76
76
|
|
77
77
|
describe '#link_to_remove', :link_to_remove => true do
|
78
78
|
it "behaves similar to a Rails link_to" do
|
79
|
-
subject.link_to_remove("Remove").should eq('<input
|
80
|
-
subject.link_to_remove("Remove", :class => "foo", :href => "url").should eq('<input
|
81
|
-
subject.link_to_remove { "Remove" }.should eq('<input
|
79
|
+
subject.link_to_remove("Remove").should eq('<input value="0" type="hidden" name="item[_destroy]" id="item__destroy" /><a class="remove_nested_form" href="javascript:void(0)">Remove</a>')
|
80
|
+
subject.link_to_remove("Remove", :class => "foo", :href => "url").should eq('<input value="0" type="hidden" name="item[_destroy]" id="item__destroy" /><a class="foo remove_nested_form" href="url">Remove</a>')
|
81
|
+
subject.link_to_remove { "Remove" }.should eq('<input value="0" type="hidden" name="item[_destroy]" id="item__destroy" /><a class="remove_nested_form" href="javascript:void(0)">Remove</a>')
|
82
82
|
end
|
83
83
|
|
84
84
|
it 'has data-association attribute' do
|
85
85
|
form.build_task
|
86
86
|
subject.fields_for(:tasks, :builder => builder) do |tf|
|
87
87
|
tf.link_to_remove 'Remove'
|
88
|
-
end.should match '<a.+data-association="tasks"
|
88
|
+
end.should match '<a.+data-association="tasks".+>Remove</a>'
|
89
89
|
end
|
90
90
|
|
91
91
|
context 'when there is more than one nested level' do
|
@@ -96,7 +96,7 @@ require "spec_helper"
|
|
96
96
|
tf.fields_for(:milestones, :builder => builder) do |mf|
|
97
97
|
mf.link_to_remove 'Remove'
|
98
98
|
end
|
99
|
-
end.should match '<a.+data-association="milestones"
|
99
|
+
end.should match '<a.+data-association="milestones".+>Remove</a>'
|
100
100
|
end
|
101
101
|
end
|
102
102
|
end
|
@@ -181,7 +181,7 @@ require "spec_helper"
|
|
181
181
|
end
|
182
182
|
|
183
183
|
context "with options", :with_options => true do
|
184
|
-
subject { builder.new(:item, form, template, {}
|
184
|
+
subject { builder.new(:item, form, template, {}) }
|
185
185
|
|
186
186
|
context "when model_object given" do
|
187
187
|
it "should use it instead of new generated" do
|
@@ -13,7 +13,7 @@ Dummy::Application.configure do
|
|
13
13
|
config.eager_load = false
|
14
14
|
|
15
15
|
# Configure static asset server for tests with Cache-Control for performance.
|
16
|
-
config.
|
16
|
+
config.serve_static_files = true
|
17
17
|
config.static_cache_control = "public, max-age=3600"
|
18
18
|
|
19
19
|
# Show full error reports and disable caching.
|
@@ -85,7 +85,7 @@ describe FreeForm::Form do
|
|
85
85
|
|
86
86
|
describe "#save" do
|
87
87
|
it "should return false on 'save'" do
|
88
|
-
form.save.should
|
88
|
+
form.save.should be_falsey
|
89
89
|
end
|
90
90
|
|
91
91
|
it "should not persist task" do
|
@@ -135,7 +135,7 @@ describe FreeForm::Form do
|
|
135
135
|
|
136
136
|
describe "#save" do
|
137
137
|
it "should return false on 'save'" do
|
138
|
-
form.save.should
|
138
|
+
form.save.should be_falsey
|
139
139
|
end
|
140
140
|
|
141
141
|
it "should not persist task" do
|
@@ -186,7 +186,7 @@ describe FreeForm::Form do
|
|
186
186
|
|
187
187
|
describe "#save" do
|
188
188
|
it "should return true on 'save'" do
|
189
|
-
form.save.should
|
189
|
+
form.save.should be_truthy
|
190
190
|
end
|
191
191
|
|
192
192
|
it "should persist task" do
|
@@ -239,7 +239,7 @@ describe FreeForm::Form do
|
|
239
239
|
|
240
240
|
describe "#save" do
|
241
241
|
it "should return true on 'save'" do
|
242
|
-
form.save.should
|
242
|
+
form.save.should be_truthy
|
243
243
|
end
|
244
244
|
|
245
245
|
it "should persist task" do
|
data/spec/form/property_spec.rb
CHANGED
@@ -88,42 +88,42 @@ describe FreeForm::Property do
|
|
88
88
|
end
|
89
89
|
|
90
90
|
it "has destroy as false by default" do
|
91
|
-
form._destroy.should
|
91
|
+
form._destroy.should be_falsey
|
92
92
|
end
|
93
93
|
|
94
94
|
it "has marked_for_destruction? as false by default" do
|
95
|
-
form.marked_for_destruction?.should
|
95
|
+
form.marked_for_destruction?.should be_falsey
|
96
96
|
end
|
97
97
|
|
98
98
|
it "can be marked for destruction" do
|
99
|
-
form.marked_for_destruction?.should
|
99
|
+
form.marked_for_destruction?.should be_falsey
|
100
100
|
form.mark_for_destruction
|
101
|
-
form.marked_for_destruction?.should
|
101
|
+
form.marked_for_destruction?.should be_truthy
|
102
102
|
end
|
103
103
|
|
104
104
|
it "interprets '0' is not marked for destruction" do
|
105
105
|
form.fill({:_destroy => "0"})
|
106
|
-
form.marked_for_destruction?.should
|
106
|
+
form.marked_for_destruction?.should be_falsey
|
107
107
|
end
|
108
108
|
|
109
109
|
it "interprets 'false' is not marked for destruction" do
|
110
110
|
form.fill({:_destroy => "false"})
|
111
|
-
form.marked_for_destruction?.should
|
111
|
+
form.marked_for_destruction?.should be_falsey
|
112
112
|
end
|
113
113
|
|
114
114
|
it "interprets '1' is marked for destruction" do
|
115
115
|
form.fill({:_destroy => "1"})
|
116
|
-
form.marked_for_destruction?.should
|
116
|
+
form.marked_for_destruction?.should be_truthy
|
117
117
|
end
|
118
118
|
|
119
119
|
it "interprets 'true' is marked for destruction" do
|
120
120
|
form.fill({:_destroy => "true"})
|
121
|
-
form.marked_for_destruction?.should
|
121
|
+
form.marked_for_destruction?.should be_truthy
|
122
122
|
end
|
123
123
|
|
124
124
|
it "interprets '2' is marked for destruction" do
|
125
125
|
form.fill({:_destroy => "2"})
|
126
|
-
form.marked_for_destruction?.should
|
126
|
+
form.marked_for_destruction?.should be_truthy
|
127
127
|
end
|
128
128
|
end
|
129
129
|
end
|
data/spec/javascript_spec.rb
CHANGED
@@ -43,7 +43,7 @@ describe 'JavaScript Behavior', :js => true do
|
|
43
43
|
it 'emits remove event for current association' do
|
44
44
|
visit url
|
45
45
|
2.times { click_link 'Add new task' }
|
46
|
-
click_link 'Remove'
|
46
|
+
click_link 'Remove', match: :first
|
47
47
|
|
48
48
|
page.should have_content 'Removed task field'
|
49
49
|
page.should_not have_content 'Removed milestone field'
|
data/spec/spec_helper.rb
CHANGED
@@ -11,6 +11,7 @@ require 'active_model'
|
|
11
11
|
require 'rails/all'
|
12
12
|
require 'rspec/rails'
|
13
13
|
require 'capybara/rspec'
|
14
|
+
require 'capybara/poltergeist'
|
14
15
|
|
15
16
|
spec = Gem::Specification.find_by_name("freeform")
|
16
17
|
gem_root = spec.gem_dir
|
@@ -18,9 +19,11 @@ Dir[("#{gem_root}/spec/support/**/*.rb")].each {|f| require f}
|
|
18
19
|
|
19
20
|
Rails.backtrace_cleaner.remove_silencers!
|
20
21
|
|
21
|
-
Capybara.javascript_driver = :
|
22
|
+
Capybara.javascript_driver = :poltergeist
|
23
|
+
|
22
24
|
RSpec.configure do |config|
|
23
25
|
config.mock_with :rspec
|
26
|
+
config.infer_spec_type_from_file_location!
|
24
27
|
end
|
25
28
|
|
26
29
|
RSpec::Matchers.define :exist_in_database do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: freeform
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- brycesenz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-07-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -154,16 +154,30 @@ dependencies:
|
|
154
154
|
name: capybara
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
156
156
|
requirements:
|
157
|
-
- -
|
157
|
+
- - ! '>='
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version: '
|
159
|
+
version: '0'
|
160
160
|
type: :development
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
|
-
- -
|
164
|
+
- - ! '>='
|
165
165
|
- !ruby/object:Gem::Version
|
166
|
-
version: '
|
166
|
+
version: '0'
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: poltergeist
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - ! '>='
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '0'
|
174
|
+
type: :development
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - ! '>='
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '0'
|
167
181
|
description: Decouple your forms from your domain models
|
168
182
|
email:
|
169
183
|
- bryce.senz@gmail.com
|
@@ -285,7 +299,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
285
299
|
version: '0'
|
286
300
|
requirements: []
|
287
301
|
rubyforge_project:
|
288
|
-
rubygems_version: 2.
|
302
|
+
rubygems_version: 2.4.6
|
289
303
|
signing_key:
|
290
304
|
specification_version: 4
|
291
305
|
summary: FreeForm lets you compose forms however you like, explicitly guiding how
|