admino 0.0.14 → 0.0.15

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ddd7bdb139e6946fb8f37eb8d0a83c19e54fe087
4
- data.tar.gz: ddadd3a2b601991912cf5b599b715b7775536fb1
3
+ metadata.gz: f09e9e85d2ea64cda674e3eb3866edd304fd0809
4
+ data.tar.gz: 29c6f1710535b002c6b5b4a84aacd3bca59d2616
5
5
  SHA512:
6
- metadata.gz: 5e30786902a7f5aca949cc5f9ef2f61bb552e54a20b6d38aa230bfb8688e5541523b895ebba7a8344871bb5a9886fb7da792e41eaa96f5d1b50d7822c93f41e3
7
- data.tar.gz: 4280a8d787aa37665c98ac5cae715dff3936480f50d0a918ae9d2a001a110fedd7c5019f6a50e3c37f0b171931b6dcc20eab6ec5ee2e0a35c35e4039ca2ad76c
6
+ metadata.gz: e6ae812dfeca160056c9eea25d119d320705b68cb2bcb7bc7641cf9762b3fed56bc490ae8534e7f06eb24f7cf224ad14c637cf2b7cafb73cf86eb988c354f222
7
+ data.tar.gz: 04ddff94d96748c256466b76409005b6ba25ba3171016b849b5859b505a3ac9710c637ddb8cdd31e6581d3658f22fa3d25991a58ebdc2d9ab22651f9fadd37fb
@@ -1,9 +1,12 @@
1
1
  language: ruby
2
2
 
3
3
  rvm:
4
- - "1.9.3"
5
4
  - "2.0.0"
6
5
  - "2.1.1"
6
+ - "2.2.0"
7
7
 
8
- script: "bundle exec rake spec"
8
+ gemfile:
9
+ - "gemfiles/rails_40.gemfile"
10
+ - "gemfiles/rails_42.gemfile"
9
11
 
12
+ script: "bundle exec rake spec"
@@ -0,0 +1,9 @@
1
+ appraise "rails-40" do
2
+ gem "rails", "4.0.0"
3
+ gem "simple_form", "3.0.3"
4
+ end
5
+
6
+ appraise "rails-42" do
7
+ gem "rails", "4.2.1"
8
+ gem "simple_form", "3.1.0"
9
+ end
data/Gemfile CHANGED
@@ -2,5 +2,6 @@ source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
4
 
5
+ gem 'appraisal'
5
6
  gem 'coveralls', require: false
6
7
 
data/README.md CHANGED
@@ -661,3 +661,17 @@ en:
661
661
  destroy: 'Delete'
