dandify 0.0.1 → 3.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +7 -8
  3. data/Rakefile +2 -2
  4. data/app/assets/stylesheets/spree/backend/dandify.scss +55 -0
  5. data/app/controllers/spree/admin/stylesheets_controller.rb +17 -8
  6. data/app/controllers/spree/stylesheets_controller.rb +3 -3
  7. data/app/helpers/spree/admin/navigation_helper_decorator.rb +20 -4
  8. data/app/helpers/spree/admin/stylesheet_helper.rb +12 -2
  9. data/app/models/spree/stylesheet_version.rb +2 -1
  10. data/app/models/spree/unknown_user.rb +11 -0
  11. data/app/models/spree/user_decorator.rb +1 -1
  12. data/app/models/spree/user_identifier.rb +13 -0
  13. data/app/overrides/spree/admin/shared/{_configuration_menu → sub_menu/_configuration}/add_dandify_to_admin_configuration_sidebar.html.erb.deface +1 -1
  14. data/app/views/spree/admin/stylesheets/_form.html.erb +29 -7
  15. data/app/views/spree/admin/stylesheets/_versions.html.erb +16 -19
  16. data/app/views/spree/admin/stylesheets/edit.html.erb +4 -5
  17. data/app/views/spree/admin/stylesheets/new.html.erb +4 -5
  18. data/app/views/spree/admin/stylesheets/show.html.erb +22 -8
  19. data/config/locales/en.yml +39 -27
  20. data/config/routes.rb +1 -1
  21. data/db/migrate/20140617221725_add_paper_trail_versions.rb +5 -5
  22. data/lib/dandify.rb +0 -1
  23. data/lib/dandify/version.rb +1 -1
  24. data/lib/generators/dandify/install/install_generator.rb +10 -9
  25. data/spec/controllers/spree/admin/stylesheets_controller_spec.rb +109 -55
  26. data/spec/controllers/spree/stylesheets_controller_spec.rb +26 -22
  27. data/spec/features/buttons_spec.rb +69 -0
  28. data/spec/features/dandy_style_spec.rb +1 -0
  29. data/spec/features/managing_stylesheet_spec.rb +86 -0
  30. data/spec/features/sidebar_spec.rb +17 -9
  31. data/spec/helpers/admin/navigation_helper_spec.rb +13 -7
  32. data/spec/helpers/admin/stylesheet_helper_spec.rb +47 -0
  33. data/spec/models/spree/blank_stylesheet_spec.rb +5 -3
  34. data/spec/models/spree/stylesheet_spec.rb +73 -69
  35. data/spec/spec_helper.rb +13 -12
  36. metadata +47 -59
  37. data/app/assets/stylesheets/spree/backend/dandify.css +0 -42
  38. data/config/spring.rb +0 -1
  39. data/lib/tasks/dandify_tasks.rake +0 -4
  40. data/spec/features/managing_stylsheet_spec.rb +0 -80
  41. data/spec/features/viewing_admin_spec.rb +0 -49
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dandify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vincent Franco
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-07-28 00:00:00.000000000 Z
12
+ date: 2015-08-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: spree_core
@@ -17,56 +17,56 @@ dependencies:
17
17
  requirements:
18
18
  - - "~>"
19
19
  - !ruby/object:Gem::Version
20
- version: 2.3.0
20
+ version: '3.0'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - "~>"
26
26
  - !ruby/object:Gem::Version
27
- version: 2.3.0
27
+ version: '3.0'
28
28
  - !ruby/object:Gem::Dependency
29
- name: sass-rails
29
+ name: paper_trail
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
32
  - - "~>"
33
33
  - !ruby/object:Gem::Version
34
- version: 4.0.0
34
+ version: '4.0'
35
35
  type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - "~>"
40
40
  - !ruby/object:Gem::Version
41
- version: 4.0.0
41
+ version: '4.0'
42
42
  - !ruby/object:Gem::Dependency
43
- name: paper_trail
43
+ name: sass-rails
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
- - - "~>"
46
+ - - ">="
47
47
  - !ruby/object:Gem::Version
