smarter_listing 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +77 -0
- data/Rakefile +32 -0
- data/app/views/smart_listing/_action_copy.html.erb +3 -0
- data/app/views/smarter_listing/_form_logic.js +1 -0
- data/app/views/smarter_listing/copy.js.erb +2 -0
- data/app/views/smarter_listing/create.js.erb +1 -0
- data/app/views/smarter_listing/destroy.js.erb +2 -0
- data/app/views/smarter_listing/edit.js.erb +2 -0
- data/app/views/smarter_listing/index.js.erb +1 -0
- data/app/views/smarter_listing/new.js.erb +2 -0
- data/app/views/smarter_listing/update.js.erb +1 -0
- data/lib/smarter_listing.rb +7 -0
- data/lib/smarter_listing/controller_extension.rb +77 -0
- data/lib/smarter_listing/engine.rb +4 -0
- data/lib/smarter_listing/helper.rb +92 -0
- data/lib/smarter_listing/loader.rb +25 -0
- data/lib/smarter_listing/version.rb +3 -0
- data/lib/tasks/smarter_listing_tasks.rake +4 -0
- data/test/controllers/listings_controller_test.rb +57 -0
- data/test/dummy/README.rdoc +28 -0
- data/test/dummy/Rakefile +6 -0
- data/test/dummy/app/assets/javascripts/application.js +13 -0
- data/test/dummy/app/assets/stylesheets/application.css +15 -0
- data/test/dummy/app/controllers/application_controller.rb +5 -0
- data/test/dummy/app/controllers/listings_controller.rb +7 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/models/listing.rb +2 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/app/views/listings/_form.html.erb +8 -0
- data/test/dummy/app/views/listings/_listing.html.erb +5 -0
- data/test/dummy/app/views/listings/_table_header.html.erb +14 -0
- data/test/dummy/app/views/listings/index.html.erb +8 -0
- data/test/dummy/bin/bundle +3 -0
- data/test/dummy/bin/rails +4 -0
- data/test/dummy/bin/rake +4 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/config/application.rb +23 -0
- data/test/dummy/config/boot.rb +5 -0
- data/test/dummy/config/database.yml +25 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +37 -0
- data/test/dummy/config/environments/production.rb +82 -0
- data/test/dummy/config/environments/test.rb +39 -0
- data/test/dummy/config/initializers/assets.rb +8 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/test/dummy/config/initializers/inflections.rb +16 -0
- data/test/dummy/config/initializers/mime_types.rb +4 -0
- data/test/dummy/config/initializers/session_store.rb +3 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/en.yml +23 -0
- data/test/dummy/config/routes.rb +5 -0
- data/test/dummy/config/secrets.yml +22 -0
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/migrate/20140724101100_create_listings.rb +11 -0
- data/test/dummy/db/schema.rb +24 -0
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/development.log +16 -0
- data/test/dummy/log/test.log +21360 -0
- data/test/fixtures/listings.yml +4 -0
- data/test/helpers/smarter_listing_loader_test.rb +39 -0
- data/test/test_helper.rb +17 -0
- metadata +196 -0
@@ -0,0 +1,39 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class SmarterListingLoaderTest < ActiveSupport::TestCase
|
4
|
+
|
5
|
+
test 'smarter listing is loaded' do
|
6
|
+
assert_respond_to ActionController::Base, :smarter_listing
|
7
|
+
end
|
8
|
+
|
9
|
+
test 'controller extensions are loaded' do
|
10
|
+
assert_not_includes ListingsController.included_modules, SmartListing::Helper::ControllerExtensions
|
11
|
+
assert_not_includes ListingsController.included_modules, SmarterListing::ControllerExtension
|
12
|
+
ListingsController.smarter_listing
|
13
|
+
assert_includes ListingsController.included_modules, SmartListing::Helper::ControllerExtensions
|
14
|
+
assert_includes ListingsController.included_modules, SmarterListing::ControllerExtension
|
15
|
+
end
|
16
|
+
|
17
|
+
test 'helper methods included' do
|
18
|
+
ListingsController.smarter_listing
|
19
|
+
methods = SmartListing::Helper.instance_methods + SmarterListing::Helper.instance_methods
|
20
|
+
methods.each do |method|
|
21
|
+
assert_includes ListingsController.helpers.methods, method
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
test 'attribute filter_parameter' do
|
26
|
+
assert_not_includes ListingsController.instance_variables, :@filter_parameter
|
27
|
+
end
|
28
|
+
|
29
|
+
test 'the default filter_parameter' do
|
30
|
+
ListingsController.smarter_listing
|
31
|
+
assert_includes ListingsController.instance_variables, :@filter_parameter
|
32
|
+
assert_equal :filter, ListingsController.instance_variable_get(:@filter_parameter)
|
33
|
+
end
|
34
|
+
|
35
|
+
test 'setting a filter_parameter' do
|
36
|
+
ListingsController.smarter_listing :qry
|
37
|
+
assert_equal :qry, ListingsController.instance_variable_get(:@filter_parameter)
|
38
|
+
end
|
39
|
+
end
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# Configure Rails Environment
|
2
|
+
ENV['RAILS_ENV'] = 'test'
|
3
|
+
|
4
|
+
require File.expand_path('../dummy/config/environment.rb', __FILE__)
|
5
|
+
require 'rails/test_help'
|
6
|
+
|
7
|
+
Rails.backtrace_cleaner.remove_silencers!
|
8
|
+
|
9
|
+
# Load support files
|
10
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
11
|
+
|
12
|
+
# Load fixtures from the engine
|
13
|
+
ActiveSupport::TestCase.fixture_path = File.expand_path('../fixtures', __FILE__)
|
14
|
+
|
15
|
+
class ActionController::TestCase
|
16
|
+
fixtures :all
|
17
|
+
end
|
metadata
ADDED
@@ -0,0 +1,196 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: smarter_listing
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Michael Sprauer
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-09-10 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rails
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '4'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '4'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: smart_listing
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: sqlite3
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3'
|
55
|
+
description: DRY improvements to the fine gem "smart_listing". See http://showcase.sology.eu/smart_listing
|
56
|
+
for more details
|
57
|
+
email:
|
58
|
+
- ms@inline.de
|
59
|
+
executables: []
|
60
|
+
extensions: []
|
61
|
+
extra_rdoc_files: []
|
62
|
+
files:
|
63
|
+
- MIT-LICENSE
|
64
|
+
- README.md
|
65
|
+
- Rakefile
|
66
|
+
- app/views/smart_listing/_action_copy.html.erb
|
67
|
+
- app/views/smarter_listing/_form_logic.js
|
68
|
+
- app/views/smarter_listing/copy.js.erb
|
69
|
+
- app/views/smarter_listing/create.js.erb
|
70
|
+
- app/views/smarter_listing/destroy.js.erb
|
71
|
+
- app/views/smarter_listing/edit.js.erb
|
72
|
+
- app/views/smarter_listing/index.js.erb
|
73
|
+
- app/views/smarter_listing/new.js.erb
|
74
|
+
- app/views/smarter_listing/update.js.erb
|
75
|
+
- lib/smarter_listing.rb
|
76
|
+
- lib/smarter_listing/controller_extension.rb
|
77
|
+
- lib/smarter_listing/engine.rb
|
78
|
+
- lib/smarter_listing/helper.rb
|
79
|
+
- lib/smarter_listing/loader.rb
|
80
|
+
- lib/smarter_listing/version.rb
|
81
|
+
- lib/tasks/smarter_listing_tasks.rake
|
82
|
+
- test/controllers/listings_controller_test.rb
|
83
|
+
- test/dummy/README.rdoc
|
84
|
+
- test/dummy/Rakefile
|
85
|
+
- test/dummy/app/assets/javascripts/application.js
|
86
|
+
- test/dummy/app/assets/stylesheets/application.css
|
87
|
+
- test/dummy/app/controllers/application_controller.rb
|
88
|
+
- test/dummy/app/controllers/listings_controller.rb
|
89
|
+
- test/dummy/app/helpers/application_helper.rb
|
90
|
+
- test/dummy/app/models/listing.rb
|
91
|
+
- test/dummy/app/views/layouts/application.html.erb
|
92
|
+
- test/dummy/app/views/listings/_form.html.erb
|
93
|
+
- test/dummy/app/views/listings/_listing.html.erb
|
94
|
+
- test/dummy/app/views/listings/_table_header.html.erb
|
95
|
+
- test/dummy/app/views/listings/index.html.erb
|
96
|
+
- test/dummy/bin/bundle
|
97
|
+
- test/dummy/bin/rails
|
98
|
+
- test/dummy/bin/rake
|
99
|
+
- test/dummy/config.ru
|
100
|
+
- test/dummy/config/application.rb
|
101
|
+
- test/dummy/config/boot.rb
|
102
|
+
- test/dummy/config/database.yml
|
103
|
+
- test/dummy/config/environment.rb
|
104
|
+
- test/dummy/config/environments/development.rb
|
105
|
+
- test/dummy/config/environments/production.rb
|
106
|
+
- test/dummy/config/environments/test.rb
|
107
|
+
- test/dummy/config/initializers/assets.rb
|
108
|
+
- test/dummy/config/initializers/backtrace_silencers.rb
|
109
|
+
- test/dummy/config/initializers/cookies_serializer.rb
|
110
|
+
- test/dummy/config/initializers/filter_parameter_logging.rb
|
111
|
+
- test/dummy/config/initializers/inflections.rb
|
112
|
+
- test/dummy/config/initializers/mime_types.rb
|
113
|
+
- test/dummy/config/initializers/session_store.rb
|
114
|
+
- test/dummy/config/initializers/wrap_parameters.rb
|
115
|
+
- test/dummy/config/locales/en.yml
|
116
|
+
- test/dummy/config/routes.rb
|
117
|
+
- test/dummy/config/secrets.yml
|
118
|
+
- test/dummy/db/development.sqlite3
|
119
|
+
- test/dummy/db/migrate/20140724101100_create_listings.rb
|
120
|
+
- test/dummy/db/schema.rb
|
121
|
+
- test/dummy/db/test.sqlite3
|
122
|
+
- test/dummy/log/development.log
|
123
|
+
- test/dummy/log/test.log
|
124
|
+
- test/fixtures/listings.yml
|
125
|
+
- test/helpers/smarter_listing_loader_test.rb
|
126
|
+
- test/test_helper.rb
|
127
|
+
homepage: http://github.com/MichaelSp/smarter_listing
|
128
|
+
licenses:
|
129
|
+
- MIT
|
130
|
+
metadata: {}
|
131
|
+
post_install_message:
|
132
|
+
rdoc_options: []
|
133
|
+
require_paths:
|
134
|
+
- lib
|
135
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
136
|
+
requirements:
|
137
|
+
- - ">="
|
138
|
+
- !ruby/object:Gem::Version
|
139
|
+
version: '0'
|
140
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
141
|
+
requirements:
|
142
|
+
- - ">="
|
143
|
+
- !ruby/object:Gem::Version
|
144
|
+
version: '0'
|
145
|
+
requirements: []
|
146
|
+
rubyforge_project:
|
147
|
+
rubygems_version: 2.4.1
|
148
|
+
signing_key:
|
149
|
+
specification_version: 4
|
150
|
+
summary: Smart Listing even smarter (and DRYer)
|
151
|
+
test_files:
|
152
|
+
- test/dummy/app/assets/javascripts/application.js
|
153
|
+
- test/dummy/app/assets/stylesheets/application.css
|
154
|
+
- test/dummy/app/views/listings/_form.html.erb
|
155
|
+
- test/dummy/app/views/listings/_listing.html.erb
|
156
|
+
- test/dummy/app/views/listings/index.html.erb
|
157
|
+
- test/dummy/app/views/listings/_table_header.html.erb
|
158
|
+
- test/dummy/app/views/layouts/application.html.erb
|
159
|
+
- test/dummy/app/helpers/application_helper.rb
|
160
|
+
- test/dummy/app/models/listing.rb
|
161
|
+
- test/dummy/app/controllers/application_controller.rb
|
162
|
+
- test/dummy/app/controllers/listings_controller.rb
|
163
|
+
- test/dummy/config/locales/en.yml
|
164
|
+
- test/dummy/config/environment.rb
|
165
|
+
- test/dummy/config/environments/development.rb
|
166
|
+
- test/dummy/config/environments/test.rb
|
167
|
+
- test/dummy/config/environments/production.rb
|
168
|
+
- test/dummy/config/application.rb
|
169
|
+
- test/dummy/config/routes.rb
|
170
|
+
- test/dummy/config/boot.rb
|
171
|
+
- test/dummy/config/initializers/backtrace_silencers.rb
|
172
|
+
- test/dummy/config/initializers/filter_parameter_logging.rb
|
173
|
+
- test/dummy/config/initializers/mime_types.rb
|
174
|
+
- test/dummy/config/initializers/assets.rb
|
175
|
+
- test/dummy/config/initializers/session_store.rb
|
176
|
+
- test/dummy/config/initializers/wrap_parameters.rb
|
177
|
+
- test/dummy/config/initializers/cookies_serializer.rb
|
178
|
+
- test/dummy/config/initializers/inflections.rb
|
179
|
+
- test/dummy/config/database.yml
|
180
|
+
- test/dummy/config/secrets.yml
|
181
|
+
- test/dummy/README.rdoc
|
182
|
+
- test/dummy/config.ru
|
183
|
+
- test/dummy/bin/bundle
|
184
|
+
- test/dummy/bin/rails
|
185
|
+
- test/dummy/bin/rake
|
186
|
+
- test/dummy/db/schema.rb
|
187
|
+
- test/dummy/db/migrate/20140724101100_create_listings.rb
|
188
|
+
- test/dummy/db/test.sqlite3
|
189
|
+
- test/dummy/db/development.sqlite3
|
190
|
+
- test/dummy/Rakefile
|
191
|
+
- test/dummy/log/test.log
|
192
|
+
- test/dummy/log/development.log
|
193
|
+
- test/test_helper.rb
|
194
|
+
- test/helpers/smarter_listing_loader_test.rb
|
195
|
+
- test/fixtures/listings.yml
|
196
|
+
- test/controllers/listings_controller_test.rb
|