662
662
  ```
663
663
 
664
+ ## Running tests
665
+
666
+ Install gems:
667
+
668
+ ```
669
+ $ bundle
670
+ $ bundle exec appraisal
671
+ ```
672
+
673
+ Launch tests:
674
+
675
+ ```
676
+ bundle exec appraisal rake
677
+ ```
@@ -0,0 +1,10 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "appraisal"
6
+ gem "coveralls", :require => false
7
+ gem "rails", "4.0.0"
8
+ gem "simple_form", "3.0.3"
9
+
10
+ gemspec :path => "../"
@@ -0,0 +1,167 @@
1
+ PATH
2
+ remote: ../
3
+ specs:
4
+ admino (0.0.14)
5
+ activemodel
6
+ activesupport
7
+ coercible
8
+ showcase (~> 0.2.5)
9
+
10
+ GEM
11
+ remote: https://rubygems.org/
12
+ specs:
13
+ actionmailer (4.0.0)
14
+ actionpack (= 4.0.0)
15
+ mail (~> 2.5.3)
16
+ actionpack (4.0.0)
17
+ activesupport (= 4.0.0)
18
+ builder (~> 3.1.0)
19
+ erubis (~> 2.7.0)
20
+ rack (~> 1.5.2)
21
+ rack-test (~> 0.6.2)
22
+ activemodel (4.0.0)
23
+ activesupport (= 4.0.0)
24
+ builder (~> 3.1.0)
25
+ activerecord (4.0.0)
26
+ activemodel (= 4.0.0)
27
+ activerecord-deprecated_finders (~> 1.0.2)
28
+ activesupport (= 4.0.0)
29
+ arel (~> 4.0.0)
30
+ activerecord-deprecated_finders (1.0.4)
31
+ activesupport (4.0.0)
32
+ i18n (~> 0.6, >= 0.6.4)
33
+ minitest (~> 4.2)
34
+ multi_json (~> 1.3)
35
+ thread_safe (~> 0.1)
36
+ tzinfo (~> 0.3.37)
37
+ appraisal (2.0.1)
38
+ activesupport (>= 3.2.21)
39
+ bundler
40
+ rake
41
+ thor (>= 0.14.0)
42
+ arel (4.0.2)
43
+ builder (3.1.4)
44
+ coderay (1.1.0)
45
+ coercible (1.0.0)
46
+ descendants_tracker (~> 0.0.1)
47
+ coveralls (0.8.1)
48
+ json (~> 1.8)
49
+ rest-client (>= 1.6.8, < 2)
50
+ simplecov (~> 0.10.0)
51
+ term-ansicolor (~> 1.3)
52
+ thor (~> 0.19.1)
53
+ descendants_tracker (0.0.4)
54
+ thread_safe (~> 0.3, >= 0.3.1)
55
+ diff-lcs (1.2.5)
56
+ docile (1.1.5)
57
+ domain_name (0.5.24)
58
+ unf (>= 0.0.5, < 1.0.0)
59
+ erubis (2.7.0)
60
+ hike (1.2.3)
61
+ http-cookie (1.0.2)
62
+ domain_name (~> 0.5)
63
+ i18n (0.7.0)
64
+ json (1.8.2)
65
+ mail (2.5.4)
66
+ mime-types (~> 1.16)
67
+ treetop (~> 1.4.8)
68
+ method_source (0.8.2)
69
+ mime-types (1.25.1)
70
+ mini_portile (0.6.2)
71
+ minitest (4.7.5)
72
+ multi_json (1.11.0)
73
+ netrc (0.10.3)
74
+ nokogiri (1.6.6.2)
75
+ mini_portile (~> 0.6.0)
76
+ polyglot (0.3.5)
77
+ pry (0.10.1)
78
+ coderay (~> 1.1.0)
79
+ method_source (~> 0.8.1)
80
+ slop (~> 3.4)
81
+ rack (1.5.2)
82
+ rack-test (0.6.3)
83
+ rack (>= 1.0)
84
+ rails (4.0.0)
85
+ actionmailer (= 4.0.0)
86
+ actionpack (= 4.0.0)
87
+ activerecord (= 4.0.0)
88
+ activesupport (= 4.0.0)
89
+ bundler (>= 1.3.0, < 2.0)
90
+ railties (= 4.0.0)
91
+ sprockets-rails (~> 2.0.0)
92
+ railties (4.0.0)
93
+ actionpack (= 4.0.0)
94
+ activesupport (= 4.0.0)
95
+ rake (>= 0.8.7)
96
+ thor (>= 0.18.1, < 2.0)
97
+ rake (10.4.2)
98
+ rest-client (1.8.0)
99
+ http-cookie (>= 1.0.2, < 2.0)
100
+ mime-types (>= 1.16, < 3.0)
101
+ netrc (~> 0.7)
102
+ rspec (3.2.0)
103
+ rspec-core (~> 3.2.0)
104
+ rspec-expectations (~> 3.2.0)
105
+ rspec-mocks (~> 3.2.0)
106
+ rspec-core (3.2.3)
107
+ rspec-support (~> 3.2.0)
108
+ rspec-expectations (3.2.1)
109
+ diff-lcs (>= 1.2.0, < 2.0)
110
+ rspec-support (~> 3.2.0)
111
+ rspec-html-matchers (0.7.0)
112
+ nokogiri (~> 1)
113
+ rspec (~> 3)
114
+ rspec-mocks (3.2.1)
115
+ diff-lcs (>= 1.2.0, < 2.0)
116
+ rspec-support (~> 3.2.0)
117
+ rspec-support (3.2.2)
118
+ showcase (0.2.5)
119
+ activesupport
120
+ simple_form (3.0.3)
121
+ actionpack (~> 4.0)
122
+ activemodel (~> 4.0)
123
+ simplecov (0.10.0)
124
+ docile (~> 1.1.0)
125
+ json (~> 1.8)
126
+ simplecov-html (~> 0.10.0)
127
+ simplecov-html (0.10.0)
128
+ slop (3.6.0)
129
+ sprockets (2.12.3)
130
+ hike (~> 1.2)
131
+ multi_json (~> 1.0)
132
+ rack (~> 1.0)
133
+ tilt (~> 1.1, != 1.3.0)
134
+ sprockets-rails (2.0.1)
135
+ actionpack (>= 3.0)
136
+ activesupport (>= 3.0)
137
+ sprockets (~> 2.8)
138
+ term-ansicolor (1.3.0)
139
+ tins (~> 1.0)
140
+ thor (0.19.1)
141
+ thread_safe (0.3.5)
142
+ tilt (1.4.1)
143
+ tins (1.5.1)
144
+ treetop (1.4.15)
145
+ polyglot
146
+ polyglot (>= 0.3.1)
147
+ tzinfo (0.3.44)
148
+ unf (0.1.4)
149
+ unf_ext
150
+ unf_ext (0.0.7.1)
151
+
152
+ PLATFORMS
153
+ ruby
154
+
155
+ DEPENDENCIES
156
+ actionpack
157
+ admino!
158
+ appraisal
159
+ bundler (~> 1.3)
160
+ coveralls
161
+ i18n
162
+ pry
163
+ rails (= 4.0.0)
164
+ rake
165
+ rspec
166
+ rspec-html-matchers
167
+ simple_form (= 3.0.3)
@@ -0,0 +1,10 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "appraisal"
6
+ gem "coveralls", :require => false
7
+ gem "rails", "4.2.1"
8
+ gem "simple_form", "3.1.0"
9
+
10
+ gemspec :path => "../"
@@ -0,0 +1,183 @@
1
+ PATH
2
+ remote: ../
3
+ specs:
4
+ admino (0.0.14)
5
+ activemodel
6
+ activesupport
7
+ coercible
8
+ showcase (~> 0.2.5)
9
+
10
+ GEM
11
+ remote: https://rubygems.org/
12
+ specs:
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)
29
+ erubis (~> 2.7.0)
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
+ appraisal (2.0.1)
49
+ activesupport (>= 3.2.21)
50
+ bundler
51
+ rake
52
+ thor (>= 0.14.0)
53
+ arel (6.0.0)
54
+ builder (3.2.2)
55
+ coderay (1.1.0)
56
+ coercible (1.0.0)
57
+ descendants_tracker (~> 0.0.1)
58
+ coveralls (0.8.1)
59
+ json (~> 1.8)
60
+ rest-client (>= 1.6.8, < 2)
61
+ simplecov (~> 0.10.0)
62
+ term-ansicolor (~> 1.3)
63
+ thor (~> 0.19.1)
64
+ descendants_tracker (0.0.4)
65
+ thread_safe (~> 0.3, >= 0.3.1)
66
+ diff-lcs (1.2.5)
67
+ docile (1.1.5)
68
+ domain_name (0.5.24)
69
+ unf (>= 0.0.5, < 1.0.0)
70
+ erubis (2.7.0)
71
+ globalid (0.3.5)
72
+ activesupport (>= 4.1.0)
73
+ http-cookie (1.0.2)
74
+ domain_name (~> 0.5)
75
+ i18n (0.7.0)
76
+ json (1.8.2)
77
+ loofah (2.0.1)
78
+ nokogiri (>= 1.5.9)
79
+ mail (2.6.3)
80
+ mime-types (>= 1.16, < 3)
81
+ method_source (0.8.2)
82
+ mime-types (2.5)
83
+ mini_portile (0.6.2)
84
+ minitest (5.6.1)
85
+ netrc (0.10.3)
86
+ nokogiri (1.6.6.2)
87
+ mini_portile (~> 0.6.0)
88
+ pry (0.10.1)
89
+ coderay (~> 1.1.0)
90
+ method_source (~> 0.8.1)
91
+ slop (~> 3.4)
92
+ rack (1.6.0)
93
+ rack-test (0.6.3)
94
+ rack (>= 1.0)
95
+ rails (4.2.1)
96
+ actionmailer (= 4.2.1)
97
+ actionpack (= 4.2.1)
98
+ actionview (= 4.2.1)
99
+ activejob (= 4.2.1)
100
+ activemodel (= 4.2.1)
101
+ activerecord (= 4.2.1)
102
+ activesupport (= 4.2.1)
103
+ bundler (>= 1.3.0, < 2.0)
104
+ railties (= 4.2.1)
105
+ sprockets-rails
106
+ rails-deprecated_sanitizer (1.0.3)
107
+ activesupport (>= 4.2.0.alpha)
108
+ rails-dom-testing (1.0.6)
109
+ activesupport (>= 4.2.0.beta, < 5.0)
110
+ nokogiri (~> 1.6.0)
111
+ rails-deprecated_sanitizer (>= 1.0.1)
112
+ rails-html-sanitizer (1.0.2)
113
+ loofah (~> 2.0)
114
+ railties (4.2.1)
115
+ actionpack (= 4.2.1)
116
+ activesupport (= 4.2.1)
117
+ rake (>= 0.8.7)
118
+ thor (>= 0.18.1, < 2.0)
119
+ rake (10.4.2)
120
+ rest-client (1.8.0)
121
+ http-cookie (>= 1.0.2, < 2.0)
122
+ mime-types (>= 1.16, < 3.0)
123
+ netrc (~> 0.7)
124
+ rspec (3.2.0)
125
+ rspec-core (~> 3.2.0)
126
+ rspec-expectations (~> 3.2.0)
127
+ rspec-mocks (~> 3.2.0)
128
+ rspec-core (3.2.3)
129
+ rspec-support (~> 3.2.0)
130
+ rspec-expectations (3.2.1)
131
+ diff-lcs (>= 1.2.0, < 2.0)
132
+ rspec-support (~> 3.2.0)
133
+ rspec-html-matchers (0.7.0)
134
+ nokogiri (~> 1)
135
+ rspec (~> 3)
136
+ rspec-mocks (3.2.1)
137
+ diff-lcs (>= 1.2.0, < 2.0)
138
+ rspec-support (~> 3.2.0)
139
+ rspec-support (3.2.2)
140
+ showcase (0.2.5)
141
+ activesupport
142
+ simple_form (3.1.0)
143
+ actionpack (~> 4.0)
144
+ activemodel (~> 4.0)
145
+ simplecov (0.10.0)
146
+ docile (~> 1.1.0)
147
+ json (~> 1.8)
148
+ simplecov-html (~> 0.10.0)
149
+ simplecov-html (0.10.0)
150
+ slop (3.6.0)
151
+ sprockets (3.0.3)
152
+ rack (~> 1.0)
153
+ sprockets-rails (2.2.4)
154
+ actionpack (>= 3.0)
155
+ activesupport (>= 3.0)
156
+ sprockets (>= 2.8, < 4.0)
157
+ term-ansicolor (1.3.0)
158
+ tins (~> 1.0)
159
+ thor (0.19.1)
160
+ thread_safe (0.3.5)
161
+ tins (1.5.1)
162
+ tzinfo (1.2.2)
163
+ thread_safe (~> 0.1)
164
+ unf (0.1.4)
165
+ unf_ext
166
+ unf_ext (0.0.7.1)
167
+
168
+ PLATFORMS
169
+ ruby
170
+
171
+ DEPENDENCIES
172
+ actionpack
173
+ admino!
174
+ appraisal
175
+ bundler (~> 1.3)
176
+ coveralls
177
+ i18n
178
+ pry
179
+ rails (= 4.2.1)
180
+ rake
181
+ rspec
182
+ rspec-html-matchers
183
+ simple_form (= 3.1.0)
@@ -1,5 +1,7 @@
1
+ require 'active_support/concern'
1
2
  require 'active_model/naming'
2
3
  require 'active_model/translation'
4
+ require 'active_model/conversion'
3
5
  require 'active_support/hash_with_indifferent_access'
4
6
  require 'active_support/core_ext/hash'
5
7
 
@@ -10,6 +12,7 @@ module Admino
10
12
  class Base
11
13
  extend ActiveModel::Naming
12
14
  extend ActiveModel::Translation
15
+ include ActiveModel::Conversion
13
16
  extend Dsl
14
17
 
15
18
  attr_reader :params
@@ -1,4 +1,4 @@
1
1
  module Admino
2
- VERSION = "0.0.14"
2
+ VERSION = "0.0.15"
3
3
  end
4
4
 
@@ -22,9 +22,22 @@ describe 'Action View integration' do
22
22
  table.action :show, '/foo', 'Show'
23
23
  end
24
24
  end
25
- expect(result).to eq <<-HTML.strip
26
- <table><thead><tr><th role=\"title\"><a class=\"is-desc\" href=\"/?sort_order=asc&amp;sorting=by_title\">Title</a></th><th role=\"actions\">Actions</th></tr></thead><tbody><tr class=\"is-even\"><td role=\"title\" sorting=\"by_title\">Post 1</td><td role=\"actions\"><a href=\"/foo\" role=\"show\">Show</a></td></tr><tr class=\"is-odd\"><td role=\"title\" sorting=\"by_title\">Post 2</td><td role=\"actions\"><a href=\"/foo\" role=\"show\">Show</a></td></tr></tbody></table>
27
- HTML
25
+
26
+ expect(result).to have_tag(:table) do
27
+ with_tag 'thead th:first-child', with: { role: 'title' }
28
+ with_tag 'thead th:last-child', with: { role: 'actions' }
29
+
30
+ with_tag 'th:first-child a', with: { class: 'is-desc', href: '/?sort_order=asc&sorting=by_title' }, text: 'Title'
31
+ with_tag 'th:last-child', text: 'Actions'
32
+
33
+ with_tag 'tbody tr:first-child', with: { class: 'is-even' }
34
+ with_tag 'tbody tr:last-child', with: { class: 'is-odd' }
35
+
36
+ with_tag 'tbody tr:first-child td:first-child', with: { role: 'title' }, text: 'Post 1'
37
+ with_tag 'tbody tr:first-child td:last-child', with: { role: 'actions' }
38
+
39
+ with_tag 'tbody tr:first-child td:last-child a', with: { role: 'show', href: '/foo' }
40
+ end
28
41
  end
29
42
  end
30
43
 
@@ -45,9 +58,17 @@ describe 'Action View integration' do
45
58
  end
46
59
  end
47
60
 
48
- expect(result).to eq <<-HTML.strip
49
- Bar: <a href="/?query%5Bbar%5D=empty">Empty</a><a class="is-active" href="/?">One</a><a href="/?query%5Bbar%5D=two">Two</a>
50
- HTML
61
+ expect(result).to have_tag(:a, with: { href: '/?query%5Bbar%5D=empty' }) do
62
+ with_text 'Empty'
63
+ end
64
+
65
+ expect(result).to have_tag(:a, with: { class: 'is-active', href: '/?' }) do
66
+ with_text 'One'
67
+ end
68
+
69
+ expect(result).to have_tag(:a, with: { href: '/?query%5Bbar%5D=two' }) do
70
+ with_text 'Two'
71
+ end
51
72
  end
52
73
  end
53
74
 
@@ -66,9 +87,13 @@ describe 'Action View integration' do
66
87
  result << scope.link
67
88
  end
68
89
 
69
- expect(result).to eq <<-HTML.strip
70
- <a class=\"is-desc\" href=\"/?sort_order=asc&amp;sorting=by_title\">By title</a><a href=\"/?sort_order=asc&amp;sorting=by_date\">By date</a>
71
- HTML
90
+ expect(result).to have_tag(:a, with: { class: 'is-desc', href: '/?sort_order=asc&sorting=by_title' }) do
91
+ with_text 'By title'
92
+ end
93
+
94
+ expect(result).to have_tag(:a, with: { href: '/?sort_order=asc&sorting=by_date' }) do
95
+ with_text 'By date'
96
+ end
72
97
  end
73
98
  end
74
99
 
@@ -85,9 +110,9 @@ describe 'Action View integration' do
85
110
  f.text_field :foo
86
111
  end
87
112
 
88
- expect(result).to eq <<-HTML.strip
89
- <form accept-charset=\"UTF-8\" action=\"/?p=1\" class=\"new_query\" id=\"new_query\" method=\"get\"><div style=\"display:none\"><input name=\"utf8\" type=\"hidden\" value=\"&#x2713;\" /></div><input id=\"query_foo\" name=\"query[foo]\" type=\"text\" value=\"test\" /></form>
90
- HTML
113
+ expect(result).to have_tag(:form, with: { action: '/?p=1', method: 'get' }) do
114
+ with_tag 'input', with: { type: 'text', value: 'test', name: 'query[foo]' }
115
+ end
91
116
  end
92
117
  end
93
118
 
@@ -104,9 +129,9 @@ describe 'Action View integration' do
104
129
  f.input :foo
105
130
  end
106
131
 
107
- expect(result).to eq <<-HTML.strip
108
- <form accept-charset=\"UTF-8\" action=\"/?p=1\" class=\"simple_form new_query\" id=\"new_query\" method=\"get\"><div style=\"display:none\"><input name=\"utf8\" type=\"hidden\" value=\"&#x2713;\" /></div><div class=\"input string required query_foo\"><label class=\"string required\" for=\"query_foo\"><abbr title=\"required\">*</abbr> Foo</label><input aria-required=\"true\" class=\"string required\" id=\"query_foo\" name=\"query[foo]\" required=\"required\" type=\"text\" value=\"test\" /></div></form>
109
- HTML
132
+ expect(result).to have_tag(:form, with: { action: '/?p=1', method: 'get' }) do
133
+ with_tag 'input', with: { type: 'text', value: 'test', name: 'query[foo]' }
134
+ end
110
135
  end
111
136
  end
112
137
  end
@@ -54,6 +54,41 @@ module Admino
54
54
  expect(result).to have_tag(:label, text: 'NAME')
55
55
  end
56
56
  end
57
+
58
+ describe '#simple_form' do
59
+ let(:result) do
60
+ presenter.simple_form do |form|
61
+ form.input(:foo)
62
+ end
63
+ end
64
+
65
+ before do
66
+ I18n.backend.store_translations(
67
+ :en,
68
+ query: { attributes: { test_query: { foo: 'NAME' } } }
69
+ )
70
+ end
71
+
72
+ it 'renders a form pointing to the current URL' do
73
+ expect(result).to have_tag(:form, with: { action: '/?foo=bar' })
74
+ end
75
+
76
+ it 'renders a form with method GET' do
77
+ expect(result).to have_tag(:form, with: { method: 'get' })
78
+ end
79
+
80
+ it 'renders inputs with a query[] name prefix' do
81
+ expect(result).to have_tag(:input, with: { type: 'text', name: 'query[foo]' })
82
+ end
83
+
84
+ it 'prefills inputs with query value' do
85
+ expect(result).to have_tag(:input, with: { type: 'text', value: 'value' })
86
+ end
87
+
88
+ it 'it generates labels in the :query I18n space' do
89
+ expect(result).to have_tag(:label, content: 'NAME')
90
+ end
91
+ end
57
92
  end
58
93
  end
59
94
  end
@@ -68,9 +68,14 @@ class Post < Struct.new(:key, :dom_id)
68
68
  end
69
69
  end
70
70
 
71
+ module Rails
72
+ def self.env
73
+ OpenStruct.new(development?: false)
74
+ end
75
+ end
76
+
71
77
  require 'action_view'
72
78
  require 'simple_form'
73
- require 'simple_form/action_view_extensions/form_helper'
74
79
 
75
80
  class RailsViewContext < ActionView::Base
76
81
  include ActionView::Helpers::TagHelper
@@ -87,6 +92,8 @@ class RailsViewContext < ActionView::Base
87
92
  end
88
93
 
89
94
  RSpec.configure do |c|
95
+ c.include RSpecHtmlMatchers
96
+
90
97
  c.before(:each) do
91
98
  I18n.backend = I18n::Backend::Simple.new
92
99
  end
metadata CHANGED
@@ -1,181 +1,181 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: admino
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.14
4
+ version: 0.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefano Verna
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-22 00:00:00.000000000 Z
11
+ date: 2015-05-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: showcase
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: 0.2.5
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.2.5
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: activesupport
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: activemodel
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: coercible
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: bundler
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ~>
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
75
  version: '1.3'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ~>
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '1.3'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rake
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - '>='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rspec
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - '>='
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - '>='
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: pry
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - '>='
115
+ - - ">="
116
116
  - !ruby/object:Gem::Version
117
117
  version: '0'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - '>='
122
+ - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: i18n
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - '>='
129
+ - - ">="
130
130
  - !ruby/object:Gem::Version
131
131
  version: '0'
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - '>='
136
+ - - ">="
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: rspec-html-matchers
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
- - - '>='
143
+ - - ">="
144
144
  - !ruby/object:Gem::Version
145
145
  version: '0'
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
- - - '>='
150
+ - - ">="
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0'
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: actionpack
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
- - - '>='
157
+ - - ">="
158
158
  - !ruby/object:Gem::Version
159
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
166
  version: '0'
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: simple_form
169
169
  requirement: !ruby/object:Gem::Requirement
170
170
  requirements:
171
- - - '>='
171
+ - - ">="
172
172
  - !ruby/object:Gem::Version
173
173
  version: '0'
174
174
  type: :development
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
- - - '>='
178
+ - - ">="
179
179
  - !ruby/object:Gem::Version
180
180
  version: '0'
181
181
  description: Make administrative views creation less repetitive
@@ -185,8 +185,9 @@ executables: []
185
185
  extensions: []
186
186
  extra_rdoc_files: []
187
187
  files:
188
- - .gitignore
189
- - .travis.yml
188
+ - ".gitignore"
189
+ - ".travis.yml"
190
+ - Appraisals
190
191
  - CHANGELOG.md
191
192
  - CONTRIBUTING.md
192
193
  - Gemfile
@@ -195,6 +196,10 @@ files:
195
196
  - Rakefile
196
197
  - TODO.md
197
198
  - admino.gemspec
199
+ - gemfiles/rails_40.gemfile
200
+ - gemfiles/rails_40.gemfile.lock
201
+ - gemfiles/rails_42.gemfile
202
+ - gemfiles/rails_42.gemfile.lock
198
203
  - lib/admino.rb
199
204
  - lib/admino/action_view_extension.rb
200
205
  - lib/admino/query.rb
@@ -215,7 +220,6 @@ files:
215
220
  - lib/admino/table/row.rb
216
221
  - lib/admino/version.rb
217
222
  - logo.jpg
218
- - occurred at /Users/stefanoverna/.dotfiles/vim/rspec_formatter.rb
219
223
  - spec/admino/integration_spec.rb
220
224
  - spec/admino/query/base_presenter_spec.rb
221
225
  - spec/admino/query/base_spec.rb
@@ -240,12 +244,12 @@ require_paths:
240
244
  - lib
241
245
  required_ruby_version: !ruby/object:Gem::Requirement
242
246
  requirements:
243
- - - '>='
247
+ - - ">="
244
248
  - !ruby/object:Gem::Version
245
249
  version: '0'
246
250
  required_rubygems_version: !ruby/object:Gem::Requirement
247
251
  requirements:
248
- - - '>='
252
+ - - ">="
249
253
  - !ruby/object:Gem::Version
250
254
  version: '0'
251
255
  requirements: []