48
- version: '3.0'
49
- type: :runtime
48
+ version: '0'
49
+ type: :development
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
- - - "~>"
53
+ - - ">="
54
54
  - !ruby/object:Gem::Version
55
- version: '3.0'
55
+ version: '0'
56
56
  - !ruby/object:Gem::Dependency
57
- name: spring
57
+ name: coffee-rails
58
58
  requirement: !ruby/object:Gem::Requirement
59
59
  requirements:
60
- - - "~>"
60
+ - - ">="
61
61
  - !ruby/object:Gem::Version
62
- version: '1.1'
62
+ version: '0'
63
63
  type: :development
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
- - - "~>"
67
+ - - ">="
68
68
  - !ruby/object:Gem::Version
69
- version: '1.1'
69
+ version: '0'
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: sqlite3
72
72
  requirement: !ruby/object:Gem::Requirement
@@ -87,126 +87,112 @@ dependencies:
87
87
  requirements:
88
88
  - - "~>"
89
89
  - !ruby/object:Gem::Version
90
- version: '2.14'
90
+ version: '3.3'
91
91
  type: :development
92
92
  prerelease: false
93
93
  version_requirements: !ruby/object:Gem::Requirement
94
94
  requirements:
95
95
  - - "~>"
96
96
  - !ruby/object:Gem::Version
97
- version: '2.14'
97
+ version: '3.3'
98
98
  - !ruby/object:Gem::Dependency
99
99
  name: capybara
100
100
  requirement: !ruby/object:Gem::Requirement
101
101
  requirements:
102
102
  - - "~>"
103
103
  - !ruby/object:Gem::Version
104
- version: '2.2'
104
+ version: '2.4'
105
105
  type: :development
106
106
  prerelease: false
107
107
  version_requirements: !ruby/object:Gem::Requirement
108
108
  requirements:
109
109
  - - "~>"
110
110
  - !ruby/object:Gem::Version
111
- version: '2.2'
111
+ version: '2.4'
112
112
  - !ruby/object:Gem::Dependency
113
113
  name: database_cleaner
114
114
  requirement: !ruby/object:Gem::Requirement
115
115
  requirements:
116
116
  - - '='
117
117
  - !ruby/object:Gem::Version
118
- version: '1.2'
118
+ version: '1.4'
119
119
  type: :development
120
120
  prerelease: false
121
121
  version_requirements: !ruby/object:Gem::Requirement
122
122
  requirements:
123
123
  - - '='
124
124
  - !ruby/object:Gem::Version
125
- version: '1.2'
125
+ version: '1.4'
126
126
  - !ruby/object:Gem::Dependency
127
127
  name: poltergeist
128
128
  requirement: !ruby/object:Gem::Requirement
129
129
  requirements:
130
130
  - - '='
131
131
  - !ruby/object:Gem::Version
132
- version: '1.5'
132
+ version: '1.6'
133
133
  type: :development
134
134
  prerelease: false
135
135
  version_requirements: !ruby/object:Gem::Requirement
136
136
  requirements:
137
137
  - - '='
138
138
  - !ruby/object:Gem::Version
139
- version: '1.5'
139
+ version: '1.6'
140
140
  - !ruby/object:Gem::Dependency
141
141
  name: factory_girl
142
142
  requirement: !ruby/object:Gem::Requirement
143
143
  requirements:
144
144
  - - "~>"
145
145
  - !ruby/object:Gem::Version
146
- version: '4.4'
146
+ version: '4.5'
147
147
  type: :development
148
148
  prerelease: false
149
149
  version_requirements: !ruby/object:Gem::Requirement
150
150
  requirements:
151
151
  - - "~>"
152
152
  - !ruby/object:Gem::Version
153
- version: '4.4'
153
+ version: '4.5'
154
154
  - !ruby/object:Gem::Dependency
155
155
  name: simplecov
156
156
  requirement: !ruby/object:Gem::Requirement
157
157
  requirements:
158
158
  - - "~>"
159
159
  - !ruby/object:Gem::Version
160
- version: '0.7'
161
- type: :development
162
- prerelease: false
163
- version_requirements: !ruby/object:Gem::Requirement
164
- requirements:
165
- - - "~>"
166
- - !ruby/object:Gem::Version
167
- version: '0.7'
168
- - !ruby/object:Gem::Dependency
169
- name: pry
170
- requirement: !ruby/object:Gem::Requirement
171
- requirements:
172
- - - "~>"
173
- - !ruby/object:Gem::Version
174
- version: '0.9'
160
+ version: '0.10'
175
161
  type: :development
176
162
  prerelease: false
177
163
  version_requirements: !ruby/object:Gem::Requirement
178
164
  requirements:
179
165
  - - "~>"
180
166
  - !ruby/object:Gem::Version
181
- version: '0.9'
167
+ version: '0.10'
182
168
  - !ruby/object:Gem::Dependency
183
- name: debugger
169
+ name: pry-byebug
184
170
  requirement: !ruby/object:Gem::Requirement
185
171
  requirements:
186
172
  - - "~>"
187
173
  - !ruby/object:Gem::Version
188
- version: '1.6'
174
+ version: '3.2'
189
175
  type: :development
190
176
  prerelease: false
191
177
  version_requirements: !ruby/object:Gem::Requirement
192
178
  requirements:
193
179
  - - "~>"
194
180
  - !ruby/object:Gem::Version
195
- version: '1.6'
181
+ version: '3.2'
196
182
  - !ruby/object:Gem::Dependency
197
183
  name: shoulda-matchers
198
184
  requirement: !ruby/object:Gem::Requirement
199
185
  requirements:
200
186
  - - "~>"
201
187
  - !ruby/object:Gem::Version
202
- version: '2.5'
188
+ version: '2.8'
203
189
  type: :development
204
190
  prerelease: false
205
191
  version_requirements: !ruby/object:Gem::Requirement
206
192
  requirements:
207
193
  - - "~>"
208
194
  - !ruby/object:Gem::Version
209
- version: '2.5'
195
+ version: '2.8'
210
196
  description: Add dynamic styling to your store.
211
197
  email:
212
198
  executables: []
@@ -218,7 +204,7 @@ files:
218
204
  - Rakefile
219
205
  - app/assets/javascripts/spree/backend/dandify.js
220
206
  - app/assets/javascripts/spree/frontend/dandify.js
221
- - app/assets/stylesheets/spree/backend/dandify.css
207
+ - app/assets/stylesheets/spree/backend/dandify.scss
222
208
  - app/assets/stylesheets/spree/frontend/dandify.css
223
209
  - app/controllers/spree/admin/stylesheets_controller.rb
224
210
  - app/controllers/spree/stylesheets_controller.rb
@@ -227,8 +213,10 @@ files:
227
213
  - app/models/spree/blank_stylesheet.rb
228
214
  - app/models/spree/stylesheet.rb
229
215
  - app/models/spree/stylesheet_version.rb
216
+ - app/models/spree/unknown_user.rb
230
217
  - app/models/spree/user_decorator.rb
231
- - app/overrides/spree/admin/shared/_configuration_menu/add_dandify_to_admin_configuration_sidebar.html.erb.deface
218
+ - app/models/spree/user_identifier.rb
219
+ - app/overrides/spree/admin/shared/sub_menu/_configuration/add_dandify_to_admin_configuration_sidebar.html.erb.deface
232
220
  - app/overrides/spree/shared/_head/add_dandystyles_link.html.erb.deface
233
221
  - app/views/spree/admin/stylesheets/_form.html.erb
234
222
  - app/views/spree/admin/stylesheets/_versions.html.erb
@@ -238,22 +226,21 @@ files:
238
226
  - app/views/spree/stylesheets/show.css.erb
239
227
  - config/locales/en.yml
240
228
  - config/routes.rb
241
- - config/spring.rb
242
229
  - db/migrate/20140616202617_create_spree_stylesheets.rb
243
230
  - db/migrate/20140617221725_add_paper_trail_versions.rb
244
231
  - lib/dandify.rb
245
232
  - lib/dandify/engine.rb
246
233
  - lib/dandify/version.rb
247
234
  - lib/generators/dandify/install/install_generator.rb
248
- - lib/tasks/dandify_tasks.rake
249
235
  - spec/controllers/spree/admin/stylesheets_controller_spec.rb
250
236
  - spec/controllers/spree/stylesheets_controller_spec.rb
251
237
  - spec/factories/stylesheet_factory.rb
238
+ - spec/features/buttons_spec.rb
252
239
  - spec/features/dandy_style_spec.rb
253
- - spec/features/managing_stylsheet_spec.rb
240
+ - spec/features/managing_stylesheet_spec.rb
254
241
  - spec/features/sidebar_spec.rb
255
- - spec/features/viewing_admin_spec.rb
256
242
  - spec/helpers/admin/navigation_helper_spec.rb
243
+ - spec/helpers/admin/stylesheet_helper_spec.rb
257
244
  - spec/models/spree/blank_stylesheet_spec.rb
258
245
  - spec/models/spree/stylesheet_spec.rb
259
246
  - spec/spec_helper.rb
@@ -269,7 +256,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
269
256
  requirements:
270
257
  - - ">="
271
258
  - !ruby/object:Gem::Version
272
- version: 1.9.3
259
+ version: 2.0.0
273
260
  required_rubygems_version: !ruby/object:Gem::Requirement
274
261
  requirements:
275
262
  - - ">="
@@ -278,7 +265,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
278
265
  requirements:
279
266
  - none
280
267
  rubyforge_project:
281
- rubygems_version: 2.2.0
268
+ rubygems_version: 2.4.5
282
269
  signing_key:
283
270
  specification_version: 4
284
271
  summary: Add dynamic styling to your store.
@@ -286,11 +273,12 @@ test_files:
286
273
  - spec/controllers/spree/admin/stylesheets_controller_spec.rb
287
274
  - spec/controllers/spree/stylesheets_controller_spec.rb
288
275
  - spec/factories/stylesheet_factory.rb
276
+ - spec/features/buttons_spec.rb
289
277
  - spec/features/dandy_style_spec.rb
290
- - spec/features/managing_stylsheet_spec.rb
278
+ - spec/features/managing_stylesheet_spec.rb
291
279
  - spec/features/sidebar_spec.rb
292
- - spec/features/viewing_admin_spec.rb
293
280
  - spec/helpers/admin/navigation_helper_spec.rb
281
+ - spec/helpers/admin/stylesheet_helper_spec.rb
294
282
  - spec/models/spree/blank_stylesheet_spec.rb
295
283
  - spec/models/spree/stylesheet_spec.rb
296
284
  - spec/spec_helper.rb
@@ -1,42 +0,0 @@
1
- /* Icon rollover - Restore */
2
- table th.actions .fa-history:hover,
3
- table td.actions .fa-history:hover {
4
- background-color: #9fc820;
5
- color: #ffffff;
6
- }
7
-
8
- table tbody tr.highlight.action-restore td {
9
- background-color: #f8fceb;
10
- border-color: #e0f1a9;
11
- }
12
-
13
- table tbody tr.before-highlight.action-restore td {
14
- border-bottom-color: #e0f1a9;
15
- }
16
-
17
- /* PowerTip - Restore */
18
- #powerTip.restore {
19
- background-color: #9fc820;
20
- }
21
-
22
- #powerTip.restore.n:before,
23
- #powerTip.restore.ne:before,
24
- #powerTip.restore.nw:before {
25
- border-top-color: #9fc820;
26
- }
27
-
28
- #powerTip.restore.e:before,
29
- #powerTip.restore.nw:before,
30
- #powerTip.restore.sw:before {
31
- border-right-color: #9fc820;
32
- }
33
-
34
- #powerTip.restore.s:before,
35
- #powerTip.restore.se:before,
36
- #powerTip.restore.sw:before {
37
- border-bottom-color: #9fc820;
38
- }
39
-
40
- #powerTip.restore.w:before {
41
- border-left-color: #9fc820;
42
- }
@@ -1 +0,0 @@
1
- Spring.application_root = './spec/dummy'
@@ -1,4 +0,0 @@
1
- # desc "Explaining what the task does"
2
- # task :dandify do
3
- # # Task goes here
4
- # end
@@ -1,80 +0,0 @@
1
- require 'spec_helper'
2
-
3
- feature 'Managing stylesheets' do
4
- stub_authorization!
5
-
6
- let(:show_path) { spree.admin_stylesheets_path }
7
- let(:new_path) { spree.new_admin_stylesheets_path }
8
- let(:edit_path) { spree.edit_admin_stylesheets_path }
9
- let(:restore_path) { spree.restore_admin_stylesheets_path }
10
- let(:style) { 'body {display: none;}' }
11
-
12
- context 'without existing style' do
13
- scenario 'user can create styles' do
14
- visit new_path
15
- fill_in Spree.t('dandify.form.label'), with: style
16
- click_button Spree.t(:create)
17
-
18
- expect(page.status_code).to be(200)
19
- expect(page).to have_text Spree.t('dandify.show.title')
20
- end
21
- end
22
-
23
- context 'with existing style' do
24
- before { create :stylesheet }
25
-
26
- scenario 'user sees first audit trail', versioning: true do
27
- visit show_path
28
-
29
- within_row(1) { expect(page).to have_content('Create') }
30
- end
31
-
32
- scenario 'user can edit exiting styles' do
33
- visit edit_path
34
-
35
- fill_in Spree.t('dandify.form.label'), with: style
36
- click_button Spree.t(:update)
37
-
38
- expect(page.status_code).to be(200)
39
- expect(page).to have_text(Spree.t('dandify.show.title'))
40
- end
41
-
42
- scenario 'user creates new audit trail on edit', versioning: true do
43
- visit edit_path
44
-
45
- fill_in Spree.t('dandify.form.label'), with: style
46
- click_button Spree.t(:update)
47
-
48
- visit show_path
49
-
50
- within_row(1) { page.should have_content('Update') }
51
- within_row(2) { page.should have_content('Create') }
52
- end
53
- end
54
-
55
- context 'restoring stylesheet' do
56
- before { create :stylesheet }
57
-
58
- let(:css_path) { 'table#listing_versions tbody tr' }
59
-
60
- scenario 'not possible when there is only one version', versioning: true do
61
- visit show_path
62
-
63
- page.should have_css(css_path, count: 1)
64
- within_row(1) { expect(page).to have_link('', href: edit_path) }
65
- end
66
-
67
- scenario 'user can restore to previous version', versioning: true do
68
- visit edit_path
69
-
70
- fill_in Spree.t('dandify.form.label'), with: style
71
- click_button Spree.t(:update)
72
-
73
- visit show_path
74
-
75
- page.should have_css(css_path, count: 2)
76
- within_row(1) { expect(page).to have_link('', href: edit_path) }
77
- within_row(2) { expect(page).to have_link('', href: restore_path) }
78
- end
79
- end
80
- end
@@ -1,49 +0,0 @@
1
- require 'spec_helper'
2
-
3
- feature 'Viewing stylesheet administration page' do
4
- stub_authorization!
5
-
6
- let(:show_path) { spree.admin_stylesheets_path }
7
-
8
- context 'without existing style' do
9
- scenario 'user views page with no stylesheet' do
10
- visit show_path
11
-
12
- expect(page).to have_text Spree.t('dandify.show.none')
13
- end
14
-
15
- scenario 'user has access to create link' do
16
- visit show_path
17
-
18
- expect(page).to have_text Spree.t('dandify.show.buttons.new')
19
- end
20
-
21
- scenario 'user does not have access to edit link' do
22
- visit show_path
23
-
24
- expect(page).to_not have_text Spree.t('dandify.show.buttons.edit')
25
- end
26
- end
27
-
28
- context 'with existing style' do
29
- before { create :stylesheet }
30
-
31
- scenario 'user views page with an active stylesheet' do
32
- visit show_path
33
-
34
- expect(page).to_not have_text Spree.t('dandify.show.none')
35
- end
36
-
37
- scenario 'user does not have access to create link' do
38
- visit show_path
39
-
40
- expect(page).to_not have_text Spree.t('dandify.show.buttons.new')
41
- end
42
-
43
- scenario 'user has access to edit link' do
44
- visit show_path
45
-
46
- expect(page).to have_text Spree.t('dandify.show.buttons.edit')
47
- end
48
- end
49
- end